HTMLify

style.css
Views: 37 | Author: cody
:root {
    --white: #FFF;
    --gray: #F3F3F3;
    --gray-mid: #d6d6d6;
    --gray-dark: #3e3e3e;
    --button-hover: #ECE8F9;
    --body-background: #f3f1f9;
}

body {
    font-family: 'Poppins', 
        sans-serif;
    margin: 0px;
    display: flex;
    height: 100vh;
    background-color: var(
        --body-background
    );
}

* {
    box-sizing: border-box;
}

button {
    all: unset;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

button:focus { outline: revert } 

html {
    scroll-behavior: smooth;
}

header {
    height: 80px;
    padding: 0 16px;
    background-color: var(--white);
    width: 100%;
  
    display: flex;
    align-items: center;
    box-shadow: 
        rgba(100, 100, 111, 0.2)
        0px 7px 29px 0px;
}

.navigation__group {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 6px;
}

.navigation__group .icon {
    width: 48px;
    height: 48px;
    padding: 6px;
    transition: all 0.2s 
        ease-in-out;
    border-radius: 50%;
}

.navigation__group > 
button:nth-child(1) {
    margin-right: auto;
}

.navigation__group button:hover, 
.navigation__group button:focus {
    background-color: var(--button-hover);
    border-radius: 50%;
}

.profile {
    display: block;
    width: 44px;
    height: 44px;
    cursor: pointer;
    border-radius: 50%;
}

.quick-settings {
    background-color: var(
        --white
    );
    height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 350px;
    width: 100%;
    padding: 16px 24px;
    right: 0;
    position: fixed;
    box-shadow: 
    rgba(100, 100, 111, 0.2)
    0px 7px 29px 0px;
    animation: fadeInAnimation 
    ease-in-out 0.5s forwards;
}

.quick-settings__content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-settings--headline {
    display: flex;
    width: 100%;
    justify-content: space-between;
}

.none {
    display: none;
}

.hide {
    opacity: 0;
    visibility: hidden;
    animation: fadeOutAnimation
        ease-in-out 0.5s forwards;
}

@keyframes fadeInAnimation {
    0% {
        opacity: 0;
        visibility: hidden;
        width: 0px;
    }
    100% {
        opacity: 1;
        visibility: visible;
        width: 350px;
    }
}

@keyframes fadeOutAnimation {
    0% {
        opacity: 1;
        width: 350px;
        visibility: visible;
    }
    100% {
        opacity: 0;
        width: 0px;
        visibility: hidden;
    }
}

/* Switch button  */
.switch-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: 
        space-between;
}

.switch__label {
    white-space: nowrap;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
  
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(
        --body-background
    );
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

.switch input:checked + .slider {
    background-color: var(
        --gray-dark
    );
}

.switch input:checked + 
.slider:before {
    transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* inspired by 
https://www.w3schools.com/howto/howto_css_switch.asp */

Comments