Skip to content

Commit b09b490

Browse files
committed
Merge branch 'main' into a11y-fixes
2 parents f5a0d84 + 07a918d commit b09b490

19 files changed

Lines changed: 127 additions & 63 deletions

public/baseline-status.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/social.png

-18.5 KB
Loading

public/video/animate-to-auto.mp4

74.5 KB
Binary file not shown.
416 KB
Binary file not shown.
1.68 MB
Binary file not shown.
1.21 MB
Binary file not shown.

src/components/footer.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import Authors from "./authors.astro";
3535
padding-block-end: 100px;
3636

3737
@media (orientation: landscape) {
38-
min-block-size: 1100px;
38+
min-block-size: 1100px !important;
3939
}
4040

4141
background-image: url(/biomes/cyberspace-sidebar.png),

src/components/hero.astro

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const totalFeatures = biomes.reduce((total, biome) => {
4444
</div>
4545
<div>
4646
<p class="sub-title">
47-
Chrome and <span class="callout"><Icon aria-label="CSS" name="css" size="1ch" title="CSS" /> in 2024</span> journeyed<br>
47+
Chrome and <span class="callout"><Icon aria-label="CSS" name="css" size="1ch" title="CSS" /> CSS</span> in 2024 journeyed<br>
4848
through the <b>forest</b>, over the <b>mountains</b>, and across the <b>seas</b>…
4949
</p>
5050
</div>
@@ -239,6 +239,13 @@ const totalFeatures = biomes.reduce((total, biome) => {
239239
animation-range: 25% 75%;
240240
}
241241
}
242+
/* Center stan when no SDA or no motion */
243+
@media (prefers-reduced-motion: reduce) {
244+
margin: 0 auto;
245+
}
246+
@supports not (animation-timeline: view()) {
247+
margin: 0 auto;
248+
}
242249
}
243250
}
244251
}
@@ -277,11 +284,16 @@ const totalFeatures = biomes.reduce((total, biome) => {
277284
transform-origin: center;
278285

279286
@media (prefers-reduced-motion: no-preference) {
280-
animation:
281-
particle-scroll linear both,
282-
particle-enter 1s ease;
283-
animation-timeline: scroll(y root), auto;
284-
animation-range: 0vh var(--range);
287+
@supports (animation-timeline: view()) {
288+
animation:
289+
particle-scroll linear both,
290+
particle-enter 1s ease;
291+
animation-timeline: scroll(y root), auto;
292+
animation-range: 0vh var(--range);
293+
}
294+
@supports not (animation-timeline: view()) {
295+
animation: particle-enter 1s ease;
296+
}
285297
}
286298

287299
&.pixel {

src/components/nav.aside.astro

Lines changed: 55 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,11 @@ const { biomes } = Astro.props;
107107
e.target.lastScrollTop = st <= 0 ? 0 : st;
108108
}
109109

110-
const observer = new IntersectionObserver(
110+
const biomeObserver = new IntersectionObserver(
111111
(entries) => {
112112
entries.forEach((entry) => {
113113
if (entry.isIntersecting) {
114-
const details = document.querySelector(
115-
`#${entry.target.getAttribute("data-details-target")}`
116-
);
114+
const details = document.querySelector(`#${entry.target.getAttribute("data-details-target")}`);
117115
details.setAttribute("open", "");
118116
}
119117
});
@@ -123,15 +121,49 @@ const { biomes } = Astro.props;
123121
}
124122
);
125123

124+
const featureObserver = new IntersectionObserver(
125+
(entries) => {
126+
entries.forEach((entry) => {
127+
const id = entry.target.getAttribute("id");
128+
const $li = document.querySelector(`aside nav details li:has(a[href="#${id}"])`);
129+
130+
if (!$li) return;
131+
132+
if (entry.isIntersecting) {
133+
$li.classList.add('in-view');
134+
} else {
135+
$li.classList.remove('in-view');
136+
}
137+
});
138+
},
139+
{
140+
threshold: 0,
141+
}
142+
);
143+
126144
function observeForSidenav() {
127145
document.querySelectorAll(".biome > section").forEach((biome) => {
128-
observer.observe(biome);
146+
biomeObserver.observe(biome);
147+
148+
if (!CSS.supports('animation-timeline: view()')) {
149+
const features = biome.querySelectorAll('.features-list > div > article');
150+
features.forEach(feature => {
151+
featureObserver.observe(feature);
152+
});
153+
}
129154
});
130155
}
131156

132157
function unobserveForSidenav() {
133158
document.querySelectorAll(".biome > section").forEach((biome) => {
134-
observer.unobserve(biome);
159+
biomeObserver.unobserve(biome);
160+
161+
if (!CSS.supports('animation-timeline: view()')) {
162+
const features = biome.querySelectorAll('.features-list > div > article');
163+
features.forEach(feature => {
164+
featureObserver.unobserve(feature);
165+
});
166+
}
135167
});
136168
}
137169

@@ -246,14 +278,26 @@ const { biomes } = Astro.props;
246278
position: absolute;
247279
top: 0;
248280
left: 4px;
249-
background: var(--link);
250-
281+
251282
inline-size: 3px;
252283
block-size: 100%;
284+
285+
/* SDA ScrollSpy */
286+
@supports (animation-timeline: view()) {
287+
background: var(--link);
288+
transform: scaleY(0);
289+
animation: i-spy linear;
290+
animation-timeline: var(--_view-timeline);
291+
}
292+
293+
@supports not (animation-timeline: view()) {
294+
background: transparent;
295+
}
296+
}
253297

254-
transform: scaleY(0);
255-
animation: i-spy linear;
256-
animation-timeline: var(--_view-timeline);
298+
/* IntersectionObserver-based ScrollSpy */
299+
&.in-view::before {
300+
background: var(--link);
257301
}
258302

259303
& code {

src/components/theme.switch.astro

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,14 @@
119119
}
120120

121121
@media (prefers-reduced-motion: no-preference) {
122-
::view-transition-old(root) {
123-
animation: none;
124-
}
122+
@media(width <= 1600px) {
123+
::view-transition-old(root) {
124+
animation: none;
125+
}
125126

126-
::view-transition-new(root) {
127-
animation: 2.5s cubic-bezier(0.25, 1, 0.3, 1) circle-in-top-right forwards;
127+
::view-transition-new(root) {
128+
animation: 2s cubic-bezier(0.25, 1, 0.3, 1) circle-in-top-right forwards;
129+
}
128130
}
129131
}
130132
</style>

0 commit comments

Comments
 (0)