Files
blog/sass/_nav.scss
daudix 018fcf813c Get rid of overcomplicated transition properties
Not a single time this been useful, quite the opposite; it was very
annoying
2024-06-15 02:18:13 +03:00

141 lines
3.1 KiB
SCSS

#site-nav {
-webkit-backdrop-filter: var(--blur);
position: sticky;
top: 1rem;
z-index: 999;
backdrop-filter: var(--blur);
margin: 1rem auto;
box-shadow: var(--edge-highlight), 0px 12px 24px -16px rgba(0, 0, 0, 0.5);
border-radius: 26px;
background-color: var(--nav-bg);
max-width: min(var(--container-width), 90%);
nav {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
padding: 0.5rem;
ul {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 0.25rem;
margin: 0;
padding: 0;
}
li {
display: inline-flex;
list-style: none;
}
a {
position: relative;
transition: var(--transition);
border-radius: 999px;
padding: 0.325rem 0.75rem;
color: var(--fg-muted-4);
text-decoration: none;
&:hover {
box-shadow: var(--edge-highlight);
background-color: var(--fg-muted-1);
color: var(--primary-color);
text-decoration: none;
}
&:active {
transform: scale(var(--active));
}
&.active {
&::before {
display: block;
position: absolute;
top: -0.5rem;
right: 1.5rem;
left: 1.5rem;
transition: var(--transition);
border-bottom: 0.25rem solid var(--fg-muted-2);
border-radius: 0 0 0.25rem 0.25rem;
content: "";
}
&:hover::before {
right: 1rem;
left: 1rem;
border-bottom: 0.25rem solid var(--primary-color);
}
&:active::before {
border-radius: 0.25rem;
}
}
}
#main-content {
position: absolute;
transform: translateY(-100%);
opacity: 0;
z-index: 999;
transition: var(--transition);
background: var(--bg-color), var(--primary-color);
pointer-events: none;
&:focus {
transform: translateY(0);
opacity: 1;
}
}
#home {
position: relative;
margin-right: 0.625rem;
&::after {
position: absolute;
top: 0;
right: -0.5rem;
background-color: var(--fg-muted-2);
width: 1px;
height: 110%;
content: "";
}
a {
color: var(--fg-muted-5);
font-weight: 800;
&:hover {
color: var(--primary-color);
}
}
}
#feed a {
padding: 0.325rem 0.625rem;
&:hover .icon {
background-color: var(--primary-color);
}
.icon {
$icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath d='M1.988 1.988V3c.008.547.453.984 1 .988.004-.004.008-.004.012-.004v.028A8.977 8.977 0 0 1 11.988 13a.991.991 0 0 0 1 .984h1V13h-.004c0-.004 0-.004.004-.008C13.984 7.02 9.184 2.148 3.242 2.02A1.004 1.004 0 0 0 3 1.988v-.004zm0 4V7c.008.547.453.984 1 .988.004-.004.008-.004.012-.004V8a4.985 4.985 0 0 1 4.996 4.844 1.002 1.002 0 0 0 .988 1.145c.008-.005.012-.005.016-.005v.004h.984V13H10c0-3.793-3.047-6.898-6.82-6.992 0-.004-.004-.004-.004-.004A.892.892 0 0 0 3 5.988v-.004zm2 4a1.999 1.999 0 1 0-.002 3.998 1.999 1.999 0 0 0 .002-3.998m0 0'%3E%3C/path%3E%3C/svg%3E");
-webkit-mask-image: $icon;
vertical-align: -0.125em;
mask-image: $icon;
transition: var(--transition);
background-color: var(--fg-muted-4);
width: 1rem;
height: 1rem;
}
span {
display: none;
}
}
}
}