From 0fe115f46e6c6b593fd2067eca319153cd2529fc Mon Sep 17 00:00:00 2001 From: RJ Date: Fri, 5 Dec 2025 16:19:58 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9DUpdate=20breadcrumbs=20i18n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/[locale]/@breadcrumbs/about/page.tsx | 7 +- .../@breadcrumbs/blog/[...slug]/page.tsx | 17 +- app/[locale]/@breadcrumbs/blog/page.tsx | 7 +- app/[locale]/@breadcrumbs/tags/[tag]/page.tsx | 4 +- app/[locale]/@breadcrumbs/tags/page.tsx | 7 +- app/[locale]/page.tsx | 8 +- app/globals.css | 145 +++++++++++++++--- components/effects/glitch-button.tsx | 17 +- components/layout/hero-header.tsx | 20 ++- lib/utils.ts | 2 +- messages/en.json | 14 +- messages/ro.json | 5 +- 12 files changed, 175 insertions(+), 78 deletions(-) diff --git a/app/[locale]/@breadcrumbs/about/page.tsx b/app/[locale]/@breadcrumbs/about/page.tsx index 7584620..8670f2e 100644 --- a/app/[locale]/@breadcrumbs/about/page.tsx +++ b/app/[locale]/@breadcrumbs/about/page.tsx @@ -1,11 +1,16 @@ +'use client' + import { Breadcrumbs } from '@/components/layout/Breadcrumbs' +import { useTranslations } from 'next-intl' export default function AboutBreadcrumb() { + const t = useTranslations('Breadcrumbs') + return ( }) { + const t = await getTranslations('Breadcrumbs') const { slug } = await params const slugPath = slug.join('/') const post = await getPostBySlug(slugPath) const items: BreadcrumbItem[] = [ { - label: 'Blog', + label: t('blog'), href: '/blog', }, ] @@ -36,8 +28,9 @@ export default async function BlogPostBreadcrumb({ if (slug.length > 1) { for (let i = 0; i < slug.length - 1; i++) { const segmentPath = slug.slice(0, i + 1).join('/') + const dirName = slug[i] items.push({ - label: formatDirectoryName(slug[i]), + label: t(dirName) || dirName.charAt(0).toUpperCase() + dirName.slice(1), href: `/blog/${segmentPath}`, }) } diff --git a/app/[locale]/@breadcrumbs/blog/page.tsx b/app/[locale]/@breadcrumbs/blog/page.tsx index 44e92ed..c2ce44d 100644 --- a/app/[locale]/@breadcrumbs/blog/page.tsx +++ b/app/[locale]/@breadcrumbs/blog/page.tsx @@ -1,11 +1,16 @@ +'use client' + import { Breadcrumbs } from '@/components/layout/Breadcrumbs' +import { useTranslations } from 'next-intl' export default function BlogBreadcrumb() { + const t = useTranslations('Breadcrumbs') + return ( }) { + const t = await getTranslations('Breadcrumbs') const { tag } = await params const tagName = tag .split('-') @@ -11,7 +13,7 @@ export default async function TagBreadcrumb({ params }: { params: Promise<{ tag:
{/* Logo */} - +

diff --git a/app/globals.css b/app/globals.css index 3340151..940e4e1 100644 --- a/app/globals.css +++ b/app/globals.css @@ -473,12 +473,62 @@ @layer utilities { .glitch-btn-cyber { --glitch-shimmy: 5; - --glitch-clip-1: polygon(0 2%, 100% 2%, 100% 95%, 95% 95%, 95% 90%, 85% 90%, 85% 95%, 8% 95%, 0 70%); - --glitch-clip-2: polygon(0 78%, 100% 78%, 100% 100%, 95% 100%, 95% 90%, 85% 90%, 85% 100%, 8% 100%, 0 78%); - --glitch-clip-3: polygon(0 44%, 100% 44%, 100% 54%, 95% 54%, 95% 54%, 85% 54%, 85% 54%, 8% 54%, 0 54%); + --glitch-clip-1: polygon( + 0 2%, + 100% 2%, + 100% 95%, + 95% 95%, + 95% 90%, + 85% 90%, + 85% 95%, + 8% 95%, + 0 70% + ); + --glitch-clip-2: polygon( + 0 78%, + 100% 78%, + 100% 100%, + 95% 100%, + 95% 90%, + 85% 90%, + 85% 100%, + 8% 100%, + 0 78% + ); + --glitch-clip-3: polygon( + 0 44%, + 100% 44%, + 100% 54%, + 95% 54%, + 95% 54%, + 85% 54%, + 85% 54%, + 8% 54%, + 0 54% + ); --glitch-clip-4: polygon(0 0, 100% 0, 100% 0, 95% 0, 95% 0, 85% 0, 85% 0, 8% 0, 0 0); - --glitch-clip-5: polygon(0 40%, 100% 40%, 100% 85%, 95% 85%, 95% 85%, 85% 85%, 85% 85%, 8% 85%, 0 70%); - --glitch-clip-6: polygon(0 63%, 100% 63%, 100% 80%, 95% 80%, 95% 80%, 85% 80%, 85% 80%, 8% 80%, 0 70%); + --glitch-clip-5: polygon( + 0 40%, + 100% 40%, + 100% 85%, + 95% 85%, + 95% 85%, + 85% 85%, + 85% 85%, + 8% 85%, + 0 70% + ); + --glitch-clip-6: polygon( + 0 63%, + 100% 63%, + 100% 80%, + 95% 80%, + 95% 80%, + 85% 80%, + 85% 80%, + 8% 80%, + 0 70% + ); } .glitch-overlay { @@ -498,29 +548,80 @@ } @keyframes glitch-btn-animate { - 0% { clip-path: var(--glitch-clip-1); } - 2%, 8% { clip-path: var(--glitch-clip-2); transform: translate(calc(var(--glitch-shimmy) * -1%), 0); } - 6% { clip-path: var(--glitch-clip-2); transform: translate(calc(var(--glitch-shimmy) * 1%), 0); } - 9% { clip-path: var(--glitch-clip-2); transform: translate(0, 0); } - 10% { clip-path: var(--glitch-clip-3); transform: translate(calc(var(--glitch-shimmy) * 1%), 0); } - 13% { clip-path: var(--glitch-clip-3); transform: translate(0, 0); } - 14%, 21% { clip-path: var(--glitch-clip-4); transform: translate(calc(var(--glitch-shimmy) * 1%), 0); } - 25%, 30% { clip-path: var(--glitch-clip-5); transform: translate(calc(var(--glitch-shimmy) * -1%), 0); } - 35%, 45% { clip-path: var(--glitch-clip-6); transform: translate(calc(var(--glitch-shimmy) * -1%), 0); } - 40% { clip-path: var(--glitch-clip-6); transform: translate(calc(var(--glitch-shimmy) * 1%), 0); } - 50% { clip-path: var(--glitch-clip-6); transform: translate(0, 0); } - 55% { clip-path: var(--glitch-clip-3); transform: translate(calc(var(--glitch-shimmy) * 1%), 0); } - 60% { clip-path: var(--glitch-clip-3); transform: translate(0, 0); } - 61%, 100% { clip-path: var(--glitch-clip-4); } + 0% { + clip-path: var(--glitch-clip-1); + } + 2%, + 8% { + clip-path: var(--glitch-clip-2); + transform: translate(calc(var(--glitch-shimmy) * -1%), 0); + } + 6% { + clip-path: var(--glitch-clip-2); + transform: translate(calc(var(--glitch-shimmy) * 1%), 0); + } + 9% { + clip-path: var(--glitch-clip-2); + transform: translate(0, 0); + } + 10% { + clip-path: var(--glitch-clip-3); + transform: translate(calc(var(--glitch-shimmy) * 1%), 0); + } + 13% { + clip-path: var(--glitch-clip-3); + transform: translate(0, 0); + } + 14%, + 21% { + clip-path: var(--glitch-clip-4); + transform: translate(calc(var(--glitch-shimmy) * 1%), 0); + } + 25%, + 30% { + clip-path: var(--glitch-clip-5); + transform: translate(calc(var(--glitch-shimmy) * -1%), 0); + } + 35%, + 45% { + clip-path: var(--glitch-clip-6); + transform: translate(calc(var(--glitch-shimmy) * -1%), 0); + } + 40% { + clip-path: var(--glitch-clip-6); + transform: translate(calc(var(--glitch-shimmy) * 1%), 0); + } + 50% { + clip-path: var(--glitch-clip-6); + transform: translate(0, 0); + } + 55% { + clip-path: var(--glitch-clip-3); + transform: translate(calc(var(--glitch-shimmy) * 1%), 0); + } + 60% { + clip-path: var(--glitch-clip-3); + transform: translate(0, 0); + } + 61%, + 100% { + clip-path: var(--glitch-clip-4); + } } .glitch-btn-subtle { --glitch-shimmy: 2; } - .glitch-overlay-pink { color: var(--neon-pink); } - .glitch-overlay-purple { color: var(--neon-purple); } - .glitch-overlay-magenta { color: var(--neon-magenta); } + .glitch-overlay-pink { + color: var(--neon-pink); + } + .glitch-overlay-purple { + color: var(--neon-purple); + } + .glitch-overlay-magenta { + color: var(--neon-magenta); + } @media (prefers-reduced-motion: reduce) { .glitch-btn-cyber:is(:hover, :focus-visible) .glitch-overlay { diff --git a/components/effects/glitch-button.tsx b/components/effects/glitch-button.tsx index ebdbffc..a33343a 100644 --- a/components/effects/glitch-button.tsx +++ b/components/effects/glitch-button.tsx @@ -19,11 +19,7 @@ export function GlitchButton({ ...props }: GlitchButtonProps) { const glitchClasses = !disabled - ? cn( - 'glitch-btn-cyber', - variant === 'subtle' && 'glitch-btn-subtle', - 'relative' - ) + ? cn('glitch-btn-cyber', variant === 'subtle' && 'glitch-btn-subtle', 'relative') : '' const overlayColorClass = { @@ -34,18 +30,11 @@ export function GlitchButton({ }[glitchColor] return ( -