From 7806bcbede669ca6d6a9056edafc4cadd06628f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Mon, 23 Feb 2026 08:18:44 +0100 Subject: [PATCH] refactor: flatten Pastel routes by removing intermediate palettes and accessibility paths - Move sub-routes from /pastel/palettes/* and /pastel/accessibility/* to direct children of /pastel - Update AppSidebar navigation links - Update Pastel Navbar and Footer links - Update Tailwind source directives in pastel/globals.css - Remove intermediate page files --- app/(app)/pastel/accessibility/page.tsx | 96 ------------------- .../{accessibility => }/colorblind/page.tsx | 0 .../{accessibility => }/contrast/page.tsx | 0 .../pastel/{palettes => }/distinct/page.tsx | 0 app/(app)/pastel/globals.css | 14 ++- .../pastel/{palettes => }/gradient/page.tsx | 0 .../pastel/{palettes => }/harmony/page.tsx | 0 app/(app)/pastel/palettes/page.tsx | 68 ------------- .../{accessibility => }/textcolor/page.tsx | 0 components/layout/AppSidebar.tsx | 12 +-- components/pastel/layout/Footer.tsx | 6 +- components/pastel/layout/Navbar.tsx | 9 +- 12 files changed, 19 insertions(+), 186 deletions(-) delete mode 100644 app/(app)/pastel/accessibility/page.tsx rename app/(app)/pastel/{accessibility => }/colorblind/page.tsx (100%) rename app/(app)/pastel/{accessibility => }/contrast/page.tsx (100%) rename app/(app)/pastel/{palettes => }/distinct/page.tsx (100%) rename app/(app)/pastel/{palettes => }/gradient/page.tsx (100%) rename app/(app)/pastel/{palettes => }/harmony/page.tsx (100%) delete mode 100644 app/(app)/pastel/palettes/page.tsx rename app/(app)/pastel/{accessibility => }/textcolor/page.tsx (100%) diff --git a/app/(app)/pastel/accessibility/page.tsx b/app/(app)/pastel/accessibility/page.tsx deleted file mode 100644 index ec8c370..0000000 --- a/app/(app)/pastel/accessibility/page.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import Link from 'next/link'; -import { Contrast, Eye, Palette } from 'lucide-react'; - -export default function AccessibilityPage() { - const tools = [ - { - title: 'Contrast Checker', - description: 'Test color combinations for WCAG 2.1 AA and AAA compliance', - href: '/pastel/accessibility/contrast', - icon: Contrast, - features: ['WCAG 2.1 standards', 'AA/AAA ratings', 'Live preview'], - }, - { - title: 'Color Blindness Simulator', - description: 'Simulate how colors appear with different types of color blindness', - href: '/pastel/accessibility/colorblind', - icon: Eye, - features: ['Protanopia', 'Deuteranopia', 'Tritanopia'], - }, - { - title: 'Text Color Optimizer', - description: 'Find the best text color for any background automatically', - href: '/pastel/accessibility/textcolor', - icon: Palette, - features: ['Automatic optimization', 'WCAG guaranteed', 'Light/dark options'], - }, - ]; - - return ( -
-
-
-

Accessibility Tools

-

- Ensure your colors are accessible to everyone -

-
- -
- {tools.map((tool) => { - const Icon = tool.icon; - return ( - -
- -
-

{tool.title}

-

{tool.description}

-
    - {tool.features.map((feature) => ( -
  • - - {feature} -
  • - ))} -
- - ); - })} -
- - {/* Educational Content */} -
-

About WCAG 2.1

-
-

- The Web Content Accessibility Guidelines (WCAG) 2.1 provide standards for making web - content more accessible to people with disabilities -

-
-
-

Level AA (Minimum)

-
    -
  • • Normal text: 4.5:1 contrast ratio
  • -
  • • Large text: 3:1 contrast ratio
  • -
  • • UI components: 3:1 contrast ratio
  • -
-
-
-

Level AAA (Enhanced)

-
    -
  • • Normal text: 7:1 contrast ratio
  • -
  • • Large text: 4.5:1 contrast ratio
  • -
