Skip to content

Commit

Permalink
feat: add invate and nav bar
Browse files Browse the repository at this point in the history
  • Loading branch information
mrgleam committed Oct 5, 2024
1 parent 109f219 commit 9f02d35
Show file tree
Hide file tree
Showing 9 changed files with 534 additions and 38 deletions.
13 changes: 0 additions & 13 deletions priv/static/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -820,11 +820,6 @@ select {
background-color: rgb(21 128 61 / var(--tw-bg-opacity));
}

.bg-indigo-500 {
--tw-bg-opacity: 1;
background-color: rgb(99 102 241 / var(--tw-bg-opacity));
}

.bg-indigo-600 {
--tw-bg-opacity: 1;
background-color: rgb(79 70 229 / var(--tw-bg-opacity));
Expand All @@ -839,10 +834,6 @@ select {
background-color: rgb(255 255 255 / .05);
}

.p-1 {
padding: 0.25rem;
}

.px-3 {
padding-left: 0.75rem;
padding-right: 0.75rem;
Expand Down Expand Up @@ -873,10 +864,6 @@ select {
padding-bottom: 3rem;
}

.pr-1 {
padding-right: 0.25rem;
}

.text-center {
text-align: center;
}
Expand Down
308 changes: 308 additions & 0 deletions priv/static/nav.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,308 @@
:root {
--background: #9c88ff;
--navbar-width: 256px;
--navbar-width-min: 80px;
--navbar-dark-primary: #18283b;
--navbar-dark-secondary: #2c3e50;
--navbar-light-primary: #f5f6fa;
--navbar-light-secondary: #8392a5;
}

#nav-toggle:checked ~ #nav-header {
width: calc(var(--navbar-width-min) - 16px);
}

#nav-toggle:checked ~ #nav-content,
#nav-toggle:checked ~ #nav-footer {
width: var(--navbar-width-min);
}

#nav-toggle:checked ~ #nav-header #nav-title {
opacity: 0;
pointer-events: none;
transition: opacity .1s;
}

#nav-toggle:checked ~ #nav-header label[for="nav-toggle"] {
left: calc(50% - 8px);
transform: translate(-50%);
}

#nav-toggle:checked ~ #nav-header #nav-toggle-burger {
background: var(--navbar-light-primary);
}

#nav-toggle:checked ~ #nav-header #nav-toggle-burger:before,
#nav-toggle:checked ~ #nav-header #nav-toggle-burger:after {
width: 16px;
background: var(--navbar-light-secondary);
transform: translate(0, 0) rotate(0deg);
}

#nav-toggle:checked ~ #nav-content .nav-button button {
opacity: 0;
transition: opacity .1s;
}

#nav-toggle:checked ~ #nav-content .nav-button .fas {
min-width: calc(100% - 16px);
}

#nav-toggle:checked ~ #nav-footer #nav-footer-avatar {
margin-left: 0;
left: 50%;
transform: translate(-50%);
}

#nav-toggle:checked ~ #nav-footer #nav-footer-titlebox,
#nav-toggle:checked ~ #nav-footer label[for="nav-footer-toggle"] {
opacity: 0;
transition: opacity .1s;
pointer-events: none;
}

#nav-bar {
z-index: 5;
position: absolute;
left: 1vw;
top: 1vw;
height: calc(100% - 2vw);
background: var(--navbar-dark-primary);
border-radius: 16px;
display: flex;
flex-direction: column;
color: var(--navbar-light-primary);
font-family: Verdana, Geneva, Tahoma, sans-serif;
overflow: hidden;
user-select: none;
}

#nav-bar hr {
margin: 0;
position: relative;
left: 16px;
width: calc(100% - 32px);
border: none;
border-top: solid 1px var(--navbar-dark-secondary);
}

#nav-bar a {
color: inherit;
text-decoration: inherit;
}

#nav-bar input[type="checkbox"] {
display: none;
}

