From f04fe3dfcbc828fa24cb545fda9b24b2f0688fc8 Mon Sep 17 00:00:00 2001 From: Sascha Date: Mon, 2 Feb 2026 15:22:33 +0100 Subject: [PATCH] feat: add BackToTopButton component and enhance accessibility with custom hooks for keyboard navigation and screen reader announcements --- src/app/AppRouter.tsx | 2 + src/components/BackToTopButton.tsx | 41 +++++ src/components/layout/Navigation.tsx | 3 +- src/components/sections/ContactSection.tsx | 9 +- src/components/sections/HeroSection.tsx | 10 +- src/components/sections/ProjectsSection.tsx | 155 +++---------------- src/components/sections/SkillsSection.tsx | 4 +- src/config/locales/en/projects.ts | 2 +- src/hooks/useProjectKeyboardNavigation.ts | 159 ++++++++++++++++++++ src/hooks/useScreenReaderAnnouncements.ts | 22 +++ src/scss/App.scss | 13 +- src/scss/components/back-to-top.scss | 63 ++++++++ src/scss/globals.scss | 5 +- src/scss/language-toggle.scss | 5 +- src/utils/scrollUtils.ts | 11 +- 15 files changed, 344 insertions(+), 160 deletions(-) create mode 100644 src/components/BackToTopButton.tsx create mode 100644 src/hooks/useProjectKeyboardNavigation.ts create mode 100644 src/hooks/useScreenReaderAnnouncements.ts create mode 100644 src/scss/components/back-to-top.scss diff --git a/src/app/AppRouter.tsx b/src/app/AppRouter.tsx index 9fb9eff..bbe676c 100644 --- a/src/app/AppRouter.tsx +++ b/src/app/AppRouter.tsx @@ -6,6 +6,7 @@ import Footer from '../components/layout/Footer'; import HomePage from '../pages/HomePage'; import ImprintPage from '../pages/ImprintPage'; import PrivacyPolicy from '../pages/PrivacyPolicy'; +import BackToTopButton from '../components/BackToTopButton'; import type { Theme } from '../data/types'; function AppRouter() { @@ -63,6 +64,7 @@ function AppRouter() {