Completes the front-end shell with footer, status pages and SEO
Adds the footer, back-to-top button, skip link, placeholder routes, 404 and error pages inside the shell, plus per-page SEO from a single page registry (canonical URLs, Open Graph image, JSON-LD, generated sitemap.xml and robots.txt). Theme tokens and recipes replace repeated styling, the hero loads only the active and neighbouring slides, and the e-mail address is joined in the browser to keep it out of the HTML and bundle. Adds Vitest with property-based (fast-check) and axe tests, ESLint, security headers for dev and preview, Lighthouse CI and a `pnpm check` script that runs all quality gates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,15 +12,22 @@ export default function useHeroSlider(count: number) {
|
||||
const [hovered, setHovered] = useState(false);
|
||||
const [focused, setFocused] = useState(false);
|
||||
const [hidden, setHidden] = useState(() => document.hidden);
|
||||
const [reducedMotion] = useMediaQuery(['(prefers-reduced-motion: reduce)'], {
|
||||
ssr: false,
|
||||
});
|
||||
const [reducedMotion] = useMediaQuery(
|
||||
['(prefers-reduced-motion: reduce)'],
|
||||
{
|
||||
ssr: false,
|
||||
},
|
||||
);
|
||||
const touchStart = useRef<{ x: number; y: number } | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const onVisibilityChange = () => setHidden(document.hidden);
|
||||
document.addEventListener('visibilitychange', onVisibilityChange);
|
||||
return () => document.removeEventListener('visibilitychange', onVisibilityChange);
|
||||
return () =>
|
||||
document.removeEventListener(
|
||||
'visibilitychange',
|
||||
onVisibilityChange,
|
||||
);
|
||||
}, []);
|
||||
|
||||
// Als de API minder slides teruggeeft dan de huidige index, begin vooraan.
|
||||
@@ -65,7 +72,11 @@ export default function useHeroSlider(count: number) {
|
||||
const dy = touch.clientY - start.y;
|
||||
|
||||
// Horizontaal genoeg, en niet bedoeld als verticaal scrollen
|
||||
if (Math.abs(dx) < SWIPE_THRESHOLD || Math.abs(dx) < Math.abs(dy)) return;
|
||||
if (
|
||||
Math.abs(dx) < SWIPE_THRESHOLD ||
|
||||
Math.abs(dx) < Math.abs(dy)
|
||||
)
|
||||
return;
|
||||
if (dx < 0) next();
|
||||
else prev();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user