diff --git a/sass/darkmode_toggle.scss b/sass/darkmode_toggle.scss new file mode 100644 index 0000000..7c1bf9b --- /dev/null +++ b/sass/darkmode_toggle.scss @@ -0,0 +1,88 @@ +:root { + --light: #d8dbe0; + --dark: #28292c; + --link: rgb(27, 129, 112); + --link-hover: rgb(24, 94, 82); +} + +* { + /* padding: 0; */ + /* margin: 0; */ + /* box-sizing: border-box; */ +} + +body { + /* background-color: #cfafaf; */ + /* display: flex; */ + /* justify-content: center; */ + /* align-items: center; */ + /* height: 100vh; */ +} + +$diameter: 100; + +.toggle-switch { + position: relative; + width: 200px; +} + +label { + position: absolute; + width: 100%; + height: 100px; + background-color: var(--dark); + border-radius: 50px; + cursor: pointer; +} + +input { + position: absolute; + display: none; +} + +.slider { + position: absolute; + width: 100%; + height: 100%; + border-radius: 50px; + transition: 0.3s; +} + +input:checked~.slider { + background-color: var(--light); +} + +.slider::before { + content: ""; + position: absolute; + top: 13px; + left: 16px; + width: 75px; + height: 75px; + border-radius: 50%; + box-shadow: inset 28px -4px 0px 0px var(--light); + background-color: var(--dark); + transition: 0.3s; +} + +input:checked~.slider::before { + transform: translateX(95px); + background-color: var(--dark); + box-shadow: none; +} + +a { + position: relative; + font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; + top: 150px; + left: 10px; + font-size: 10px; + text-decoration: none; + color: var(--link); + font-weight: bold; + text-align: center; +} + +a:hover { + color: var(--link-hover); +} \ No newline at end of file diff --git a/templates/_macros.html b/templates/_macros.html index 43723fd..894bafd 100644 --- a/templates/_macros.html +++ b/templates/_macros.html @@ -42,10 +42,13 @@ - +