website/assets/scss/partials/sidebar.scss
2023-03-09 18:16:35 +01:00

172 lines
No EOL
3.3 KiB
SCSS

// -----------
// - sidebar -
// -----------
#sidebar {
background: var(--sidebar-background);
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 1em;
height: calc(100vh - 1rem);
padding: 0.25rem;
position: fixed;
top: 0;
width: 5rem;
z-index: 2;
margin: 0.5rem 0;
border-radius: 0 2rem 2rem 0;
border: 1px solid var(--sidebar-border);
border-left: 0;
overflow: hidden;
@media (max-width: 1040px) {
top: auto;
bottom: 0;
border-radius: 2rem 2rem 0 0;
flex-direction: row;
width: 100vw;
height: 5rem;
margin: 0;
overflow-y: hidden;
overflow-x: scroll;
border: 1px solid var(--sidebar-border);
border-bottom: 0;
}
header {
text-align: center;
user-select: none;
padding: inherit;
#avatar {
border-radius: 300% 500% / 500% 300%;
max-width: 64px;
transition: .4s border-radius ease-in-out;
&:hover {
border-radius: 500% 300% / 300% 500%;
}
}
}
#sidebar-menu {
user-select: none;
text-align: center;
ul {
list-style: none;
padding: 0;
margin: 0;
@media (max-width: 1040px) {
display: flex;
flex-direction: row;
height: 100%;
}
}
li {
border-radius: 0.5rem;
margin: 0.5em 0;
position: relative;
letter-spacing: .025rem;
overflow: hidden;
aspect-ratio: 1 / 1;
display: flex;
align-items: center;
justify-content: center;
transition: background-color 0.2s linear;
@media (max-width: 1040px) {
margin: 0 0.5rem;
}
a {
display: block;
padding: 0.25em 0.5em;
}
&::after {
background-color: var(--sidebar-accent-1);
bottom: 0;
content: "";
height: 100%;
position: absolute;
left: -100%;
top: 0;
width: 100%;
z-index: -1;
opacity: 1;
opacity: 0.5;
transition: left 0.5s ease-out, opacity 0.5s ease-out, background-color 0.2s linear, top 0.5s ease-out;
@media (max-width: 1040px) {
left: 0;
top: 100%;
}
}
&.active {
background-color: var(--sidebar-accent-1);
&:hover {
background-color: var(--sidebar-accent-2);
}
&:active {
background-color: var(--sidebar-accent-3);
}
}
&:hover {
&::after {
left: 0;
opacity: 1;
@media (max-width: 1040px) {
top: 0;
}
}
}
&:active {
&::after {
background-color: var(--sidebar-accent-2);
}
}
}
a {
text-decoration: none;
}
}
aside {
@media (max-width: 1040px) {
display: flex;
flex-direction: row;
align-items: center;
}
#social-links {
text-align: center;
align-items: center;
display: flex;
justify-content: center;
ul {
list-style: none;
margin: 0;
padding: 0;
}
.icon {
height: 2em;
transition: color 0.2s ease-in-out;
&.mastodon-icon {
color: hsl(239.6, 100%, 69.4%);
&:hover {
color: hsl(251.5, 58.9%, 51.4%);
}
}
}
}
#languages {
text-align: center;
transition: background-color 0.2s ease-in-out;
border-radius: 0.5rem 0.5rem 1.85rem 0.5rem;
&:hover {
background-color: var(--sidebar-accent-1);
}
&:active {
background-color: var(--sidebar-accent-2);
}
#language {
display: block;
text-decoration: none;
width: 100%;
height: 100%;
padding: 0.5rem 1rem;
pointer-events: all;
}
}
}
}