mirror of
https://codeberg.org/vlw/victorwesterlund.com.git
synced 2025-09-14 03:23:41 +02:00
403 lines
No EOL
7.7 KiB
CSS
403 lines
No EOL
7.7 KiB
CSS
/* Copyright © Victor Westerlund - No libraries! 😲 */
|
|
|
|
:root {
|
|
/* Component colors */
|
|
--palette-background: 255,255,255;
|
|
--palette-inverted: 0,0,0;
|
|
--palette-contrast: 33,33,33;
|
|
--palette-accent: 22,183,255;
|
|
|
|
/* Compiled colors */
|
|
--swatch-background: rgb(var(--palette-background));
|
|
--swatch-inverted: rgb(var(--palette-inverted));
|
|
--swatch-contrast: rgb(var(--palette-contrast));
|
|
--swatch-accent: rgb(var(--palette-accent));
|
|
|
|
/* Default styles */
|
|
--padding: 20px;
|
|
--border-radius: 10px;
|
|
--header-height: 100px;
|
|
--transition: 300ms;
|
|
}
|
|
|
|
.dark {
|
|
--palette-background: 33,33,33;
|
|
--palette-inverted: 255,255,255;
|
|
--palette-contrast: 255,255,255;
|
|
--palette-accent: 255,255,255;
|
|
|
|
--swatch-background: rgb(var(--palette-background));
|
|
--swatch-inverted: rgb(var(--palette-inverted));
|
|
--swatch-contrast: rgb(var(--palette-contrast));
|
|
--swatch-accent: rgb(var(--palette-accent));
|
|
}
|
|
|
|
.wide {
|
|
display: none; /* Hide wide-screen elements */
|
|
}
|
|
|
|
@font-face {
|
|
font-family: "Roboto Mono";
|
|
font-weight: 400;
|
|
src: local("Roboto Mono Regular"),
|
|
local("RobotoMono-Regular"),
|
|
url("../fonts/RobotoMono-Regular.woff2"),
|
|
url("../fonts/RobotoMono-Regular.ttf");
|
|
}
|
|
|
|
@font-face {
|
|
font-family: "Roboto Mono";
|
|
font-weight: 700;
|
|
src: local("Roboto Mono Bold"),
|
|
local("RobotoMono-Bold"),
|
|
url("../fonts/RobotoMono-Bold.woff2"),
|
|
url("../fonts/RobotoMono-Bold.ttf");
|
|
}
|
|
|
|
/* -- Cornerstones -- */
|
|
|
|
* {
|
|
margin: 0;
|
|
font-family: "Roboto Mono","Arial",sans-serif;
|
|
color: var(--swatch-contrast);
|
|
}
|
|
|
|
*::selection {
|
|
background-color: var(--swatch-highlight);
|
|
color: var(--swatch-accent);
|
|
}
|
|
|
|
a,
|
|
picture {
|
|
text-decoration: none;
|
|
display: contents;
|
|
}
|
|
|
|
html,
|
|
body {
|
|
width: 100%;
|
|
height: 100%;
|
|
overflow: hidden;
|
|
}
|
|
|
|
main {
|
|
width: 200vw;
|
|
height: 100%;
|
|
overflow: hidden;
|
|
display: flex;
|
|
}
|
|
|
|
body.menuActive {
|
|
background-color: var(--swatch-contrast);
|
|
}
|
|
|
|
body.dark.menuActive {
|
|
background-color: black;
|
|
}
|
|
|
|
body.menuActive main {
|
|
transform: translateX(-100vw);
|
|
}
|
|
|
|
/* ---- */
|
|
|
|
.screen {
|
|
--background-pattern:
|
|
linear-gradient(90deg, var(--swatch-background) calc(var(--padding) + 1px), transparent 1%) center,
|
|
linear-gradient(var(--swatch-background) calc(var(--padding) + 1px), transparent 1%) center, var(--swatch-accent);
|
|
--background-pattern-size: calc(var(--padding) + 2px) calc(var(--padding) + 2px);
|
|
|
|
width: 100vw;
|
|
background-color: var(--swatch-background);
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
body.dark .screen.dark {
|
|
background-color: black;
|
|
}
|
|
|
|
.screen .inner {
|
|
display: contents;
|
|
}
|
|
|
|
.screen .content {
|
|
position: relative;
|
|
box-sizing: border-box;
|
|
padding: calc(var(--padding) * 1.5);
|
|
padding-top: 0;
|
|
flex-grow: 1;
|
|
}
|
|
|
|
/* -- Positioning -- */
|
|
|
|
.center {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
|
|
/* ---- */
|
|
|
|
.logo {
|
|
--size: 1em;
|
|
--skew: calc(var(--size) / 1.7);
|
|
|
|
width: 0;
|
|
height: 0;
|
|
border: var(--skew) solid transparent;
|
|
border-top: var(--size) solid var(--swatch-accent);
|
|
}
|
|
|
|
.logo::after {
|
|
content: "";
|
|
border: var(--skew) solid transparent;
|
|
border-top: var(--size) solid rgba(var(--palette-accent),.3);
|
|
}
|
|
|
|
/* ---- */
|
|
|
|
.button {
|
|
text-align: center;
|
|
padding: 25px;
|
|
border-radius: var(--border-radius);
|
|
font-size: clamp(16px,5vw,22px);
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
gap: var(--padding);
|
|
}
|
|
|
|
.button.solid {
|
|
background-color: var(--swatch-contrast);
|
|
color: var(--swatch-background);
|
|
fill: var(--swatch-background);
|
|
}
|
|
|
|
.button.phantom {
|
|
background-color: rgba(var(--palette-inverted),.05);
|
|
color: var(--swatch-contrast);
|
|
fill: var(--swatch-contrast);
|
|
}
|
|
|
|
.button svg {
|
|
pointer-events: none;
|
|
fill: inherit;
|
|
transform: scale(1.2);
|
|
}
|
|
|
|
.button p {
|
|
pointer-events: none;
|
|
font-size: inherit;
|
|
color: inherit;
|
|
}
|
|
|
|
.button.loading p {
|
|
opacity: 0;
|
|
}
|
|
|
|
.button.loading::after {
|
|
position: absolute;
|
|
content: "loading...";
|
|
opacity: 1;
|
|
}
|
|
|
|
/* -- Screens -- */
|
|
|
|
header {
|
|
--size: var(--header-height,100px);
|
|
box-sizing: border-box;
|
|
padding: var(--padding);
|
|
height: var(--size);
|
|
display: flex;
|
|
align-items: center;
|
|
font-weight: bold;
|
|
}
|
|
|
|
header > *:nth-child(2) {
|
|
margin-left: 10px;
|
|
}
|
|
|
|
header > *:nth-child(n+3) {
|
|
margin-left: var(--padding);
|
|
}
|
|
|
|
header .hamburger {
|
|
width: calc(var(--size) - (var(--padding) * 2));
|
|
height: calc(var(--size) - (var(--padding) * 2));
|
|
box-sizing: border-box;
|
|
flex-shrink: 0;
|
|
padding: 15px;
|
|
}
|
|
|
|
header .hamburger div {
|
|
width: 100%;
|
|
height: 2px;
|
|
background: var(--swatch-contrast);
|
|
box-shadow: 0 -10px 0 0 var(--swatch-contrast), 0 10px 0 0 var(--swatch-contrast);
|
|
}
|
|
|
|
header .hamburger svg {
|
|
fill: none;
|
|
stroke: var(--swatch-contrast);
|
|
stroke-linecap: round;
|
|
stroke-width: 2;
|
|
}
|
|
|
|
header .spacer {
|
|
width: 1px;
|
|
height: 80%;
|
|
background-color: rgba(var(--palette-contrast),.2);
|
|
}
|
|
|
|
.dark header .spacer {
|
|
background-color: black;
|
|
}
|
|
|
|
body.dark .dark header .spacer {
|
|
background-color: rgba(var(--palette-contrast),.2);
|
|
}
|
|
|
|
header .logo {
|
|
--size: 25px;
|
|
margin-top: calc(var(--size) / 2);
|
|
margin-right: calc(var(--size) / 2);
|
|
}
|
|
|
|
/* -- Screen > Landingpage -- */
|
|
|
|
.screen.landingpage {
|
|
background: var(--background-pattern);
|
|
background-size: var(--background-pattern-size);
|
|
}
|
|
|
|
.screen.landingpage .content {
|
|
padding-bottom: 0;
|
|
}
|
|
|
|
.screen.landingpage img {
|
|
position: relative;
|
|
width: clamp(100px,80vw,40vh);
|
|
align-self: flex-end;
|
|
z-index: 1;
|
|
}
|
|
|
|
.screen.landingpage .pattern {
|
|
position: absolute;
|
|
top: var(--header-height);
|
|
width: 100vw;
|
|
height: calc(100% - var(--header-height));
|
|
overflow: hidden;
|
|
}
|
|
|
|
.screen.landingpage .pattern div {
|
|
--size: clamp(100px,100vw,35vh);
|
|
position: relative;
|
|
top: calc((var(--size) - var(--header-height)) * -1);
|
|
width: 0;
|
|
height: 0;
|
|
border: solid var(--size) transparent;
|
|
border-bottom: solid calc(var(--size) * 2) rgba(var(--palette-accent),.1);
|
|
transform-origin: 50% 75%;
|
|
transform: rotate(20deg);
|
|
}
|
|
|
|
/* -- Screen > Menu -- */
|
|
|
|
.screen.menu .content {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 20px;
|
|
}
|
|
|
|
.screen.menu .button {
|
|
width: calc(100% - (var(--padding) * 2));
|
|
max-width: 400px;
|
|
flex: 0;
|
|
}
|
|
|
|
.screen.menu .button[data-action="openContactCard"] {
|
|
margin-top: auto;
|
|
}
|
|
|
|
/* -- Media queries -- */
|
|
|
|
/* Wide-screen */
|
|
@media (min-aspect-ratio: 14/9) {
|
|
/* -- Cornerstones -- */
|
|
|
|
header {
|
|
display: none;
|
|
}
|
|
|
|
main {
|
|
width: 100vw;
|
|
flex-direction: row-reverse;
|
|
}
|
|
|
|
/* -- Cornerstones > State overrides -- */
|
|
|
|
body.menuActive {
|
|
background-color: inherit;
|
|
}
|
|
|
|
body.menuActive main {
|
|
transform: unset;
|
|
}
|
|
|
|
/* -- Screens -- */
|
|
|
|
.screen {
|
|
width: 50vw;
|
|
flex-direction: row;
|
|
}
|
|
|
|
body.dark .screen {
|
|
--swatch-background: black;
|
|
}
|
|
|
|
/* -- Screens > Menu -- */
|
|
|
|
.screen.menu .content {
|
|
padding-top: calc(var(--padding) * 1.5);
|
|
}
|
|
}
|
|
|
|
/* Narrow display */
|
|
@media (max-width: 300px) {
|
|
.button svg:not(.hidden) ~ p,
|
|
header .logo {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
/* Super-narrow display */
|
|
@media (max-width: 230px) {
|
|
header {
|
|
justify-content: center;
|
|
}
|
|
|
|
header .spacer,
|
|
header p {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
/* -- Media queries > Media features -- */
|
|
|
|
@media (pointer: fine) {
|
|
.button {
|
|
cursor: pointer;
|
|
}
|
|
}
|
|
|
|
@media (any-hover: hover) {
|
|
.button {
|
|
transition: var(--transition) background-color;
|
|
}
|
|
|
|
.button.phantom:hover {
|
|
background-color: rgba(var(--palette-inverted),.2);
|
|
}
|
|
} |