#nav-header {
position: relative;
width: var(--navbar-width);
left: 16px;
width: calc(var(--navbar-width) - 16px);
min-height: 80px;
background: var(--navbar-dark-primary);
border-radius: 16px;
z-index: 2;
display: flex;
align-items: center;
transition: width .2s;
}

#nav-header hr {
position: absolute;
bottom: 0;
}

#nav-title {
font-size: 1rem;
transition: opacity 1s;
}

label[for="nav-toggle"] {
position: absolute;
right: 0;
width: 3rem;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}

#nav-toggle-burger {
position: relative;
width: 16px;
height: 2px;
background: var(--navbar-dark-primary);
border-radius: 99px;
transition: background .2s;
}

#nav-toggle-burger:before,
#nav-toggle-burger:after {
content: '';
position: absolute;
top: -6px;
width: 10px;
height: 2px;
background: var(--navbar-light-primary);
border-radius: 99px;
transform: translate(2px, 8px) rotate(30deg);
transition: .2s;
}

#nav-toggle-burger:after {
top: 6px;
transform: translate(2px, -8px) rotate(-30deg);
}

#nav-content {
margin: -16px 0;
padding: 16px 0;
position: relative;
flex: 1;
width: var(--navbar-width);
background: var(--navbar-dark-primary);
box-shadow: 0 0 0 16px var(--navbar-dark-primary);
direction: rtl;
overflow-x: hidden;
transition: width .2s;
}

#nav-content::-webkit-scrollbar {
width: 8px;
height: 8px;
}

#nav-content::-webkit-scrollbar-thumb {
border-radius: 99px;
background-color: #D62929;
}

#nav-content::-webkit-scrollbar-button {
height: 16px;
}

.nav-button {
position: relative;
margin-left: 16px;
height: 54px;
display: flex;
align-items: center;
color: var(--navbar-light-secondary);
direction: ltr;
cursor: pointer;
z-index: 1;
transition: color .2s;
}

.nav-button button {
transition: opacity 1s;
}

.nav-button .fas {
transition: min-width .2s;
}

.nav-button:hover {
color: var(--background);
}

#nav-bar .fas {
min-width: 3rem;
text-align: center;
}

#nav-footer {
position: relative;
width: var(--navbar-width);
height: 54px;
background: var(--navbar-dark-secondary);
border-radius: 16px;
display: flex;
flex-direction: column;
z-index: 2;
transition: width .2s, height .2s;
}

#nav-footer-heading {
position: relative;
width: 100%;
height: 54px;
display: flex;
align-items: center;
}

#nav-footer-avatar {
position: relative;
margin: 11px 0 11px 16px;
left: 0;
width: 32px;
height: 32px;
border-radius: 50%;
overflow: hidden;
transform: translate(0);
transition: .2s;
}

#nav-footer-avatar img {
height: 100%;
}

#nav-footer-titlebox {
position: relative;
margin-left: 16px;
width: 10px;
display: flex;
flex-direction: column;
transition: opacity 1s;
}

#nav-footer-subtitle {
color: var(--navbar-light-secondary);
font-size: .6rem;
}

#nav-toggle:not(:checked) ~ #nav-footer-toggle:checked + #nav-footer {
height: 30%;
min-height: 54px;

label[for="nav-footer-toggle"] {
transform: rotate(180deg);
}
}

label[for="nav-footer-toggle"] {
position: absolute;
right: 0;
width: 3rem;
height: 100%;
display: flex;
align-items: center;
cursor: pointer;
transition: transform .2s, opacity .2s;
}

#nav-footer-content {
margin: 0 16px 16px 16px;
border-top: solid 1px var(--navbar-light-secondary);
padding: 16px 0;
color: var(--navbar-light-secondary);
font-size: .8rem;
overflow: auto;

&::-webkit-scrollbar {
width: 8px;
height: 8px;
}

&::-webkit-scrollbar-thumb {
border-radius: 99px;
background-color: #D62929;
}
}

.nav-bar-padding-space {
padding-left: var(--navbar-width-min);
}
Loading

0 comments on commit 9f02d35

Please sign in to comment.