'use client' import { useRef } from 'react' import { Bi } from '@/lib/i18n' import type { Portfolio, Resume } from '@/lib/types' import styles from './hero.module.css' type TextKey = 'name' | 'role' | 'bio' | 'availability' type Props = { en: Resume; ru: Resume; portfolio: Portfolio; mailHref: string; showProjects: boolean } export default function Hero({ en, ru, portfolio, mailHref, showProjects }: Readonly) { const hero = useRef(null) const text = (key: TextKey) => // The floor sways a couple of degrees with the pointer, like nudging the viewport. const onPointerMove = (event: React.PointerEvent) => { if (event.pointerType !== 'mouse' || !hero.current) return const offset = event.clientX / window.innerWidth - 0.5 hero.current.style.setProperty('--sway', `${(offset * 3).toFixed(2)}deg`) } return (

{text('availability')}

{text('name')}

{text('role')}

{text('bio')}

{showProjects && ( )}
) }