From 931b5ecfa681c8477adf56e7652cc7fb5ba64592 Mon Sep 17 00:00:00 2001 From: Thiago Banfi Credico Date: Thu, 25 May 2023 14:13:55 -0300 Subject: [PATCH 1/2] feat: add toggle button, icons and class dark --- .vscode/settings.json | 3 +++ index.html | 56 +++++++++++++++++++++++++++++++++++++++++++ tailwind.config.js | 8 +++++++ 3 files changed, 67 insertions(+) create mode 100644 .vscode/settings.json create mode 100644 index.html create mode 100644 tailwind.config.js 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..3730132 --- /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..5332c79 --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,8 @@ +tailwind.config = { + darkMode: 'class', +}; + +function themeToggle(event) { + console.log('theme'); + document.documentElement.classList.toggle('dark'); +} From 0daca5d898ff629073445e98af994a87826462c6 Mon Sep 17 00:00:00 2001 From: Thiago Banfi Credico Date: Thu, 25 May 2023 16:43:26 -0300 Subject: [PATCH 2/2] feat: add spin animation and click sound --- index.html | 10 +++++----- tailwind.config.js | 13 +++++++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 3730132..027bfe3 100644 --- a/index.html +++ b/index.html @@ -25,11 +25,11 @@ class="w-2/5 h-4/5 bg-zinc-800 absolute rounded-full left-1 top-1 peer-checked:bg-zinc-100 peer-checked:left-11 transition-all duration-500 peer-checked:drop-shadow-xl" >