1
0
Fork 0

Adapt layout/style of fairydust.reisen and Forgejo colors for this website

This commit is contained in:
Luca 2023-01-13 13:54:40 +01:00
parent 67db86782c
commit 7e8aa4b2b7
8 changed files with 175 additions and 41 deletions

9
assets/_animations.scss Normal file
View File

@ -0,0 +1,9 @@
@keyframes rainbow {
0% { color: #ff0000; }
16.66% { color: #ff8000; }
33.33% { color: #ffff00; }
50% { color: #00ff00; }
66.66% { color: #0000ff; }
83.33% { color: #8000ff; }
100% { color: #ff0000; }
}

2
assets/_breakpoints.scss Normal file
View File

@ -0,0 +1,2 @@
$large: 1000px;
$small: 800px;

4
assets/_colors.scss Normal file
View File

@ -0,0 +1,4 @@
$color-background: #10161c;
$color-burger: #ddd;
$color-link: #fb923c;
$color-text: #c0cfe0;

View File

@ -1,32 +0,0 @@
h1 {
width: 100%;
text-align: center;
font-size: 96px;
line-height: 1;
margin: calc(50vh - 48px) 0 calc(50vh - 48px) 0;
color: #ff0000;
animation: rainbow 3s linear 0s infinite;
}
footer {
text-align: center;
}
a, a:link, a:visited {
color: #444;
text-decoration: none;
}
a:hover {
color: #888;
}
@keyframes rainbow {
0% { color: #ff0000; }
16.66% { color: #ff8000; }
33.33% { color: #ffff00; }
50% { color: #00ff00; }
66.66% { color: #0000ff; }
83.33% { color: #8000ff; }
100% { color: #ff0000; }
}

133
assets/style.scss Normal file
View File

@ -0,0 +1,133 @@
@import 'animations';
@import 'breakpoints';
@import 'colors';
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background: $color-background;
color: $color-text;
display: flex;
flex-direction: column;
font-family: "Noto Sans", sans-serif;
margin: 0 auto;
max-width: $large;
min-height: 100vh;
& > main {
flex-grow: 1;
}
}
header {
align-items: center;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 1rem;
padding: 0 1rem;
& > .header-title {
font-weight: bold;
}
& > .nav-burger {
margin-right: 0.5rem;
}
}
main {
padding: 1rem;
}
nav {
display: flex;
flex-direction: column;
&.nav-toggleable {
flex-basis: 100%;
max-height: 0;
overflow-y: hidden;
transition: max-height 0.5s;
.nav-toggle:checked ~ & {
max-height: calc(var(--num-elements) * 2em);
}
}
a, span {
line-height: 1.5em;
margin: 0.5em 0 0 0;
}
@media screen and (min-width: $small) {
flex-direction: row;
&.nav-toggleable {
flex-basis: auto;
max-height: max-content;
}
a, span {
margin: 0 0 0 1.2em;
}
}
}
a {
color: $color-link;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
.hello-world {
animation: rainbow 3s linear 0s infinite;
font-family: "Noto Sans Mono", monospace;
font-size: 96px;
line-height: 1.15;
text-align: center;
}
.nav-burger {
cursor: pointer;
display: flex;
flex-direction: column;
height: 1rem;
justify-content: space-between;
width: 1.2rem;
div {
background: $color-burger;
height: 2px;
transition: background 0.5s, transform 0.5s;
}
.nav-toggle:checked ~ & div {
background: transparent;
&:first-child {
background: $color-burger;
transform: translateY(0.5rem) translateY(-1px) rotate(45deg) scaleX(141%);
}
&:last-child {
background: $color-burger;
transform: translateY(-0.5rem) translateY(1px) rotate(-45deg) scaleX(141%);
}
}
@media screen and (min-width: $small) {
display: none;
}
}
.nav-toggle {
display: none;
}

3
content/_index.md Normal file
View File

@ -0,0 +1,3 @@
---
title: ''
---

View File

@ -1,17 +1,31 @@
<!DOCTYPE html>
<html>
<html lang="{{ .Site.LanguageCode }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>{{ block "title" . }}
{{ .Site.Title }}
{{ end }}</title>
<title>{{ block "title" . }}{{ with .Title }}{{ . }} &ndash; {{ end }}{{ .Site.Title }}{{ end }}</title>
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
{{ $style := resources.Get "style.css" | minify }}
<link rel="stylesheet" href="{{ $style.Permalink }}">
{{ $style := resources.Get "style.scss" | resources.ToCSS (dict "outputStyle" "compressed") }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
</head>
<body>
{{ block "main" . }}
{{ end }}
<header>
<span class="header-title">{{ .Site.Title }}</span>
<input class="nav-toggle" id="toggleMainNav" type="checkbox">
<label class="nav-burger" for="toggleMainNav">
<div></div>
<div></div>
<div></div>
</label>
<nav class="nav-toggleable" style="--num-elements: {{ len .Site.Menus.main }}">
{{ range .Site.Menus.main }}
<a href="{{ .URL }}"{{ if hasPrefix .URL "https://" }} target="_blank"{{ end }}>{{ .Name }}</a>
{{ end }}
</nav>
</header>
<main>
{{ block "main" . }}
{{ end }}
</main>
</body>
</html>

View File

@ -1,3 +1,4 @@
{{ define "main" }}
<h1>Hallo Welt</h1>
<h1 class="hello-world">Hello World</h1>
{{ .Content }}
{{ end }}