From 70fab005093cd92bfbde1bfa3380c3dc873bdfcf Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 10 Apr 2026 12:01:49 +0200 Subject: feat: align homepage to mockup-a with centered hero, terminal animation, article grid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- assets/js/scroll-reveal.js | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'assets/js') 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)); } -- cgit v1.2.3