Commit 10b9c0a
Fix mobile scrollytelling: rootMargin + lower threshold
On mobile the sticky diagram panel covers the top 40vh, so
IntersectionObserver (with viewport as root) kept steps "intersecting"
even when they were visually hidden behind the panel.
Fix: on screens ≤900px use rootMargin '-40% 0px 0px 0px' to exclude
the sticky-panel band from the observation area, and lower the threshold
from 0.5 → 0.3 so diagram updates fire earlier (more responsive feel).
Observer is also rebuilt on resize/orientation change.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 4f2d061 commit 10b9c0a
1 file changed
Lines changed: 22 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
255 | 266 | | |
256 | | - | |
| 267 | + | |
257 | 268 | | |
| 269 | + | |
258 | 270 | | |
259 | 271 | | |
260 | 272 | | |
261 | | - | |
| 273 | + | |
262 | 274 | | |
263 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
264 | 279 | | |
265 | 280 | | |
266 | 281 | | |
0 commit comments