From b4e003ddfee68a0ba85f751799cadc5274b88e94 Mon Sep 17 00:00:00 2001 From: Chan Meng Date: Fri, 10 Jul 2026 15:18:38 +1200 Subject: [PATCH 1/2] =?UTF-8?q?feat(ui):=20full-site=20redesign=20?= =?UTF-8?q?=E2=80=94=20"Ink=20Room=20=C3=97=20Living=20Color"=20design=20s?= =?UTF-8?q?ystem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the stock shadcn theme with a disciplined monochrome dark system where the only color on every page is the product's own live gradient SVGs: - Design tokens: near-black ink canvas, hairline borders, no shadows, warm-white .light-section band flips; fonts self-hosted Aspekta 400 (single-weight display) + JetBrains Mono for all labels/nav/buttons - Tailwind v4: move font + color theme vars to @theme inline so next/font DOM-scoped variables and .light-section re-declarations resolve at point of use - Hero signature: real DOM headline filled by the live API via background-clip:text over /api/svg?text=%20 banners, preload-gated template rotation, zero CLS (verified 0.00), reduced-motion pinned - Pages rebuilt: landing (live endpoint proof, specimen grids, popular table, category index), gallery (editorial header, mono pills, reskinned virtualized cards), self-demonstrating API docs (every example renders its real response), instrument-panel editor reskin, new shared black Footer, new 404 poster page, MobileNav cleanup - All copy rewritten; SVG engine untouched (72 contract snapshots byte-identical); 109/109 tests green; production build green Co-Authored-By: Claude Fable 5 --- public/manifest.json | 10 +- public/sw.js | 4 +- src/components/common/SectionHeading.tsx | 46 ++ .../features/SwipeableTemplateCarousel.tsx | 6 +- src/components/features/TemplateCard.tsx | 58 +- .../features/TemplatePreviewModal.tsx | 49 +- .../MobilePropertiesPanel.tsx | 6 +- .../features/properties-panel/PanelTabs.tsx | 29 +- .../properties-panel/PropertiesPanel.tsx | 4 +- src/components/home/GradientInkText.tsx | 52 ++ src/components/home/HeroHeadline.tsx | 116 +++ src/components/home/LiveEndpointCard.tsx | 73 ++ src/components/layout/Footer.tsx | 94 +++ src/components/layout/Header.tsx | 81 +-- src/components/layout/MobileNav.tsx | 21 +- .../layout/Sidebar/SidebarFilters.tsx | 4 +- .../layout/Sidebar/SidebarSearch.tsx | 4 +- src/components/layout/Sidebar/index.tsx | 40 +- src/components/ui/badge.tsx | 11 +- src/components/ui/button.tsx | 20 +- src/components/ui/card.tsx | 4 +- src/components/ui/color-picker.tsx | 4 +- src/components/ui/dialog.tsx | 6 +- src/components/ui/input.tsx | 2 +- src/components/ui/sheet.tsx | 12 +- src/components/ui/tabs.tsx | 6 +- src/features/home/homeData.ts | 14 + src/fonts/Aspekta-400.woff2 | Bin 0 -> 21748 bytes src/fonts/JetBrainsMono-Regular.woff2 | Bin 0 -> 92380 bytes src/fonts/LICENSE-Aspekta.txt | 94 +++ src/fonts/LICENSE-JetBrainsMono.txt | 93 +++ src/pages/404.tsx | 44 ++ src/pages/_app.tsx | 26 +- src/pages/_document.tsx | 2 +- src/pages/api-docs.tsx | 669 ++++++++---------- src/pages/create.tsx | 61 +- src/pages/index.tsx | 669 ++++++++---------- src/pages/templates.tsx | 269 +++---- src/styles/create.module.css | 25 +- src/styles/globals.css | 110 +-- 40 files changed, 1652 insertions(+), 1186 deletions(-) create mode 100644 src/components/common/SectionHeading.tsx create mode 100644 src/components/home/GradientInkText.tsx create mode 100644 src/components/home/HeroHeadline.tsx create mode 100644 src/components/home/LiveEndpointCard.tsx create mode 100644 src/components/layout/Footer.tsx create mode 100644 src/fonts/Aspekta-400.woff2 create mode 100644 src/fonts/JetBrainsMono-Regular.woff2 create mode 100644 src/fonts/LICENSE-Aspekta.txt create mode 100644 src/fonts/LICENSE-JetBrainsMono.txt create mode 100644 src/pages/404.tsx diff --git a/public/manifest.json b/public/manifest.json index 19a4367..85e2664 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -2,8 +2,8 @@ "name": "Chromaflow", "short_name": "Chromaflow", "description": "Create beautiful animated SVG gradients with 326+ templates", - "theme_color": "#000000", - "background_color": "#ffffff", + "theme_color": "#0f1012", + "background_color": "#0f1012", "display": "standalone", "orientation": "portrait", "scope": "/", @@ -16,7 +16,7 @@ "purpose": "maskable" }, { - "src": "/icon-512.png", + "src": "/icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any" @@ -31,7 +31,7 @@ }, { "src": "/screenshot-2.png", - "sizes": "412x915", + "sizes": "412x915", "type": "image/png" } ], @@ -51,4 +51,4 @@ "icons": [{ "src": "/icon-96.png", "sizes": "96x96" }] } ] -} \ No newline at end of file +} diff --git a/public/sw.js b/public/sw.js index da0f4e1..16edc8a 100644 --- a/public/sw.js +++ b/public/sw.js @@ -1,6 +1,6 @@ // Service Worker for PWA functionality -// v3: Fixed cache.addAll failure due to missing favicon.ico -const CACHE_NAME = 'gradient-svg-v3'; +// v4: Ink Room redesign — bump cache to invalidate stale pre-redesign shell +const CACHE_NAME = 'gradient-svg-v4'; const urlsToCache = [ '/', '/create', diff --git a/src/components/common/SectionHeading.tsx b/src/components/common/SectionHeading.tsx new file mode 100644 index 0000000..4dcc73a --- /dev/null +++ b/src/components/common/SectionHeading.tsx @@ -0,0 +1,46 @@ +import * as React from 'react'; +import { cn } from '../../lib/utils'; + +export interface SectionHeadingProps { + /** Mono uppercase overline label above the title. */ + overline?: string; + /** Optional index counter shown before the overline (e.g. "01"). */ + counter?: string; + /** The display heading. Size comes from className. */ + title: React.ReactNode; + /** Optional right-aligned action slot (e.g. a "View all" link/button). */ + action?: React.ReactNode; + className?: string; +} + +/** + * Shared editorial section header: mono uppercase overline (optionally with a + * counter prefix) over a single-weight display heading, with an optional + * right-aligned action. Reused across WP1/2/3 sections. + */ +export function SectionHeading({ + overline, + counter, + title, + action, + className, +}: SectionHeadingProps) { + return ( +
+
+ {overline && ( + + {counter && {counter}} + {overline} + + )} +

