diff --git a/dark-mode.css b/dark-mode.css new file mode 100644 index 0000000..c3ec538 --- /dev/null +++ b/dark-mode.css @@ -0,0 +1,6 @@ + +.dark-mode { + background-color: black; + color: white; + } + \ No newline at end of file diff --git a/index.html b/index.html index 8cb6a37..72a4dee 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,7 @@ Calculator + @@ -31,7 +32,20 @@ + +
+
+ + diff --git a/styles.css b/styles.css index ce2fd4e..4b2516f 100644 --- a/styles.css +++ b/styles.css @@ -1,58 +1,118 @@ -*, *::before , *::after { - box-sizing: border-box; - font-family: 'Nunito', sans-serif; - font-weight: normal; -} - -body { - padding: 0; - margin: 0; - background: linear-gradient(to right, #FDC830, #F37335); -} - -.calculator-grid { - display: grid; - justify-content: center; - align-content: center; - min-height: 100vh; - grid-template-columns: repeat(4, 75px); - grid-template-rows: minmax(90px, auto) repeat(5, 75px); -} - -.calculator-grid > button { - cursor: pointer; - font-size: 1.5rem; - border: 1px solid white; - outline: none; - background-color: rgba(255, 255, 255, .75); -} - -.calculator-grid > button:hover { - background-color: rgba(255, 255, 255, .90); -} - -.span-two { - grid-column: span 2; -} - -.output { - grid-column: 1 / -1; - background-color: rgba(0, 0, 0, .75); - display: flex; - align-items: flex-end; - justify-content: space-around; - flex-direction: column; - padding: 10px; - word-wrap: break-word; - word-break: break-all; -} - -.output .previous-operand { - color: rgba(255, 255, 255, .75); - font-size: 1 rem; -} - -.output .current-operand { - color: white; - font-size: 1.75rem; + +.switch { + position: relative; + display: inline-block; + width: 60px; + height: 34px; + } + + .switch input { + opacity: 0; + width: 0; + height: 0; + } + + .slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #ccc; + -webkit-transition: .4s; + transition: .4s; + } + + .slider:before { + position: absolute; + content: ""; + height: 26px; + width: 26px; + left: 4px; + bottom: 4px; + background-color: white; + -webkit-transition: .4s; + transition: .4s; + } + + input:checked + .slider { + background-color: #2196F3; + } + + input:focus + .slider { + box-shadow: 0 0 1px #2196F3; + } + + input:checked + .slider:before { + -webkit-transform: translateX(26px); + -ms-transform: translateX(26px); + transform: translateX(26px); + } + + /* Rounded sliders */ + .slider.round { + border-radius: 34px; + } + + .slider.round:before { + border-radius: 50%; + } +*, *::before , *::after { + box-sizing: border-box; + font-family: 'Nunito', sans-serif; + font-weight: normal; +} + +body { + padding: 0; + margin: 0; + background: linear-gradient(to right, #FDC830, #F37335); +} + +.calculator-grid { + display: grid; + justify-content: center; + align-content: center; + min-height: 100vh; + grid-template-columns: repeat(4, 75px); + grid-template-rows: minmax(90px, auto) repeat(5, 75px); +} + +.calculator-grid > button { + cursor: pointer; + font-size: 1.5rem; + border: 1px solid white; + outline: none; + background-color: rgba(255, 255, 255, .75); +} + +.calculator-grid > button:hover { + background-color: rgba(255, 255, 255, .90); +} + +.span-two { + grid-column: span 2; +} + +.output { + grid-column: 1 / -1; + background-color: rgba(0, 0, 0, .75); + display: flex; + align-items: flex-end; + justify-content: space-around; + flex-direction: column; + padding: 10px; + word-wrap: break-word; + word-break: break-all; +} + +.output .previous-operand { + color: rgba(255, 255, 255, .75); + font-size: 1 rem; +} + +.output .current-operand { + color: white; + font-size: 1.75rem; } \ No newline at end of file