-
-
-
-
-
-
- ); -} diff --git a/app/(app)/pastel/accessibility/colorblind/page.tsx b/app/(app)/pastel/colorblind/page.tsx similarity index 100% rename from app/(app)/pastel/accessibility/colorblind/page.tsx rename to app/(app)/pastel/colorblind/page.tsx diff --git a/app/(app)/pastel/accessibility/contrast/page.tsx b/app/(app)/pastel/contrast/page.tsx similarity index 100% rename from app/(app)/pastel/accessibility/contrast/page.tsx rename to app/(app)/pastel/contrast/page.tsx diff --git a/app/(app)/pastel/palettes/distinct/page.tsx b/app/(app)/pastel/distinct/page.tsx similarity index 100% rename from app/(app)/pastel/palettes/distinct/page.tsx rename to app/(app)/pastel/distinct/page.tsx diff --git a/app/(app)/pastel/globals.css b/app/(app)/pastel/globals.css index 33f1895..1a4caac 100644 --- a/app/(app)/pastel/globals.css +++ b/app/(app)/pastel/globals.css @@ -6,16 +6,14 @@ @source "../components/providers/*.{js,ts,jsx,tsx}"; @source "../components/tools/*.{js,ts,jsx,tsx}"; @source "../components/ui/*.{js,ts,jsx,tsx}"; -@source "./playground/*.{js,ts,jsx,tsx}"; -@source "./palettes/*.{js,ts,jsx,tsx}"; -@source "./palettes/distinct/*.{js,ts,jsx,tsx}"; -@source "./palettes/gradient/*.{js,ts,jsx,tsx}"; -@source "./palettes/harmony/*.{js,ts,jsx,tsx}"; +@source "./distinct/*.{js,ts,jsx,tsx}"; +@source "./gradient/*.{js,ts,jsx,tsx}"; +@source "./harmony/*.{js,ts,jsx,tsx}"; @source "./names/*.{js,ts,jsx,tsx}"; @source "./batch/*.{js,ts,jsx,tsx}"; -@source "./accessibility/*.{js,ts,jsx,tsx}"; -@source "./accessibility/colorblind/*.{js,ts,jsx,tsx}"; -@source "./accessibility/contrast/*.{js,ts,jsx,tsx}"; +@source "./colorblind/*.{js,ts,jsx,tsx}"; +@source "./contrast/*.{js,ts,jsx,tsx}"; +@source "./textcolor/*.{js,ts,jsx,tsx}"; @source "*.{js,ts,jsx,tsx}"; @custom-variant dark (&:is(.dark *)); diff --git a/app/(app)/pastel/palettes/gradient/page.tsx b/app/(app)/pastel/gradient/page.tsx similarity index 100% rename from app/(app)/pastel/palettes/gradient/page.tsx rename to app/(app)/pastel/gradient/page.tsx diff --git a/app/(app)/pastel/palettes/harmony/page.tsx b/app/(app)/pastel/harmony/page.tsx similarity index 100% rename from app/(app)/pastel/palettes/harmony/page.tsx rename to app/(app)/pastel/harmony/page.tsx diff --git a/app/(app)/pastel/palettes/page.tsx b/app/(app)/pastel/palettes/page.tsx deleted file mode 100644 index ed0ce2f..0000000 --- a/app/(app)/pastel/palettes/page.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import Link from 'next/link'; -import { Palette, Sparkles, GraduationCap } from 'lucide-react'; - -export default function PalettesPage() { - const paletteTypes = [ - { - title: 'Gradient Creator', - description: 'Create smooth color gradients with multiple stops and color spaces', - href: '/pastel/palettes/gradient', - icon: GraduationCap, - features: ['Multiple color stops', 'Various color spaces', 'Live preview'], - }, - { - title: 'Distinct Colors', - description: 'Generate visually distinct colors using simulated annealing algorithm', - href: '/pastel/palettes/distinct', - icon: Sparkles, - features: ['Perceptual distance', 'Configurable count', 'Quality metrics'], - }, - { - title: 'Harmony Palettes', - description: 'Create color palettes based on color theory and harmony rules', - href: '/pastel/palettes/harmony', - icon: Palette, - features: ['Color theory', 'Multiple schemes', 'Instant generation'], - }, - ]; - - return ( -
-
-
-

Palette Generation

-

- Create beautiful color palettes using various generation methods -

-
- -
- {paletteTypes.map((type) => { - const Icon = type.icon; - return ( - -
- -
-

{type.title}

-

{type.description}

-
    - {type.features.map((feature) => ( -
  • - - {feature} -
  • - ))} -
- - ); - })} -
-
-
- ); -} diff --git a/app/(app)/pastel/accessibility/textcolor/page.tsx b/app/(app)/pastel/textcolor/page.tsx similarity index 100% rename from app/(app)/pastel/accessibility/textcolor/page.tsx rename to app/(app)/pastel/textcolor/page.tsx diff --git a/components/layout/AppSidebar.tsx b/components/layout/AppSidebar.tsx index 8a4fa61..4aaf20e 100644 --- a/components/layout/AppSidebar.tsx +++ b/components/layout/AppSidebar.tsx @@ -74,12 +74,12 @@ const navigation: NavGroup[] = [ href: '/pastel', icon: , items: [ - { title: 'Harmony Palettes', href: '/pastel/palettes/harmony' }, - { title: 'Distinct Colors', href: '/pastel/palettes/distinct' }, - { title: 'Gradients', href: '/pastel/palettes/gradient' }, - { title: 'Contrast Checker', href: '/pastel/accessibility/contrast' }, - { title: 'Color Blindness', href: '/pastel/accessibility/colorblind' }, - { title: 'Text Color', href: '/pastel/accessibility/textcolor' }, + { title: 'Harmony Palettes', href: '/pastel/harmony' }, + { title: 'Distinct Colors', href: '/pastel/distinct' }, + { title: 'Gradients', href: '/pastel/gradient' }, + { title: 'Contrast Checker', href: '/pastel/contrast' }, + { title: 'Color Blindness', href: '/pastel/colorblind' }, + { title: 'Text Color', href: '/pastel/textcolor' }, { title: 'Named Colors', href: '/pastel/names' }, { title: 'Batch Operations', href: '/pastel/batch' }, ] diff --git a/components/pastel/layout/Footer.tsx b/components/pastel/layout/Footer.tsx index 0bfc22a..81e081a 100644 --- a/components/pastel/layout/Footer.tsx +++ b/components/pastel/layout/Footer.tsx @@ -24,17 +24,17 @@ export function Footer() {

Resources