From fa01644c17457afbf41ed6937688e35d1eb99192 Mon Sep 17 00:00:00 2001 From: TheFlow Date: Sun, 19 Oct 2025 15:09:59 +1300 Subject: [PATCH] feat(phase3): implement scroll animations with Intersection Observer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SUMMARY: Implemented Phase 3 Task 3.1: Scroll Animations system using Intersection Observer API for smooth, performant scroll-triggered animations on homepage. CHANGES: 1. Created scroll-animations.js (new): - Intersection Observer-based animation system - Supports 7 animation types (fade-in, slide-up/down/left/right, scale-in, rotate-in) - Staggered delays via data-stagger attribute - Respects prefers-reduced-motion - Auto-initializes, can be disabled globally - Custom 'scroll-animated' event for other components 2. Enhanced tractatus-theme.css: - Added 100+ lines of scroll animation CSS - Smooth transitions using CSS transforms (GPU-accelerated) - Data-attribute based animation selection - Default animation (slide-up) if none specified - Accessibility: respects prefers-reduced-motion 3. Updated index.html (homepage): - Added scroll-animations.js script - Value proposition: slide-up animation - Three audience cards: scale-in with 100/200/300ms stagger - Capabilities heading: fade-in - Six capability cards: slide-up with 100-600ms stagger - All animations trigger on scroll (not page load) ANIMATION TYPES: - fade-in: Opacity 0 → 1 - slide-up: Translates from bottom (+2rem) → 0 - slide-down: Translates from top (-2rem) → 0 - slide-left: Translates from right (+2rem) → 0 - slide-right: Translates from left (-2rem) → 0 - scale-in: Scales from 0.95 → 1 with opacity - rotate-in: Rotates from 12deg → 0 with scale USAGE EXAMPLE:
Content here
ACCESSIBILITY: ✓ Respects prefers-reduced-motion (disables all animations) ✓ GPU-accelerated transforms (60fps on modern devices) ✓ Progressive enhancement (graceful degradation) ✓ Zero CSP violations maintained PERFORMANCE: - Intersection Observer (better than scroll listeners) - Unobserves elements after animation (memory efficient) - Supports data-animate-repeat for repeatable animations - CSS transitions (GPU-accelerated) UI_TRANSFORMATION_PROJECT_PLAN.md: ✓ Phase 3 Task 3.1.1: Implemented Intersection Observer ✓ Phase 3 Task 3.1.2: Added scroll animations to homepage NEXT STEPS: - Phase 3 Task 3.1.3: Apply to all pages site-wide - Phase 3 Task 3.2: Interactive architecture diagram 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude --- public/css/tractatus-theme.css | 106 ++++++++++++++++++++++++++ public/index.html | 25 +++--- public/js/scroll-animations.js | 135 +++++++++++++++++++++++++++++++++ 3 files changed, 255 insertions(+), 11 deletions(-) create mode 100644 public/js/scroll-animations.js diff --git a/public/css/tractatus-theme.css b/public/css/tractatus-theme.css index 498eee47..56f37d69 100644 --- a/public/css/tractatus-theme.css +++ b/public/css/tractatus-theme.css @@ -823,6 +823,112 @@ h3 { letter-spacing: -0.015em; } text-decoration: underline; } +/* ======================================== + * SCROLL ANIMATIONS + * Intersection Observer-based scroll animations + * ======================================== */ + +/* Scroll animation initial states (before visible) */ +.animate-on-scroll { + transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), + transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); +} + +/* Fade in animation */ +.animate-on-scroll[data-animation="fade-in"] { + opacity: 0; +} + +.animate-on-scroll[data-animation="fade-in"].is-visible { + opacity: 1; +} + +/* Slide up animation */ +.animate-on-scroll[data-animation="slide-up"] { + opacity: 0; + transform: translateY(2rem); +} + +.animate-on-scroll[data-animation="slide-up"].is-visible { + opacity: 1; + transform: translateY(0); +} + +/* Slide down animation */ +.animate-on-scroll[data-animation="slide-down"] { + opacity: 0; + transform: translateY(-2rem); +} + +.animate-on-scroll[data-animation="slide-down"].is-visible { + opacity: 1; + transform: translateY(0); +} + +/* Slide left animation */ +.animate-on-scroll[data-animation="slide-left"] { + opacity: 0; + transform: translateX(2rem); +} + +.animate-on-scroll[data-animation="slide-left"].is-visible { + opacity: 1; + transform: translateX(0); +} + +/* Slide right animation */ +.animate-on-scroll[data-animation="slide-right"] { + opacity: 0; + transform: translateX(-2rem); +} + +.animate-on-scroll[data-animation="slide-right"].is-visible { + opacity: 1; + transform: translateX(0); +} + +/* Scale in animation */ +.animate-on-scroll[data-animation="scale-in"] { + opacity: 0; + transform: scale(0.95); +} + +.animate-on-scroll[data-animation="scale-in"].is-visible { + opacity: 1; + transform: scale(1); +} + +/* Rotate in animation */ +.animate-on-scroll[data-animation="rotate-in"] { + opacity: 0; + transform: rotate(12deg) scale(0.95); +} + +.animate-on-scroll[data-animation="rotate-in"].is-visible { + opacity: 1; + transform: rotate(0deg) scale(1); +} + +/* Default animation if no data-animation specified */ +.animate-on-scroll:not([data-animation]) { + opacity: 0; + transform: translateY(2rem); +} + +.animate-on-scroll:not([data-animation]).is-visible { + opacity: 1; + transform: translateY(0); +} + +/* Respect user's motion preferences for scroll animations */ +@media (prefers-reduced-motion: reduce) { + .animate-on-scroll { + opacity: 1 !important; + transform: none !important; + transition: none !important; + } +} + /* ======================================== * DARK MODE SUPPORT (Future) * Placeholder for dark mode implementation diff --git a/public/index.html b/public/index.html index d25632c3..3eb50b9b 100644 --- a/public/index.html +++ b/public/index.html @@ -86,7 +86,7 @@
-
+

A Starting Point

Instead of hoping AI systems "behave correctly," we propose structural constraints @@ -106,7 +106,7 @@ We recognize this is one small step in addressing AI safety challenges. Explore

- +
For AI safety researchers, academics, and scientists investigating LLM failure modes and governance architectures @@ -154,7 +154,7 @@ Explore the theoretical foundations, architectural constraints, and scholarly co - +
For software engineers, ML engineers, and technical teams building production AI systems @@ -202,7 +202,7 @@ Get hands-on with implementation guides, API documentation, and reference code e - +
For AI executives, research directors, startup founders, and strategic decision makers setting AI safety policy @@ -257,11 +257,11 @@ Navigate the business case, compliance requirements, and competitive advantages
-

Framework Capabilities

+

Framework Capabilities

-
+
-
+
-
+
-
+
-
+
-
+