website/assets/scss/partials/sidebar.scss
vrifox 41be8c98a5
All checks were successful
ci/woodpecker/push/hugo-build Pipeline was successful
improve accessibility
2023-05-18 13:17:48 +02:00

313 lines
No EOL
5.5 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;
@media (max-width: 1140px) {
overflow: unset;
border: 0;
position: unset;
height: 0;
padding: 0;
margin: 0;
background-color: transparent;
}
a {
&.hint-text {
position: relative;
&::before {
content: attr(aria-label);
left: calc(100% + 0.5rem);
position: absolute;
top: 50%;
transform: translateY(-50%);
background-color: var(--sidebar-accent-3);
color: var(--text-accent-900);
padding: 0.2rem 0.5rem;
border-radius: 0.5rem;
pointer-events: none;
opacity: 0%;
z-index: 201;
@media (prefers-reduced-motion: no-preference) {
transition: opacity 0.3s ease-in-out;
}
}
&::after {
content: "";
transform: translate(-50%, -50%) rotate(45deg);
transform-origin: center;
background-color: var(--sidebar-accent-3);
top: 50%;
height: 1.2rem;
width: 1.2rem;
z-index: 200;
border-radius: 0 0 0 0.5rem;
position: absolute;
left: calc(100% + 0.5rem);
pointer-events: none;
opacity: 0%;
@media (prefers-reduced-motion: no-preference) {
transition: opacity 0.3s ease-in-out;
}
}
&:hover {
&::before, &::after {
opacity: 100%;
}
}
}
}
#avatar-wrapper {
text-align: center;
user-select: none;
padding: inherit;
#avatar {
border-radius: 300% 500% / 500% 300%;
max-width: 64px;
@media (max-width: 1140px) {
position: absolute;
top: 1rem;
left: 1rem;
}
@media (prefers-reduced-motion: no-preference) {
transition: 0.4s border-radius ease-in-out;
}
&:hover {
border-radius: 500% 300% / 300% 500%;
}
}
}
#sidebar-menu {
user-select: none;
text-align: center;
@media (max-width: 1140px) {
position: fixed;
width: 100vw;
background-color: var(--sidebar-background);
height: 5rem;
left: 0;
bottom: 0;
padding: 0.4rem;
border: 1px solid var(--sidebar-border);
border-bottom: 0;
}
ul {
list-style: none;
padding: 0;
margin: 0;
@media (max-width: 1140px) {
display: flex;
flex-direction: row;
justify-content: center;
height: 100%;
}
}
li {
border-radius: 0.5rem;
margin: 0.5em 0;
position: relative;
letter-spacing: 0.025rem;
aspect-ratio: 1 / 1;
display: flex;
align-items: center;
justify-content: center;
@media (max-width: 1140px) {
margin: 0 0.5rem;
}
@media (prefers-reduced-motion: no-preference) {
transition: background-color 0.2s linear;
}
a {
overflow: visible;
display: flex;
align-items: center;
width: 100%;
height: 100%;
}
&::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;
border-radius: 0.5rem;
@media (max-width: 1140px) {
left: 0;
top: 100%;
}
@media (prefers-reduced-motion: no-preference) {
transition: left 0.5s ease-out, opacity 0.5s ease-out, background-color 0.2s linear, top 0.5s ease-out;
}
}
&.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: 1140px) {
top: 0;
}
}
}
&:active {
&::after {
background-color: var(--sidebar-accent-2);
}
}
}
a {
text-decoration: none;
display: flex;
place-content: center;
svg {
height: 3rem;
width: 3rem;
fill: transparent;
stroke: var(--text-accent-300);
stroke-width: 20px;
}
}
}
#social-links {
text-align: center;
@media (max-width: 1140px) {
display: none;
}
a {
display: flex;
padding: 1rem;
place-content: center;
&:hover {
.mastodon-icon {
color: hsl(251.5, 58.9%, 51.4%);
}
}
.mastodon-icon {
color: hsl(239.6, 100%, 69.4%);
}
.icon {
height: 1.25rem;
width: 1.25rem;
display: block;
@media (prefers-reduced-motion: no-preference) {
transition: color 0.2s ease-in-out;
}
}
}
}
#languages {
text-align: center;
border-radius: 0.5rem 0.5rem 1.85rem 0.5rem;
@media (max-width: 1140px) {
border-radius: 4rem;
position: absolute;
top: 1rem;
left: calc(100vw - 1em - 64px);
font-size: 1.4rem;
border-radius: 100%;
background-color: var(--sidebar-accent-1);
aspect-ratio: 1 / 1;
width: 64px;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
transition: background-color 0.2s ease-in-out;
}
&:hover {
background-color: var(--sidebar-accent-1);
@media (max-width: 1140px) {
background-color: var(--sidebar-accent-2);
}
}
&:active {
background-color: var(--sidebar-accent-2);
@media (max-width: 1140px) {
background-color: var(--sidebar-accent-3);
}
}
#language {
display: block;
text-decoration: none;
width: 100%;
height: 100%;
padding: 1rem;
pointer-events: all;
}
}
}