From 7103019890960e793deefb64987a09b33be60b42 Mon Sep 17 00:00:00 2001 From: Michael Hunteman Date: Fri, 17 May 2024 15:20:30 -0700 Subject: Add golang server --- src/components/Home.tsx | 73 ------------------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 src/components/Home.tsx (limited to 'src/components/Home.tsx') diff --git a/src/components/Home.tsx b/src/components/Home.tsx deleted file mode 100644 index 839667a..0000000 --- a/src/components/Home.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import React from 'react'; -import { useEffect, useRef, useState } from 'react'; -import './active.css'; - -function Home() { - const [index, setIndex] = useState(0); - const colors = ['#FF0000', '#00FF00', '#0000FF']; - const timeout = useRef(0); - - useEffect(() => { - resetTimeout(); - timeout.current = window.setTimeout( - () => - setIndex((prevIndex) => - prevIndex === colors.length - 1 ? 0 : prevIndex + 1 - ), - 2500 - ); - - return () => { - resetTimeout(); - }; - }, [index]); - - const resetTimeout = () => { - if (timeout.current) { - clearTimeout(timeout.current); - } - }; - - return ( -
-
- {colors.map((backgroundColor, colorIndex) => ( -
- ))} -
-
- {colors.map((_, colorIndex) => ( -
{ - setIndex(colorIndex); - }} - /> - ))} -
-
- ); -} - -export default Home; -- cgit v1.2.3