Skip to content

Commit fcb351b

Browse files
authored
chore: update files
1 parent d743385 commit fcb351b

5 files changed

Lines changed: 138 additions & 77 deletions

File tree

src/layouts/MainLayout.astro

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,16 @@ const resolvedImage = /^(https?:)?\/\//.test(image) ? image : new URL(withBase(i
6060
<script is:inline>
6161
(() => {
6262
const storageKey = "rapidai-theme";
63+
const themeDefaultVersionKey = "rapidai-theme-default-version";
64+
const themeDefaultVersion = "2026-04-23-system";
6365
const root = document.documentElement;
66+
const currentThemeDefaultVersion = window.localStorage.getItem(themeDefaultVersionKey);
67+
68+
if (currentThemeDefaultVersion !== themeDefaultVersion) {
69+
window.localStorage.removeItem(storageKey);
70+
window.localStorage.setItem(themeDefaultVersionKey, themeDefaultVersion);
71+
}
72+
6473
const stored = window.localStorage.getItem(storageKey);
6574
const systemPrefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
6675
const mode = stored === "light" || stored === "dark" || stored === "system" ? stored : "system";
@@ -243,6 +252,8 @@ const resolvedImage = /^(https?:)?\/\//.test(image) ? image : new URL(withBase(i
243252
const button = document.querySelector(".theme-toggle");
244253
const label = document.querySelector(".theme-toggle-label");
245254
const storageKey = "rapidai-theme";
255+
const themeDefaultVersionKey = "rapidai-theme-default-version";
256+
const themeDefaultVersion = "2026-04-23-system";
246257
const media = window.matchMedia("(prefers-color-scheme: dark)");
247258
const modes = ["system", "dark", "light"];
248259
const modeLabels = {
@@ -255,6 +266,12 @@ const resolvedImage = /^(https?:)?\/\//.test(image) ? image : new URL(withBase(i
255266
return;
256267
}
257268

269+
if (window.localStorage.getItem(themeDefaultVersionKey) !== themeDefaultVersion) {
270+
window.localStorage.removeItem(storageKey);
271+
window.localStorage.setItem(themeDefaultVersionKey, themeDefaultVersion);
272+
root.dataset.themeMode = "system";
273+
}
274+
258275
const resolveTheme = (mode) => mode === "system" ? (media.matches ? "dark" : "light") : mode;
259276

260277
const getMode = () => {

src/styles/foundation.css

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
:root {
2+
--site-header-offset: 84px;
23
--bg: #06111f;
34
--bg-deep: #030711;
45
--panel: rgba(10, 21, 40, 0.84);
@@ -28,6 +29,7 @@ html {
2829
linear-gradient(180deg, #091325 0%, #050b16 48%, #04070f 100%);
2930
color: var(--text);
3031
scroll-behavior: smooth;
32+
scroll-padding-top: calc(var(--site-header-offset) + 18px);
3133
}
3234

3335
body {
@@ -51,6 +53,7 @@ img {
5153

5254
main {
5355
display: block;
56+
padding-top: var(--site-header-offset);
5457
}
5558

5659
.site-shell {
@@ -119,14 +122,19 @@ main {
119122
}
120123

121124
.site-header,
122-
.site-footer,
123125
.hero,
124126
.content-section,
125127
.page-hero {
126128
width: min(1280px, calc(100vw - 32px));
127129
margin: 0 auto;
128130
}
129131

132+
.site-footer {
133+
width: 100%;
134+
max-width: none;
135+
margin: 0;
136+
}
137+
130138
.hero > *,
131139
.page-hero > *,
132140
.home-signal > *,
@@ -143,8 +151,10 @@ main {
143151
}
144152

145153
.site-header {
146-
position: sticky;
154+
position: fixed;
147155
top: 0;
156+
left: 0;
157+
right: 0;
148158
z-index: 20;
149159
display: grid;
150160
grid-template-columns: auto minmax(0, 1fr) auto;
@@ -154,10 +164,10 @@ main {
154164
max-width: none;
155165
margin-top: 0;
156166
padding: 16px max(18px, calc((100vw - 1280px) / 2 + 20px));
157-
background: linear-gradient(90deg, rgba(25, 13, 56, 0.96), rgba(57, 24, 111, 0.92));
167+
background: linear-gradient(90deg, rgba(6, 12, 24, 0.98), rgba(18, 28, 52, 0.96));
158168
border: 0;
159-
border-bottom: 1px solid rgba(193, 166, 255, 0.1);
160-
backdrop-filter: blur(18px);
169+
border-bottom: 1px solid rgba(138, 170, 226, 0.16);
170+
backdrop-filter: blur(20px);
161171
}
162172

163173
.site-header-actions {

src/styles/pages.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,9 @@
388388
display: flex;
389389
justify-content: space-between;
390390
gap: 2rem;
391-
padding: 2.5rem 0 3rem;
391+
padding: 2.7rem max(18px, calc((100vw - 1280px) / 2 + 20px)) 3rem;
392392
border-top: 1px solid var(--line);
393+
background: linear-gradient(180deg, rgba(8, 14, 27, 0.7), rgba(3, 7, 15, 0.96));
393394
}
394395

395396
.footer-brand {

src/styles/responsive.css

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
@media (max-width: 960px) {
2+
:root {
3+
--site-header-offset: 116px;
4+
}
5+
26
.site-header,
3-
.site-footer,
47
.hero,
58
.content-section,
69
.page-hero {
@@ -96,6 +99,10 @@
9699
}
97100

98101
@media (max-width: 820px) {
102+
:root {
103+
--site-header-offset: 82px;
104+
}
105+
99106
.site-header {
100107
display: grid;
101108
grid-template-columns: minmax(0, 1fr) auto auto;
@@ -385,8 +392,11 @@
385392
}
386393

387394
@media (max-width: 560px) {
395+
:root {
396+
--site-header-offset: 74px;
397+
}
398+
388399
.site-header,
389-
.site-footer,
390400
.hero,
391401
.content-section,
392402
.page-hero {
@@ -397,6 +407,10 @@
397407
padding: 12px 14px;
398408
}
399409

410+
.site-footer {
411+
padding: 2.15rem 14px 2.5rem;
412+
}
413+
400414
.brand {
401415
gap: 0.6rem;
402416
}
@@ -556,8 +570,11 @@
556570
}
557571

558572
@media (max-width: 430px) {
573+
:root {
574+
--site-header-offset: 68px;
575+
}
576+
559577
.site-header,
560-
.site-footer,
561578
.hero,
562579
.content-section,
563580
.page-hero {
@@ -569,6 +586,10 @@
569586
padding: 11px 13px;
570587
}
571588

589+
.site-footer {
590+
padding: 2rem 13px 2.35rem;
591+
}
592+
572593
.brand {
573594
font-size: 0.98rem;
574595
}
@@ -668,8 +689,11 @@
668689
}
669690

670691
@media (max-width: 390px) {
692+
:root {
693+
--site-header-offset: 64px;
694+
}
695+
671696
.site-header,
672-
.site-footer,
673697
.hero,
674698
.content-section,
675699
.page-hero {
@@ -680,6 +704,10 @@
680704
padding: 10px 12px;
681705
}
682706

707+
.site-footer {
708+
padding: 1.9rem 12px 2.2rem;
709+
}
710+
683711
.brand span {
684712
font-size: 0.94rem;
685713
}

0 commit comments

Comments
 (0)