diff --git a/client/public/index.html b/client/public/index.html index de0b1b5..37bf159 100755 --- a/client/public/index.html +++ b/client/public/index.html @@ -14,6 +14,18 @@ + +
+ + +
+ + + diff --git a/client/src/index.css b/client/src/index.css index 22f8f18..113bb97 100755 --- a/client/src/index.css +++ b/client/src/index.css @@ -3,3 +3,67 @@ body { padding: 0; font-family: sans-serif; } +@import url('https://fonts.googleapis.com/css?family=Muli&display=swap'); + +* { + box-sizing: border-box; +} + +body { + background-color: #fafafa; + display: flex; + align-items: center; + justify-content: center; + height: 100vh; + margin: 0; + transition: background 0.2s linear; +} + +body.dark { + background: #292C35; +} + +.checkbox { + opacity: 0; + position: right; +} + +.label { + background-color: #111; + border-radius: 50px; + cursor: pointer; + display: flex; + align-items: center; + justify-content: space-between; + padding: 5px; + position: relative; + height: 26px; + width: 50px; + transform: scale(1.5); +} + +.label .ball { + background-color: #fff; + border-radius: 50%; + position: absolute; + top: 2px; + left: 2px; + height: 22px; + width: 22px; + transform: translateX(0px); + transition: transform 0.2s linear; +} + +.checkbox:checked + .label .ball { + transform: translateX(24px); +} + + +.fa-moon { + color: #f1c40f; +} + +.fa-sun { + color: #f39c12; +} + diff --git a/client/src/index.js b/client/src/index.js index e0a64cf..b49bd3a 100755 --- a/client/src/index.js +++ b/client/src/index.js @@ -26,6 +26,12 @@ const app = ( ); +const chk = document.getElementById('chk'); + +chk.addEventListener('change', () => { + document.body.classList.toggle('dark'); +}); + ReactDOM.render(app, document.getElementById('root')); // registerServiceWorker();