Skip to content

Commit 40fd3a4

Browse files
committed
feat: test
1 parent 907d4aa commit 40fd3a4

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

apps/tuk-landing/src/app/(home)/src/components/MainSection.tsx

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,34 @@
22

33
import Image from 'next/image';
44
import Link from 'next/link';
5+
import { useEffect } from 'react';
56

67
const MainSection = () => {
8+
useEffect(() => {
9+
const setVh = () => {
10+
document.documentElement.style.setProperty('--vh', `${window.innerHeight * 0.01}px`);
11+
};
12+
13+
setVh();
14+
window.addEventListener('resize', setVh);
15+
return () => window.removeEventListener('resize', setVh);
16+
}, []);
717
return (
8-
<section id="thumbnail" className="fixed left-0 top-0 z-[-1] h-dvh w-full">
18+
<section
19+
id="thumbnail"
20+
className="fixed left-0 top-0 z-[-1] w-full"
21+
style={{ height: 'calc(var(--vh, 1vh) * 100)' }}
22+
>
923
<div className="absolute inset-0 z-0">
1024
<Image
1125
src="/main-bg.jpg"
1226
alt="Main Background"
13-
fill
27+
fill={false}
1428
priority
1529
quality={100}
16-
className="object-cover object-center opacity-90"
30+
width={1440}
31+
height={900}
32+
className="size-full object-cover object-center opacity-90"
1733
/>
1834
</div>
1935

0 commit comments

Comments
 (0)