diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6f3a291 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5501 +} \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..027bfe3 --- /dev/null +++ b/index.html @@ -0,0 +1,56 @@ + + + + + + + + + Dark-Mode-Toggle-Codante + + + + + diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100644 index 0000000..83e3cfb --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,17 @@ +tailwind.config = { + darkMode: 'class', +}; + +function themeToggle(event) { + const moon = document.querySelector('#moon'); + const sun = document.querySelector('#sun'); + const audio = new Audio('https://www.fesliyanstudios.com/play-mp3/387'); + audio.play(); + moon.classList.add('animate-spin'); + sun.classList.add('animate-spin'); + setTimeout(() => { + document.documentElement.classList.toggle('dark'); + moon.classList.remove('animate-spin'); + sun.classList.remove('animate-spin'); + }, 300); +}