diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-10 12:01:49 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-10 12:01:49 +0200 |
| commit | 70fab005093cd92bfbde1bfa3380c3dc873bdfcf (patch) | |
| tree | 94c2aa4e0c827b9aea57e66210fd616717234d88 /assets/js | |
| parent | c42150058196f5affad5c6c590e99dd2fc7321c3 (diff) | |
| download | danixxyz-theme-70fab005093cd92bfbde1bfa3380c3dc873bdfcf.tar.gz danixxyz-theme-70fab005093cd92bfbde1bfa3380c3dc873bdfcf.zip | |
feat: align homepage to mockup-a with centered hero, terminal animation, article grid
Restructure hero layout with centered .hero-container (max-width 1080px),
update hero text (prompt "welcome to", button "About Me" → /is/), add
terminal widget title bar and staggered fade-in animation, replace scroll
indicator with animated line.
Add section header (eyebrow + title) above articles, new vertical .article-card
grid layout with solid type badges (sharp corners, sharp badges), implement
scroll reveal stagger (90ms per sibling). Update terminal color palette to
use proper CSS variables. Remove ambient glow from hero.
Changes follow THEMING-STANDARD: semantic color variables, mobile-first
responsive design, prefers-reduced-motion support, WCAG AA accessibility.
- hero.html: new .hero-container wrapper, typed terminal content, scroll line
- hero.css: restructure layout, add color classes, stagger animation, scroll pulse
- home.html: add section header, .articles-grid, pass context="home" flag
- post-card.html: context-conditional rendering (homepage vertical vs. other horizontal)
- card.css: new .article-card, .articles-grid, .article-* styles
- main.css: add section utilities, .reveal/.revealed base states
- variables.css: add --terminal-prompt, --terminal-text, --terminal-accent
- scroll-reveal.js: add 90ms per-item stagger with cleanup
- 404.css: remove hardcoded terminal color fallbacks
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Diffstat (limited to 'assets/js')
| -rw-r--r-- | assets/js/scroll-reveal.js | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/assets/js/scroll-reveal.js b/assets/js/scroll-reveal.js index ab099c0..026d1be 100644 --- a/assets/js/scroll-reveal.js +++ b/assets/js/scroll-reveal.js @@ -1,6 +1,7 @@ /** * scroll-reveal.js - * IntersectionObserver for revealing elements on scroll + * IntersectionObserver for revealing elements on scroll. + * Adds 90ms stagger delay per sibling index within each reveal-group. */ export function initScrollReveal() { @@ -11,16 +12,29 @@ export function initScrollReveal() { const observer = new IntersectionObserver((entries) => { entries.forEach((entry) => { - if (entry.isIntersecting) { - entry.target.classList.add('revealed'); - observer.unobserve(entry.target); - } + if (!entry.isIntersecting) return; + + const el = entry.target; + const parent = el.parentElement; + const siblings = parent + ? Array.from(parent.querySelectorAll(':scope > .reveal')) + : []; + const index = siblings.indexOf(el); + const delay = index >= 0 ? index * 90 : 0; + + el.style.transitionDelay = delay + 'ms'; + el.classList.add('revealed'); + + // Remove inline delay after transition so hover transitions are unaffected + const cleanup = () => { + el.style.transitionDelay = ''; + el.removeEventListener('transitionend', cleanup); + }; + el.addEventListener('transitionend', cleanup); + + observer.unobserve(el); }); - }, { - threshold: 0.1, - }); + }, { threshold: 0.1 }); - revealElements.forEach((el) => { - observer.observe(el); - }); + revealElements.forEach((el) => observer.observe(el)); } |
