From 0ec7765a3d1056483b45f1d9750ca2b6e4eea226 Mon Sep 17 00:00:00 2001 From: vshnosngh Date: Tue, 3 Nov 2026 13:36:36 +0530 Subject: [PATCH] feat(ui): add Three.js 3D neural prism, 3D tilt cards, cursor aura, and flagship banners --- content/pages/home.json | 50 +--- content/pages/tools.json | 10 - ...6-11-03-3d-motion-graphics-neural-prism.md | 68 +++++ ...11-03-major-tool-banners-and-animations.md | 82 ++++++ package-lock.json | 58 +++++ package.json | 2 + src/app/globals.css | 28 ++ src/app/layout.tsx | 4 +- src/components/3d/Hero3DCanvas.tsx | 244 ++++++++++++++++++ src/components/sections/HeroSection.tsx | 78 +++++- .../sections/MajorToolBannersSection.tsx | 216 ++++++++++++++++ src/components/sections/SectionRenderer.tsx | 4 + .../sections/VerticalToolStackSection.tsx | 156 +++++------ src/components/ui/BeforeAfterSlider.tsx | 69 ++++- src/components/ui/CursorAura.tsx | 65 +++++ src/components/ui/TiltCard.tsx | 105 ++++++++ 16 files changed, 1087 insertions(+), 152 deletions(-) create mode 100644 docs/superpowers/plans/2026-11-03-3d-motion-graphics-neural-prism.md create mode 100644 docs/superpowers/plans/2026-11-03-major-tool-banners-and-animations.md create mode 100644 src/components/3d/Hero3DCanvas.tsx create mode 100644 src/components/sections/MajorToolBannersSection.tsx create mode 100644 src/components/ui/CursorAura.tsx create mode 100644 src/components/ui/TiltCard.tsx diff --git a/content/pages/home.json b/content/pages/home.json index 01c9d77..c29ee0a 100644 --- a/content/pages/home.json +++ b/content/pages/home.json @@ -48,8 +48,8 @@ } }, { - "id": "use-cases", - "type": "visualUseCases", + "id": "flagship-banners", + "type": "majorToolBanners", "props": {} }, { @@ -62,57 +62,11 @@ } } }, - { - "id": "featured-tools", - "type": "toolGrid", - "props": { - "title": { - "en": "Explore Full Suite of AI Photo Tools", - "hi": "एआई फोटो टूल्स के पूरे सूट का अन्वेषण करें" - }, - "subtitle": { - "en": "Select any tool below to launch an instant trial in your browser with zero watermark restrictions.", - "hi": "बिना वॉटरमार्क के तुरंत आज़माने के लिए नीचे से कोई भी टूल चुनें।" - }, - "source": "all", - "showCategoryFilter": true, - "showSearch": true, - "columns": 4 - } - }, { "id": "workflow-pipeline", "type": "workflowVisualizer", "props": {} }, - { - "id": "showcase-before-after", - "type": "beforeAfter", - "props": { - "title": { - "en": "Precision Side-by-Side Comparisons", - "hi": "सटीक पहले और बाद की तुलना" - }, - "subtitle": { - "en": "Drag the split slider to verify sub-millimeter pore textures and clean edge alpha matting.", - "hi": "सटीक बनावट और स्पष्ट किनारों की जांच के लिए स्लाइडर को खींचें।" - }, - "items": [ - { - "before": "https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=800&auto=format&fit=crop&q=80", - "after": "https://images.unsplash.com/photo-1517841905240-472988babdf9?w=800&auto=format&fit=crop&q=80", - "alt": "Portrait Blemish Removal", - "caption": "Sub-pore facial blemish removal preserving real skin pore texture" - }, - { - "before": "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=800&auto=format&fit=crop&q=80", - "after": "https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=800&auto=format&fit=crop&q=80", - "alt": "P3M AI Matting", - "caption": "Precision alpha matting with individual hair strand detection" - } - ] - } - }, { "id": "apps-section", "type": "appCards", diff --git a/content/pages/tools.json b/content/pages/tools.json index 9730a99..45686b5 100644 --- a/content/pages/tools.json +++ b/content/pages/tools.json @@ -23,16 +23,6 @@ } } }, - { - "id": "tools-vertical-stack", - "type": "verticalToolStack", - "props": { - "title": { - "en": "The Creative Studio Suite", - "hi": "क्रिएटिव स्टूडियो सूट" - } - } - }, { "id": "all-tools-grid", "type": "toolGrid", diff --git a/docs/superpowers/plans/2026-11-03-3d-motion-graphics-neural-prism.md b/docs/superpowers/plans/2026-11-03-3d-motion-graphics-neural-prism.md new file mode 100644 index 0000000..3ec5870 --- /dev/null +++ b/docs/superpowers/plans/2026-11-03-3d-motion-graphics-neural-prism.md @@ -0,0 +1,68 @@ +# 3D Motion Graphics & Neural Prism Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Elevate the CRE Innovations front page with interactive Three.js 3D motion graphics, perspective card tilt, specular reflections, and kinetic telemetry inspired by Squared Media (squared-media.nl), while ensuring zero SEO degradation and ultra-fast 60fps performance. + +**Architecture:** +- A lightweight, lazy-loaded Three.js WebGL canvas (`Hero3DCanvas`) rendering a 3D neural crystal prism and particle constellation with inertial mouse tracking, paused via `IntersectionObserver` when offscreen. +- A high-performance 3D perspective tilt component (`TiltCard`) with dynamic specular glare overlay. +- An ambient desktop cursor aura follower (`CursorAura`) delivering agency-grade polish. +- Full preservation of semantic HTML, Schema.org JSON-LD, and zero impact on Core Web Vitals or mobile responsiveness. + +**Tech Stack:** Next.js 14 (App Router), React 18, Three.js (`three` + `@types/three`), Tailwind CSS, Lucide React. + +--- + +## Global Constraints +- Brand name: strictly **CRE Innovations**. +- Palette: Light creamy off-white (`#FAF8F5` / `#F5F2EB`) with slate-900 typography and electric neural blue/indigo accents. +- Zero SEO degradation: All H1/H2/H3/p tags, Schema.org structured data, and meta tags must remain intact; 3D canvas is `aria-hidden="true"` and non-blocking. +- Ultra-fast & lightweight: Canvas uses DPR clamp <= 2, pauses RAF when out of viewport, and disposes WebGL resources on unmount. +- Python commands: Use `/home/creserver/extras/local_venv/bin/python` per user global rule. + +--- + +## Task Decomposition + +### Task 1: Create `Hero3DCanvas.tsx` +- File: `src/components/3d/Hero3DCanvas.tsx` +- Build Three.js 3D neural crystal (icosahedron wireframe + inner glowing sphere + 60 floating neural particles). +- Implement smooth lerp mouse tracking `(targetX, targetY)`. +- Implement `IntersectionObserver` to halt RAF loop when canvas is not visible. +- Add full WebGL resource disposal on unmount. + +### Task 2: Create `TiltCard.tsx` and `CursorAura.tsx` +- File: `src/components/ui/TiltCard.tsx` + - Mouse move perspective tilt (`perspective(1000px) rotateX(...) rotateY(...) scale3d(1.01, 1.01, 1.01)`). + - Dynamic radial specular highlight layer. + - Smooth spring reset on mouse leave. + - Respects `prefers-reduced-motion` and touch devices. +- File: `src/components/ui/CursorAura.tsx` + - Desktop-only ambient radial glow follower (`@media(hover:hover)`). + - RAF lerp smoothing. + +### Task 3: Integrate 3D Motion Graphics into `HeroSection.tsx` +- File: `src/components/sections/HeroSection.tsx` +- Dynamically import `Hero3DCanvas` with `{ ssr: false }`. +- Position the 3D canvas behind/beside the hero headline with subtle atmospheric glow. +- Add kinetic floating telemetry chips (`⚡ CRE Neural Core v2.4`, `In-Memory ~340ms`, `Zero Disk Storage Active`) with staggered orbital float. +- Wrap TryItWidget in `TiltCard`. + +### Task 4: Enhance Flagship Banners and Studio Suite with 3D Tilt +- Files: + - `src/components/sections/MajorToolBannersSection.tsx` + - `src/components/sections/VerticalToolStackSection.tsx` +- Wrap flagship cards and studio suite cards in `TiltCard` with subtle specular gleam. + +### Task 5: Global Layout Integration & Styling +- File: `src/app/layout.tsx` +- Mount `CursorAura` at body level. +- Add CSS animations for floating telemetry badges in `src/app/globals.css`. + +### Task 6: Production Build, Server Restart & Automated Verification +- Run `npm run build` to verify clean compilation without TypeScript or SSR errors. +- Restart production server daemon task (`npm run start`). +- Run Python audit script to verify all 9 routes return 200 OK, 1 H1, 0 missing alt tags. +- Test in Puppeteer: evaluate WebGL canvas rendering, 60fps loop, and card tilt. +- Commit all changes with descriptive commit message. diff --git a/docs/superpowers/plans/2026-11-03-major-tool-banners-and-animations.md b/docs/superpowers/plans/2026-11-03-major-tool-banners-and-animations.md new file mode 100644 index 0000000..237acc1 --- /dev/null +++ b/docs/superpowers/plans/2026-11-03-major-tool-banners-and-animations.md @@ -0,0 +1,82 @@ +# Major Tool Banners & Animated Comparisons Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Eliminate redundant content across pages, implement smooth auto-sliding before/after comparison animations, and create a flagship Major Tool Banners section showcasing flagship AI models in alternating editorial layouts. + +**Architecture:** Next.js 14 App Router, dynamic JSON configs, Canvas/RAF-driven smooth slider oscillation in `BeforeAfterSlider.tsx`, new `MajorToolBannersSection.tsx` registered in `SectionRenderer.tsx`. + +**Tech Stack:** Next.js 14, React 18, TypeScript, Tailwind CSS, Lucide React. + +--- + +## Global Constraints +- Brand name: strictly **CRE Innovations**. +- Color palette: maintain warm, light creamy off-white studio aesthetic (`#FAF8F5` / `#F5F2EB`). +- Non-redundancy: eliminate duplicate tool grids and duplicate comparison sliders across pages. +- Auto-sliding animation: smooth sine-wave oscillation that pauses instantly on user touch/mouse interaction. + +--- + +### Task 1: Auto-Sliding Before/After Animation in `BeforeAfterSlider.tsx` + +**Files:** +- Modify: `src/components/ui/BeforeAfterSlider.tsx` + +- [ ] **Step 1: Implement RAF-based Auto-Slide Oscillation** + - Add `autoSlide?: boolean` (defaults to `true`). + - Use `requestAnimationFrame` with a smooth sine function (`50 + 28 * Math.sin(timestamp * 0.0015)`) to oscillate between ~22% and ~78%. + - On mouse enter / touch start: pause animation immediately and allow manual dragging. + - On mouse leave: resume after a short grace period. + - Add mode indicator pill ("Auto-Scanning" / "Manual Inspect"). + +- [ ] **Step 2: Verify component in build** + - Run `npm run build` to confirm no compilation issues. + +--- + +### Task 2: Create Flagship `MajorToolBannersSection.tsx` + +**Files:** +- Create: `src/components/sections/MajorToolBannersSection.tsx` +- Modify: `src/components/sections/SectionRenderer.tsx` + +- [ ] **Step 1: Build `MajorToolBannersSection.tsx`** + - Spotlight 3 flagship tools: + 1. *P3M-Net Ultra Cutout Studio* (Hair-strand isolation & alpha PNG) + 2. *RetouchGAN v2.1 Skin Precision* (Pore-preserving acne & blemish removal) + 3. *GFPGAN + RealESRGAN 4K Enhancer* (Super-resolution & vintage deblurring) + - Alternating layout (Left-Right, Right-Left, Left-Right) for rhythm and aesthetic symmetry. + - Large-format auto-sliding before/after animation frames. + - 1-click "Launch Tool Online" and "Get Mobile App" CTAs. + +- [ ] **Step 2: Register in `SectionRenderer.tsx`** + - Add `case 'majorToolBanners': return `. + +--- + +### Task 3: De-duplicate Page Content across JSON Configs + +**Files:** +- Modify: `content/pages/home.json` +- Modify: `content/pages/tools.json` + +- [ ] **Step 1: Clean Up `home.json`** + - Add `majorToolBanners` section after `stats-section`. + - Remove duplicate `featured-tools` (`toolGrid`) from homepage (now uniquely represented by The Creative Suite and Flagship Banners). + - Remove duplicate `showcase-before-after` (redundant with the animated banners). + +- [ ] **Step 2: Clean Up `tools.json`** + - Remove `tools-vertical-stack` from `tools.json` so `/tools` is purely the dedicated search and filter directory (`toolGrid`), giving each page a distinct role. + +--- + +### Task 4: Comprehensive Verification & Audit + +**Files:** +- Audit homepage and all subpages +- Verify clean build, zero TypeScript errors, valid SEO & schemas + +- [ ] **Step 1: Run `npm run build`** +- [ ] **Step 2: Restart Server & Test Routes** +- [ ] **Step 3: Commit and Final Status** diff --git a/package-lock.json b/package-lock.json index 0e005b6..744203a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "photo-tools-web", "version": "1.0.0", "dependencies": { + "@types/three": "^0.187.0", "clsx": "^2.1.1", "lucide-react": "^0.468.0", "next": "^14.2.15", @@ -15,6 +16,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "tailwind-merge": "^2.5.4", + "three": "^0.187.0", "zod": "^3.23.8" }, "devDependencies": { @@ -42,6 +44,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@dimforge/rapier3d-compat": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@dimforge/rapier3d-compat/-/rapier3d-compat-0.12.0.tgz", + "integrity": "sha512-uekIGetywIgopfD97oDL5PfeezkFpNhwlzlaEYNOA0N6ghdsOvh/HYjSMek5Q2O1PYvRSDFcqFVJl4r4ZBwOow==", + "license": "Apache-2.0" + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", @@ -1111,6 +1119,12 @@ "tslib": "^2.4.0" } }, + "node_modules/@tweenjs/tween.js": { + "version": "23.1.3", + "resolved": "https://registry.npmjs.org/@tweenjs/tween.js/-/tween.js-23.1.3.tgz", + "integrity": "sha512-vJmvvwFxYuGnF2axRtPYocag6Clbb5YS7kLL+SO/TeVFzHqDIWrNKYtcsPMibjDx9O+bu+psAy9NKfWklassUA==", + "license": "MIT" + }, "node_modules/@types/estree": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.10.tgz", @@ -1166,6 +1180,32 @@ "@types/react": "^18.0.0" } }, + "node_modules/@types/stats.js": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.4.tgz", + "integrity": "sha512-jIBvWWShCvlBqBNIZt0KAshWpvSjhkwkEu4ZUcASoAvhmrgAUI2t1dXrjSL4xXVLB4FznPrIsX3nKXFl/Dt4vA==", + "license": "MIT" + }, + "node_modules/@types/three": { + "version": "0.187.0", + "resolved": "https://registry.npmjs.org/@types/three/-/three-0.187.0.tgz", + "integrity": "sha512-v+vKNarUtk4n2QRZ4+CN5ygMM0ARUjXjIQl0R/unMUfmStFeVqGbgqarbrpoGTXRZoulSH16ePrVJVxPJEbMUA==", + "license": "MIT", + "dependencies": { + "@dimforge/rapier3d-compat": "~0.12.0", + "@tweenjs/tween.js": "~23.1.3", + "@types/stats.js": "*", + "@types/webxr": ">=0.5.17", + "fflate": "~0.8.3", + "meshoptimizer": "~1.1.1" + } + }, + "node_modules/@types/webxr": { + "version": "0.5.24", + "resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.24.tgz", + "integrity": "sha512-h8fgEd/DpoS9CBrjEQXR+dIDraopAEfu4wYVNY2tEPwk60stPWhvZMf4Foo5FakuQ7HFZoa8WceaWFervK2Ovg==", + "license": "MIT" + }, "node_modules/@vitest/expect": { "version": "2.1.9", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.9.tgz", @@ -1846,6 +1886,12 @@ "reusify": "^1.0.4" } }, + "node_modules/fflate": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.3.tgz", + "integrity": "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==", + "license": "MIT" + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -2119,6 +2165,12 @@ "node": ">= 8" } }, + "node_modules/meshoptimizer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-1.1.1.tgz", + "integrity": "sha512-oRFNWJRDA/WTrVj7NWvqa5HqE1t9MYDj2VaWirQCzCCrAd2GHrqR/sQezCxiWATPNlKTcRaPRHPJwIRoPBAp5g==", + "license": "MIT" + }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -2969,6 +3021,12 @@ "node": ">=0.8" } }, + "node_modules/three": { + "version": "0.187.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.187.0.tgz", + "integrity": "sha512-Qiu7R+Cmh8CstZsY1uJOSWnVlfo7ZtNLV7mF8Jltk3LB3AtDu9cRZlcnRKkAk8Y4z6KKw35z7Y7Urd7jWY8etA==", + "license": "MIT" + }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", diff --git a/package.json b/package.json index 9b11eb7..3d31907 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "test": "vitest run" }, "dependencies": { + "@types/three": "^0.187.0", "clsx": "^2.1.1", "lucide-react": "^0.468.0", "next": "^14.2.15", @@ -16,6 +17,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "tailwind-merge": "^2.5.4", + "three": "^0.187.0", "zod": "^3.23.8" }, "devDependencies": { diff --git a/src/app/globals.css b/src/app/globals.css index 8162073..c8a2ef9 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -102,3 +102,31 @@ ::-webkit-scrollbar-thumb:hover { background: #C8C2B5; } + +/* 3D Motion Keyframes & Floating Helpers */ +@keyframes float-slow { + 0%, 100% { + transform: translateY(0px) rotate(0deg); + } + 50% { + transform: translateY(-8px) rotate(1.2deg); + } +} + +@keyframes float-medium { + 0%, 100% { + transform: translateY(0px) rotate(0deg); + } + 50% { + transform: translateY(-12px) rotate(-1.5deg); + } +} + +.animate-float-slow { + animation: float-slow 6s ease-in-out infinite; +} + +.animate-float-medium { + animation: float-medium 7.5s ease-in-out infinite; +} + diff --git a/src/app/layout.tsx b/src/app/layout.tsx index b180d7d..3e86042 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -4,6 +4,7 @@ import './globals.css'; import { getSiteConfig } from '@/lib/config/loader'; import { Navbar } from '@/components/ui/Navbar'; import { Footer } from '@/components/ui/Footer'; +import { CursorAura } from '@/components/ui/CursorAura'; const sansFont = Plus_Jakarta_Sans({ subsets: ['latin'], @@ -87,7 +88,8 @@ export default function RootLayout({ dangerouslySetInnerHTML={{ __html: JSON.stringify(organizationJsonLd) }} /> - + +
{children}