{title}

+
+ {action &&
{action}
} +
+ ); +} + +export default SectionHeading; diff --git a/src/components/features/SwipeableTemplateCarousel.tsx b/src/components/features/SwipeableTemplateCarousel.tsx index 5f644d0..cedabdc 100644 --- a/src/components/features/SwipeableTemplateCarousel.tsx +++ b/src/components/features/SwipeableTemplateCarousel.tsx @@ -117,7 +117,7 @@ export default function SwipeableTemplateCarousel({
-

+

{currentTemplate.displayName}

diff --git a/src/components/features/TemplateCard.tsx b/src/components/features/TemplateCard.tsx index cd31197..9d14812 100644 --- a/src/components/features/TemplateCard.tsx +++ b/src/components/features/TemplateCard.tsx @@ -1,6 +1,6 @@ import { memo, type MouseEvent } from 'react'; import Link from 'next/link'; -import { Star, Eye, ArrowRight } from 'lucide-react'; +import { Star } from 'lucide-react'; import { cn } from '../../lib/utils'; export interface TemplateCardData { @@ -57,9 +57,9 @@ function TemplateCardImpl({ } }} className={cn( - 'group relative flex flex-col overflow-hidden rounded-xl border bg-card text-left', - 'transition-all duration-300 ease-out cursor-pointer', - 'hover:-translate-y-0.5 hover:border-primary/50 hover:shadow-xl', + 'group relative flex flex-col overflow-hidden rounded-2xl border border-border bg-card text-left', + 'transition-colors duration-200 cursor-pointer', + 'hover:border-foreground/40', 'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2', )} > @@ -80,29 +80,39 @@ function TemplateCardImpl({ onClick={handleFavorite} className={cn( 'absolute top-2 right-2 inline-flex h-7 w-7 items-center justify-center rounded-full', - 'bg-black/35 text-white backdrop-blur-md transition-all', - 'hover:bg-black/55 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring', - isFavorite && 'bg-yellow-500/90 text-white hover:bg-yellow-500', + 'bg-black/50 transition-colors', + 'hover:bg-black/70 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring', )} > - +
-
-
- {template.categoryIcon ? {template.categoryIcon} : null} - {template.category} + {/* Info strip — height must stay visually constant so the virtualizer's + GRID_CARD_INFO_HEIGHT estimate holds. Fixed leading enforces that. */} +
+
+ {template.category} +
+
+ + {template.displayName} + + + → +
-

- {template.displayName} -

- Preview e.stopPropagation()} className={cn( - 'inline-flex items-center gap-1.5 rounded-md bg-primary px-3 h-9', - 'text-sm font-medium text-primary-foreground transition-colors', - 'hover:bg-primary/90 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-white', + 'inline-flex items-center gap-1.5 rounded-full bg-white px-4 h-9', + 'font-mono text-[12px] uppercase tracking-[0.08em] text-black transition-colors', + 'hover:bg-white/90 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-white', )} > - Use Template - + Use →
diff --git a/src/components/features/TemplatePreviewModal.tsx b/src/components/features/TemplatePreviewModal.tsx index bf51347..2b1157d 100644 --- a/src/components/features/TemplatePreviewModal.tsx +++ b/src/components/features/TemplatePreviewModal.tsx @@ -76,10 +76,12 @@ export default function TemplatePreviewModal({
- {template.displayName} - - {template.category} - {template.description} + + {template.displayName} + + + {template.category} + {template.description}
@@ -102,14 +105,14 @@ export default function TemplatePreviewModal({ -
+
{template.displayName}
-

- Animation: {template.animationDuration} • Type: {template.gradientType} • Colors:{' '} +

+ Animation {template.animationDuration} · Type {template.gradientType} · Colors{' '} {template.colors?.length || 0}

@@ -117,7 +120,9 @@ export default function TemplatePreviewModal({
- + setPreviewText(e.target.value)} @@ -125,26 +130,30 @@ export default function TemplatePreviewModal({ />
- + setPreviewHeight(parseInt(e.target.value))} - className="w-full" + className="w-full accent-foreground" />
-
+
Custom preview
- +
-
+                  
                     {`![${previewText}](${apiUrl})`}
                   
- +
-
+                  
                     {`${previewText}`}
                   
- +
-
+                  
                     {apiUrl}
                   
+
+ +
+ + Response — rendered live + + Live API response +
+
+ ); +} + +export default LiveEndpointCard; diff --git a/src/components/layout/Footer.tsx b/src/components/layout/Footer.tsx new file mode 100644 index 0000000..54243e6 --- /dev/null +++ b/src/components/layout/Footer.tsx @@ -0,0 +1,94 @@ +import Link from 'next/link'; + +const REPO_URL = 'https://github.com/ChanMeng666/gradient-svg-generator'; +const LICENSE_URL = `${REPO_URL}/blob/main/LICENSE`; + +interface FooterLink { + label: string; + href: string; + external?: boolean; +} + +const COLUMNS: readonly { heading: string; links: readonly FooterLink[] }[] = [ + { + heading: 'Product', + links: [ + { label: 'Create', href: '/create' }, + { label: 'Templates', href: '/templates' }, + { label: 'API Docs', href: '/api-docs' }, + ], + }, + { + heading: 'Resources', + links: [ + { label: 'GitHub Repository', href: REPO_URL, external: true }, + { label: 'MIT License', href: LICENSE_URL, external: true }, + ], + }, + { + heading: 'Author', + links: [ + { label: 'Chan Meng', href: 'https://github.com/ChanMeng666', external: true }, + { label: 'chanmeng.dev@gmail.com', href: 'mailto:chanmeng.dev@gmail.com', external: true }, + ], + }, +]; + +export default function Footer() { + return ( +
+ {/* The only color on the page: a live gradient strip */} + + +
+ + Chromaflow + + +
+ {COLUMNS.map((column) => ( +
+ + {column.heading} + +
    + {column.links.map((link) => ( +
  • + {link.external ? ( + + {link.label} + + ) : ( + + {link.label} + + )} +
  • + ))} +
+
+ ))} +
+ +
+ + © 2026 Chromaflow — MIT License + +
+
+
+ ); +} diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx index 0a10071..eb62103 100644 --- a/src/components/layout/Header.tsx +++ b/src/components/layout/Header.tsx @@ -1,7 +1,7 @@ import Link from 'next/link'; import { useRouter } from 'next/router'; import { Button } from '../ui/button'; -import { Code2, Palette, Menu } from 'lucide-react'; +import { Menu } from 'lucide-react'; import { cn } from '../../lib/utils'; interface HeaderProps { @@ -9,13 +9,19 @@ interface HeaderProps { showMobileMenu?: boolean; } +const NAV_ITEMS: readonly { href: string; label: string }[] = [ + { href: '/', label: 'Index' }, + { href: '/create', label: 'Create' }, + { href: '/templates', label: 'Templates' }, + { href: '/api-docs', label: 'API' }, +]; + export default function Header({ onMenuClick, showMobileMenu = true }: HeaderProps) { const router = useRouter(); const isCreatePage = router.pathname === '/create'; - const isHomePage = router.pathname === '/'; return ( -
+
{/* Mobile menu button */} {showMobileMenu && onMenuClick && ( @@ -25,53 +31,34 @@ export default function Header({ onMenuClick, showMobileMenu = true }: HeaderPro )} {/* Logo */} - - Chromaflow - Chromaflow + + Chromaflow + + Chromaflow + {/* Navigation */} -