1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 14:16:20 -04:00
jarv.is/assets/sass/components/_header.scss

194 lines
4.3 KiB
SCSS

@use "../abstracts/settings";
@use "../abstracts/themes";
// Global Header Styles
header {
width: 100%;
padding: 0.7em 1.5em;
border-bottom: 1px solid;
@include themes.themed($border-color: "kinda-light");
nav {
width: 100%;
max-width: settings.$max-width;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: space-between;
a#header-logo {
display: flex;
align-items: center;
@include themes.themed($color: "medium-dark");
img#header-selfie {
width: 50px;
height: 50px;
border: 1px solid;
border-radius: 50%;
user-select: none;
@include themes.themed($border-color: "light");
}
span#header-name {
margin: 0 0.6em;
font-size: 1.25em;
font-weight: 500;
letter-spacing: -0.01em;
}
&:hover {
@include themes.themed($color: "links");
img#header-selfie {
opacity: 90%;
}
}
}
// Horizontal emoji links
ul {
list-style: none;
display: flex;
align-items: baseline;
margin: 0;
padding: 0;
li {
margin-left: 1.75em;
a {
display: inline-flex;
will-change: transform;
@include themes.themed($color: "medium-dark");
// TODO: overriding transition-property from themed() -- very hacky
transition-property: color, transform;
transition-timing-function: linear, ease-in-out;
&:hover {
transform: scale(1.1);
@include themes.themed($color: "links");
// TODO: overriding transition-property from themed() -- very hacky
transition-property: color, transform;
transition-timing-function: linear, ease-in-out;
}
span {
align-self: center;
&.header-menu-icon {
font-size: 1.3em;
vertical-align: -0.085em;
user-select: none;
}
&.header-menu-text {
font-size: 0.95em;
font-weight: 500;
letter-spacing: -0.002em;
margin-left: 0.65em;
}
}
}
// Dark mode toggle
&#header-lightbulb {
align-self: center;
button {
// native button reset
border: 0;
padding: 0;
// prepare for lightbulb symbol depending on active theme (set in components/_global)
background-color: transparent;
background-repeat: no-repeat;
background-size: 100% 100%;
// 24.33px, don't ask
height: 1.56em;
width: 1.56em;
margin-top: -0.05em;
margin-left: 1.4em;
margin-right: -0.3em; // weirdness w/ svg ratio
cursor: pointer;
}
}
// no margin on the first child to make more room on narrow windows (before responsiveness kicks in).
// last child is the dark mode toggle -- margin is set directly on it in case it's hidden (if JS is disabled).
&:first-child,
&:last-child {
margin-left: 0;
}
}
}
}
}
// Responsive
@mixin responsive() {
header {
padding: 0.5em 1.25em;
nav {
a#header-logo {
img#header-selfie {
width: 70px;
height: 70px;
}
span#header-name {
display: none;
}
&:hover {
img#header-selfie {
opacity: 100%;
}
}
}
ul {
font-size: 1.6em;
li {
margin-left: 1.15em;
a.header-menu-item {
span.header-menu-icon {
font-size: 0.9em;
}
// hide text next to emojis on mobile
span.header-menu-text {
display: none;
}
// disable hover scale effect
&:hover {
transform: none;
}
}
// Dark mode toggle
&#header-lightbulb button.dark-mode-toggle {
// TODO: figure out need for weird magic numbers here
height: 1.08em; // ~27px, don't ask
width: 1.08em;
margin-left: 1em;
margin-right: -0.2em; // weirdness w/ svg ratio
}
}
}
}
}
}