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:
@@ -3,13 +3,13 @@ import {
|
||||
HStack,
|
||||
chakra,
|
||||
Image,
|
||||
Box,
|
||||
Container,
|
||||
useBreakpointValue,
|
||||
} from '@chakra-ui/react';
|
||||
import NavLink from './NavLink';
|
||||
import MobileNav from './MobileNav';
|
||||
import navItems from './navItems';
|
||||
import { mainNav } from '@/navigation';
|
||||
import RouterLink from '../RouterLink';
|
||||
import useScrolledPast from '@/hooks/useScrolledPast';
|
||||
import { useCallback, useState } from 'react';
|
||||
import { useRouterState } from '@tanstack/react-router';
|
||||
@@ -19,7 +19,7 @@ import logoLight from '../../assets/logo-light.png';
|
||||
import logoDark from '../../assets/logo-dark.png';
|
||||
|
||||
export default function NavigationBar() {
|
||||
let [open, setOpen] = useState(false);
|
||||
const [open, setOpen] = useState(false);
|
||||
const closeMenu = useCallback(() => setOpen(false), []);
|
||||
|
||||
// Het mobiele menu bestaat alleen onder lg; wordt het scherm breder, dan
|
||||
@@ -47,7 +47,7 @@ export default function NavigationBar() {
|
||||
position="fixed"
|
||||
top={0}
|
||||
insetX={0}
|
||||
zIndex="docked"
|
||||
zIndex="header"
|
||||
// Zelfde hoogte als waar de hero-content onder begint; kleiner na scrollen
|
||||
h={pastHero ? 'header.sticky' : 'header'}
|
||||
display="flex"
|
||||
@@ -69,7 +69,11 @@ export default function NavigationBar() {
|
||||
alignItems="center"
|
||||
justifyContent="space-between"
|
||||
>
|
||||
<Box
|
||||
<RouterLink
|
||||
to="/"
|
||||
aria-label="Andrea Slop Fotografie, naar de homepage"
|
||||
data-testid="nav-logo-link"
|
||||
display="block"
|
||||
flexBasis="auto"
|
||||
flexGrow={1}
|
||||
flexShrink={0}
|
||||
@@ -84,17 +88,22 @@ export default function NavigationBar() {
|
||||
transitionTimingFunction="smooth"
|
||||
>
|
||||
{/* Twee logo's, zodat de kleur per schermbreedte kan wisselen */}
|
||||
{/* De link heeft de naam; de logo's zelf zijn decoratief */}
|
||||
<Image
|
||||
src={logoDark}
|
||||
alt="Andrea Slop Fotografie"
|
||||
alt=""
|
||||
htmlWidth={500}
|
||||
htmlHeight={500}
|
||||
display={overlay('block', 'none')}
|
||||
/>
|
||||
<Image
|
||||
src={logoLight}
|
||||
alt="Andrea Slop Fotografie"
|
||||
alt=""
|
||||
htmlWidth={500}
|
||||
htmlHeight={500}
|
||||
display={overlay('none', 'block')}
|
||||
/>
|
||||
</Box>
|
||||
</RouterLink>
|
||||
<chakra.nav
|
||||
aria-label="Hoofdmenu"
|
||||
flexBasis="100%"
|
||||
@@ -109,7 +118,7 @@ export default function NavigationBar() {
|
||||
// Op mobiel staan de links in het hamburgermenu
|
||||
display={{ base: 'none', lg: 'flex' }}
|
||||
>
|
||||
{navItems.map((item) => (
|
||||
{mainNav.map((item) => (
|
||||
<chakra.li key={item.to}>
|
||||
<NavLink to={item.to}>
|
||||
{item.label}
|
||||
@@ -135,15 +144,17 @@ export default function NavigationBar() {
|
||||
data-open={menuOpen || undefined}
|
||||
// Op desktop opent deze knop straks het info-menu (side area)
|
||||
display={{ base: 'block', lg: 'none' }}
|
||||
data-testid="nav-menu-toggle"
|
||||
position="relative"
|
||||
w="32px"
|
||||
h="32px"
|
||||
// 44px: minimaal klikdoel op touch (BR-RWD-04)
|
||||
w="44px"
|
||||
h="44px"
|
||||
cursor="pointer"
|
||||
zIndex="modal"
|
||||
zIndex="menuToggle"
|
||||
css={{
|
||||
'& > span': {
|
||||
position: 'absolute',
|
||||
left: '4px',
|
||||
left: '10px',
|
||||
width: '24px',
|
||||
height: '2px',
|
||||
bg: 'currentColor',
|
||||
@@ -151,22 +162,22 @@ export default function NavigationBar() {
|
||||
transition:
|
||||
'transform 0.3s ease, opacity 0.2s ease, top 0.3s ease',
|
||||
},
|
||||
'& > span:nth-of-type(1)': { top: '9px' },
|
||||
'& > span:nth-of-type(2)': { top: '15px' },
|
||||
'& > span:nth-of-type(3)': { top: '21px' },
|
||||
'& > span:nth-of-type(1)': { top: '15px' },
|
||||
'& > span:nth-of-type(2)': { top: '21px' },
|
||||
'& > span:nth-of-type(3)': { top: '27px' },
|
||||
|
||||
// open kruisje
|
||||
'&[data-open] > span:nth-of-type(1)': {
|
||||
top: '15px',
|
||||
top: '21px',
|
||||
transform: 'rotate(45deg)',
|
||||
},
|
||||
'&[data-open] > span:nth-of-type(2)': {
|
||||
opacity: 0,
|
||||
top: '15px',
|
||||
top: '21px',
|
||||
transform: 'rotate(45deg)',
|
||||
},
|
||||
'&[data-open] > span:nth-of-type(3)': {
|
||||
top: '15px',
|
||||
top: '21px',
|
||||
transform: 'rotate(-45deg)',
|
||||
},
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user