File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,20 @@ import { RoughNotation, RoughNotationGroup } from "react-rough-notation";
1515import { useIsFontReady } from "@/lib/useIsFontReady" ;
1616import { LinkPreview } from "@/components/LinkPreview" ;
1717import { StaticLinkPreview } from "@/components/StaticLinkPreview" ;
18+ import { useTheme } from "next-themes" ;
1819
1920export default function Home ( ) {
2021 const [ colors , setColors ] = useState ( [ ] ) ;
22+ // const [tempInterval, setTempInterval] = useState(null);
23+
24+ let tempInterval ;
2125
2226 const isFontReady = useIsFontReady ( ) ;
27+ const { theme, setTheme } = useTheme ( ) ;
28+
29+ const play = ( ) => {
30+ setTheme ( theme === "dark" ? "light" : "dark" ) ;
31+ } ;
2332
2433 useEffect ( ( ) => {
2534 setColors ( shuffleArray ( LIGHT_COLORS ) ) ;
@@ -87,7 +96,13 @@ export default function Home() {
8796 </ RoughNotation > { " " }
8897 while you're here. < br /> I write about technology, learning and{ " " }
8998 < StaticLinkPreview url = "https://manuarora.in/radhey-bhaiya.jpeg" >
90- < span className = "text-black dark:text-white" > memes.</ span >
99+ < span
100+ onMouseEnter = { play }
101+ onMouseLeave = { play }
102+ className = "text-black dark:text-white"
103+ >
104+ memes.
105+ </ span >
91106 </ StaticLinkPreview >
92107 </ h2 >
93108 </ RoughNotationGroup >
You can’t perform that action at this time.
0 commit comments