(scss) refactorize

This commit is contained in:
Vri 🌈 2023-01-07 14:06:55 +01:00
parent 4eb572d061
commit ac89981501
Signed by: vrifox
GPG key ID: D40098E5B60B2197
2 changed files with 157 additions and 182 deletions

View file

@ -7,10 +7,7 @@
--hill: rgb(50, 235, 150); --hill: rgb(50, 235, 150);
--hillshade: rgb(40, 160, 100); --hillshade: rgb(40, 160, 100);
--image-decorative-blend: initial; --image-decorative-blend: initial;
}
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
:root {
--background: rgb(0, 45, 60); --background: rgb(0, 45, 60);
--background-header: rgb(0, 70, 100); --background-header: rgb(0, 70, 100);
--background-nav: rgb(0, 62.5, 80); --background-nav: rgb(0, 62.5, 80);
@ -20,27 +17,15 @@
--hillshade: rgb(0, 45, 60); --hillshade: rgb(0, 45, 60);
--image-decorative-blend: luminosity; --image-decorative-blend: luminosity;
} }
} }
* { * {
box-sizing: border-box; box-sizing: border-box;
scrollbar-color: var(--sphere) var(--background-header); scrollbar-color: var(--sphere) var(--background-header);
} }
html { html {
scroll-behavior: smooth; scroll-behavior: smooth;
}
a {
color: var(--text);
text-underline-offset: 3px;
transition: text-decoration-color .15s ease;
}
a:hover {
text-decoration-color: var(--sphere);
}
body { body {
background-color: var(--background); background-color: var(--background);
color: var(--text); color: var(--text);
@ -49,8 +34,17 @@
line-height: 1.8; line-height: 1.8;
margin: 0; margin: 0;
} }
a {
color: var(--text);
text-underline-offset: 3px;
transition: text-decoration-color .15s ease;
&:hover {
text-decoration-color: var(--sphere);
}
}
}
header { header {
background-blend-mode: var(--image-decorative-blend); background-blend-mode: var(--image-decorative-blend);
background-color: var(--background-header); background-color: var(--background-header);
background-image: url(home-header-optimized.svg); background-image: url(home-header-optimized.svg);
@ -63,21 +57,17 @@
overflow: hidden; overflow: hidden;
position: relative; position: relative;
text-align: center; text-align: center;
} h1 {
header h1 {
font-size: 3.6em; font-size: 3.6em;
line-height: .9em; line-height: .9em;
margin: 0; margin: 0;
z-index: 10; z-index: 10;
} }
p {
header p {
margin: 0; margin: 0;
z-index: 10; z-index: 10;
} }
#sphere {
header #sphere {
background: var(--sphere); background: var(--sphere);
border-radius: 100%; border-radius: 100%;
display: none; display: none;
@ -87,8 +77,7 @@
top: 3vh; top: 3vh;
width: 10vh; width: 10vh;
} }
#hill {
header #hill {
background: var(--hill); background: var(--hill);
border-radius: 40px; border-radius: 40px;
bottom: 0; bottom: 0;
@ -99,8 +88,7 @@
transform: rotate(45deg) translate(50%, 50%); transform: rotate(45deg) translate(50%, 50%);
width: 40vh; width: 40vh;
} }
#hillshade {
header #hillshade {
background: var(--hillshade); background: var(--hillshade);
border-radius: 80px; border-radius: 80px;
bottom: -5vh; bottom: -5vh;
@ -111,14 +99,14 @@
transform: rotate(45deg) translate(50%, 50%); transform: rotate(45deg) translate(50%, 50%);
width: 40vh; width: 40vh;
} }
#header-background { #header-background {
height: 100%; height: 100%;
position: absolute; position: absolute;
align-self: center; align-self: center;
} }
}
body > nav { #main-nav {
align-items: center; align-items: center;
background: var(--background-nav); background: var(--background-nav);
border-radius: 10px; border-radius: 10px;
@ -126,23 +114,23 @@
gap: 20px; gap: 20px;
height: 60px; height: 60px;
justify-content: center; justify-content: center;
margin: 0px 20px -30px 20px; margin: 0px auto;
position: relative; position: relative;
top: -30px; top: -30px;
} }
.width-1200 { .width-1200 {
margin: 0 auto; margin: 0 auto;
max-width: 1200px; max-width: 1200px;
} }
main section { main {
section {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
grid-gap: 20px; grid-gap: 20px;
} }
article {
main article {
background: var(--background-header); background: var(--background-header);
border-radius: 10px; border-radius: 10px;
box-shadow: rgba(0, 0, 0, 0.1) 10px 10px 0px 0px; box-shadow: rgba(0, 0, 0, 0.1) 10px 10px 0px 0px;
@ -150,14 +138,11 @@
flex-direction: column; flex-direction: column;
padding: 40px; padding: 40px;
transition: box-shadow .3s ease, transform .3s ease; transition: box-shadow .3s ease, transform .3s ease;
} &:hover {
main article:hover {
box-shadow: rgba(0, 0, 0, 0.1) 10px 15px 0px 0px; box-shadow: rgba(0, 0, 0, 0.1) 10px 15px 0px 0px;
transform: translate(0, -5px); transform: translate(0, -5px);
} }
a {
main article a {
background: var(--background); background: var(--background);
border-radius: 5px; border-radius: 5px;
box-shadow: rgba(0, 0, 0, 0.1) 5px 5px 0px 0px; box-shadow: rgba(0, 0, 0, 0.1) 5px 5px 0px 0px;
@ -167,67 +152,57 @@
padding: 10px 14px; padding: 10px 14px;
text-decoration: none; text-decoration: none;
transition: box-shadow .15s ease, transform .15s ease; transition: box-shadow .15s ease, transform .15s ease;
} &:hover {
main article a:hover {
box-shadow: rgba(0, 0, 0, 0.1) 2.5px 2.5px 0px 0px; box-shadow: rgba(0, 0, 0, 0.1) 2.5px 2.5px 0px 0px;
transform: translate(2.5px, 2.5px); transform: translate(2.5px, 2.5px);
} }
&:active {
main article a:active {
box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 0px 0px; box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 0px 0px;
transform: translate(5px, 5px); transform: translate(5px, 5px);
} }
}
main article h2 { h2 {
font-size: 1.8em; font-size: 1.8em;
line-height: normal; line-height: normal;
margin: 0; margin: 0;
} }
p {
main article p {
margin: 20px 0; margin: 20px 0;
} }
nav {
main article nav {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 10px; gap: 10px;
hyphens: none; hyphens: none;
margin-top: auto; margin-top: auto;
} }
}
}
footer {
footer {
margin-top: 20px !important; margin-top: 20px !important;
text-align: center; text-align: center;
} }
/*footer p, footer a { /*footer p, footer a {
text-align: center; text-align: center;
color: rgb(80, 150, 190); color: rgb(80, 150, 190);
}*/ }*/
@media (max-width: 1000px) { @media (max-width: 1000px) {
header hill { header hill {
transform: rotate(45deg) translate(40%, 70%); transform: rotate(45deg) translate(40%, 70%);
} }
header hillshade { header hillshade {
transform: rotate(45deg) translate(20%, 80%); transform: rotate(45deg) translate(20%, 80%);
} }
section#dienste { }
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 600px) {
section#dienste {
grid-template-columns: repeat(1, 1fr);
}
}
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
header #sphere { header #sphere {
left: unset; left: unset;
right: 30vw; right: 30vw;
} }
} }

View file

@ -1,3 +1,3 @@
<nav class="width-1200"> <nav id="main-nav" class="width-1200">
<a href="#dienste">Dienste</a> <a href="#dienste">Dienste</a>
</nav> </nav>