Builds the hero slider with arrows, swipe, and social icons
Replaces the placeholder hero with a crossfading slider (slow zoom, 6s per slide) driven by the progress bar animation; it pauses on mouse hover, keyboard focus, and hidden tabs, and skips autoplay with reduced motion. Adds prev/next arrows and touch swipe, and Facebook/Instagram icons from a fixed set of platforms using bundled Iconify data (@iconify/react/offline and @iconify-icons/ant-design, so no runtime API calls). Content (tagline, title, CTA, slides, socials) is plain data in heroContent.ts and passed in as a prop, so it can come from the CMS API later. The tagline sits inside the h1 together with the name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
import { chakra } from '@chakra-ui/react';
|
||||
import { Icon } from '@iconify/react/offline';
|
||||
import leftOutlined from '@iconify-icons/ant-design/left-outlined';
|
||||
import rightOutlined from '@iconify-icons/ant-design/right-outlined';
|
||||
|
||||
type HeroArrowsProps = {
|
||||
onPrev: () => void;
|
||||
onNext: () => void;
|
||||
};
|
||||
|
||||
// Pijlen links en rechts, verticaal gecentreerd
|
||||
export default function HeroArrows({ onPrev, onNext }: HeroArrowsProps) {
|
||||
return (
|
||||
<>
|
||||
<ArrowButton side="left" aria-label="Vorige foto" onClick={onPrev}>
|
||||
<Icon icon={leftOutlined} aria-hidden />
|
||||
</ArrowButton>
|
||||
<ArrowButton side="right" aria-label="Volgende foto" onClick={onNext}>
|
||||
<Icon icon={rightOutlined} aria-hidden />
|
||||
</ArrowButton>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
type ArrowButtonProps = React.ComponentProps<typeof chakra.button> & {
|
||||
side: 'left' | 'right';
|
||||
};
|
||||
|
||||
const ARROW_OFFSET = 'clamp(0.5rem, 3vw, 2.5rem)';
|
||||
|
||||
function ArrowButton({ side, ...props }: ArrowButtonProps) {
|
||||
return (
|
||||
<chakra.button
|
||||
type="button"
|
||||
position="absolute"
|
||||
top="50%"
|
||||
left={side === 'left' ? ARROW_OFFSET : undefined}
|
||||
right={side === 'right' ? ARROW_OFFSET : undefined}
|
||||
zIndex={2}
|
||||
transform="translateY(-50%)"
|
||||
display="flex"
|
||||
p={2}
|
||||
color="white"
|
||||
fontSize={{ base: '1.5rem', md: '2rem' }}
|
||||
cursor="pointer"
|
||||
opacity={0.6}
|
||||
transitionProperty="opacity"
|
||||
transitionDuration="interaction"
|
||||
transitionTimingFunction="smooth"
|
||||
_hover={{ opacity: 1 }}
|
||||
_focusVisible={{ opacity: 1, outline: '1px solid white', outlineOffset: '2px' }}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user