From 628749a41698de0aaa4a494c5e99f3ae55974d8a Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Tue, 10 Mar 2026 00:18:52 +0100 Subject: [PATCH] feat: opacity-only page transition + sliding indicator on all sub-tabs --- app/sites/[id]/SiteLayoutShell.tsx | 8 ++++---- components/dashboard/ContentStats.tsx | 14 +++++++++++--- components/dashboard/Locations.tsx | 14 +++++++++++--- components/dashboard/TechSpecs.tsx | 14 +++++++++++--- 4 files changed, 37 insertions(+), 13 deletions(-) diff --git a/app/sites/[id]/SiteLayoutShell.tsx b/app/sites/[id]/SiteLayoutShell.tsx index 888b879..e629e8d 100644 --- a/app/sites/[id]/SiteLayoutShell.tsx +++ b/app/sites/[id]/SiteLayoutShell.tsx @@ -21,10 +21,10 @@ export default function SiteLayoutShell({ {children} diff --git a/components/dashboard/ContentStats.tsx b/components/dashboard/ContentStats.tsx index 0bb095b..25f309c 100644 --- a/components/dashboard/ContentStats.tsx +++ b/components/dashboard/ContentStats.tsx @@ -1,6 +1,7 @@ 'use client' import { useState, useEffect } from 'react' +import { motion } from 'framer-motion' import { logger } from '@/lib/utils/logger' import { formatNumber } from '@ciphera-net/ui' import { useTabListKeyboard } from '@/lib/hooks/useTabListKeyboard' @@ -106,13 +107,20 @@ export default function ContentStats({ topPages, entryPages, exitPages, domain, onClick={() => setActiveTab(tab)} role="tab" aria-selected={activeTab === tab} - className={`px-2.5 py-1 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-orange rounded cursor-pointer border-b-2 ${ + className={`relative px-2.5 py-1 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-orange rounded cursor-pointer ${ activeTab === tab - ? 'border-brand-orange text-neutral-900 dark:text-white' - : 'border-transparent text-neutral-400 dark:text-neutral-500 hover:text-neutral-700 dark:hover:text-neutral-300' + ? 'text-neutral-900 dark:text-white' + : 'text-neutral-400 dark:text-neutral-500 hover:text-neutral-700 dark:hover:text-neutral-300' }`} > {getTabLabel(tab)} + {activeTab === tab && ( + + )} ))} diff --git a/components/dashboard/Locations.tsx b/components/dashboard/Locations.tsx index 076bceb..1f4b7e6 100644 --- a/components/dashboard/Locations.tsx +++ b/components/dashboard/Locations.tsx @@ -1,6 +1,7 @@ 'use client' import { useState, useEffect } from 'react' +import { motion } from 'framer-motion' import { logger } from '@/lib/utils/logger' import { formatNumber } from '@ciphera-net/ui' import { useTabListKeyboard } from '@/lib/hooks/useTabListKeyboard' @@ -209,13 +210,20 @@ export default function Locations({ countries, cities, regions, geoDataLevel = ' onClick={() => setActiveTab(tab)} role="tab" aria-selected={activeTab === tab} - className={`px-2.5 py-1 text-xs font-medium transition-colors capitalize focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-orange rounded cursor-pointer border-b-2 ${ + className={`relative px-2.5 py-1 text-xs font-medium transition-colors capitalize focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-orange rounded cursor-pointer ${ activeTab === tab - ? 'border-brand-orange text-neutral-900 dark:text-white' - : 'border-transparent text-neutral-400 dark:text-neutral-500 hover:text-neutral-700 dark:hover:text-neutral-300' + ? 'text-neutral-900 dark:text-white' + : 'text-neutral-400 dark:text-neutral-500 hover:text-neutral-700 dark:hover:text-neutral-300' }`} > {tab} + {activeTab === tab && ( + + )} ))} diff --git a/components/dashboard/TechSpecs.tsx b/components/dashboard/TechSpecs.tsx index c3ca8a1..2b8edff 100644 --- a/components/dashboard/TechSpecs.tsx +++ b/components/dashboard/TechSpecs.tsx @@ -1,6 +1,7 @@ 'use client' import { useState, useEffect } from 'react' +import { motion } from 'framer-motion' import { logger } from '@/lib/utils/logger' import { formatNumber } from '@ciphera-net/ui' import { useTabListKeyboard } from '@/lib/hooks/useTabListKeyboard' @@ -137,13 +138,20 @@ export default function TechSpecs({ browsers, os, devices, screenResolutions, co onClick={() => setActiveTab(tab)} role="tab" aria-selected={activeTab === tab} - className={`px-2.5 py-1 text-xs font-medium transition-colors capitalize focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-orange rounded cursor-pointer border-b-2 ${ + className={`relative px-2.5 py-1 text-xs font-medium transition-colors capitalize focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-orange rounded cursor-pointer ${ activeTab === tab - ? 'border-brand-orange text-neutral-900 dark:text-white' - : 'border-transparent text-neutral-400 dark:text-neutral-500 hover:text-neutral-700 dark:hover:text-neutral-300' + ? 'text-neutral-900 dark:text-white' + : 'text-neutral-400 dark:text-neutral-500 hover:text-neutral-700 dark:hover:text-neutral-300' }`} > {tab} + {activeTab === tab && ( + + )} ))}