Skip to content

Commit

Permalink
feat: creepy laughter when click
Browse files Browse the repository at this point in the history
  • Loading branch information
12Gustavo21 committed Mar 26, 2024
1 parent ad1c5b7 commit 3626083
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/assets/services/routes/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, { useState } from "react";

//React router dom
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
Expand All @@ -16,7 +16,18 @@ import About from "../../pages/about";
import Contact from "../../pages/contact";
import Frined from "../../components/friend";

export default function index() {
//Sound
import ForestSong from "../../sounds/click-sound.mp3";

export default function Index() {
const [sound] = useState(new Audio(ForestSong));
const handleClick = () => {
sound.play();
sound.volume = 0.5;
};

document.addEventListener("click", handleClick);

return (
<>
<Router>
Expand Down
Binary file added src/assets/sounds/click-sound.mp3
Binary file not shown.
Binary file removed src/assets/sounds/night-forest-soundscape.mp3
Binary file not shown.

0 comments on commit 3626083

Please sign in to comment.