Skip to content

Commit

Permalink
Add secret event setup
Browse files Browse the repository at this point in the history
  • Loading branch information
dy0gu committed Dec 7, 2023
1 parent c89bf53 commit dc23ca6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
19 changes: 19 additions & 0 deletions app/components/secret.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React, { useEffect } from "react";

const Secret: React.FC = () => {
useEffect(() => {
const handleKeyDown = (event: KeyboardEvent) => {
console.log("You pressed a key!");
};

document.addEventListener("keydown", handleKeyDown);

return () => {
document.removeEventListener("keydown", handleKeyDown);
};
}, []);

return null;
};

export default Secret;
2 changes: 2 additions & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import Link from "next/link";
import Particles from "./components/particles";
import Secret from "./components/secret";
import React from "react";
import Balancer from "react-wrap-balancer";
import Typewriter from "typewriter-effect";
Expand All @@ -15,6 +16,7 @@ const navigation = [
export default function Home() {
return (
<div className="flex flex-col items-center justify-center w-screen h-screen overflow-hidden bg-gradient-to-tl from-black via-zinc-600/20 to-black">
<Secret />
<nav className="my-16 mx-16 animate-fade-in">
<ul className="flex text-sm md:text-md lg:text-xl items-center justify-center gap-4">
{navigation.map((item, index) => (
Expand Down

0 comments on commit dc23ca6

Please sign in to comment.