-
Notifications
You must be signed in to change notification settings - Fork 1
/
DVD.tsx
48 lines (42 loc) · 1.36 KB
/
DVD.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* eslint-disable react-hooks/exhaustive-deps */
/* eslint-disable @next/next/no-img-element */
import Link from "next/link";
import React from "react";
import { useState, useEffect } from "react";
import { useDvdScreenSaver } from "react-dvd-screensaver";
import Header from "./pages/components/Header";
const DVD = () => {
const [impactCount, setImpactCount] = useState<number>(0);
const [colorToad, setColorToad] = useState<boolean>(true);
const dvdScreenSaver = useDvdScreenSaver({ speed: 0.1 });
const handleComponentImpactCount = (count: number) => {
setImpactCount(count);
};
useEffect(() => {
setColorToad(!colorToad);
}, [dvdScreenSaver.impactCount]);
return (
<div className="page404">
<Header title="404" />
<div
ref={dvdScreenSaver.parentRef}
className={`hooks-parent ${colorToad ? "blue" : "red"}`}
>
<div ref={dvdScreenSaver.childRef} className="hooks-child">
<Link href="/" passHref>
<a className="text-scratchy cursor-pointer">
<img
src={colorToad ? "/404Toad.jpg" : "/404Toad_Red.jpg"}
alt="404"
/>
<div className="text-center text-white w-full m-auto">
Go Home
</div>
</a>
</Link>
</div>
</div>
</div>
);
};
export default DVD;