Merge branch 'main' of codeberg.org:angestoepselt/homepage into main

This commit is contained in:
Lunantic 2022-06-12 19:53:56 +02:00
commit d6c1cdec8d
9 changed files with 201 additions and 106 deletions

20
assets/main.js Normal file
View file

@ -0,0 +1,20 @@
for (const tabLinkElement of document.querySelectorAll(
'h2 + .tabs-widget > a[href]'
)) {
const titleElement = tabLinkElement.parentElement.previousElementSibling;
tabLinkElement.addEventListener('click', (event) => {
event.preventDefault();
const hash = tabLinkElement.getAttribute('href');
if (history.replaceState) {
// This is a weird hack to make sure that the :target selectors actually
// get updated:
// https://github.com/whatwg/html/issues/639#issuecomment-252716663
history.replaceState(null, '', hash);
history.pushState(null, '', hash);
history.back();
titleElement.scrollIntoView(true);
} else {
location.hash = hash;
}
});
}

View file

@ -1,104 +1,7 @@
<!doctype html>
<html lang="{{ metadata.language }}" {% if theme.coderdojo %}data-coderdojo="true"{% endif %}>
<head>
<meta charset="utf-8">
<title>{{ title or metadata.title }}</title>
<link rel="preload" href="{{ '/assets/css/base.css' | url }}" as="style">
{# We only bother with preloading the variable font here because chances are
that if a browser doesn't support variable fonts it won't support
preloading either:
https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types/preload#browser_compatibility
#}
<link rel="preload" href="{{ '/assets/fonts/Comfortaa-VariableFont_wght.ttf' | url }}" as="font" crossorigin="anonymous">
{% for name in (extraStylesheets or []) %}
<link rel="preload" href="{{ '/assets/css/' + name + '.css' | url }}" as="style">
{% endfor %}
{% block headStart %}{% endblock %}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="manifest" href="/site.webmanifest">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<meta name="description" content="{{ description or metadata.description }}">
<link rel="alternate" href="{{ metadata.feed.path | url }}" type="application/atom+xml" title="{{ metadata.title }}">
<link rel="alternate" href="{{ metadata.jsonfeed.path | url }}" type="application/json" title="{{ metadata.title }}">
<link rel="stylesheet" href="{{ '/assets/css/base.css' | url }}">
{% for name in (extraStylesheets or []) %}
<link rel="stylesheet" href="{{ '/assets/css/' + name + '.css' | url }}">
{% endfor %}
{% block headEnd %}{% endblock %}
</head>
<body>
<header class="site-header">
<a class="site-logo" href="{{ '/' | url }}">{{ metadata.title }}</a>
<details class="site-mobile-navigation">
<summary>Menü</summary>
<nav class="site-navigation">
<ul>
{% for entry in collections.topNavigation | eleventyNavigation %}
<li{% if entry.url == page.url %} class="active"{% endif %}>
<a href="{{ entry.url }}">
{{ entry.title }}
</a>
</li>
{% endfor %}
</ul>
</nav>
</details>
<nav class="site-navigation horizontal">
<ul>
{% for entry in collections.topNavigation | eleventyNavigation %}
<li{% if entry.url == page.url %} class="active"{% endif %}>
<a href="{{ entry.url }}">
{{ entry.title }}
</a>
</li>
{% endfor %}
</ul>
</nav>
</header>
<main id="content" {% if contentClass %} class="{{ contentClass }}"{% endif %}>
{% block content %}
{{ content | safe }}
{% endblock %}
</main>
<footer class="page-section footer">
<div class="page-content site-footer">
<div>
<p>
{{ metadata.author.name }}
{% for line in (metadata.author.address or []) %}
<br />
{{ line }}
{% endfor %}
</p>
<p>
{{ metadata.author.email }}
</p>
</div>
<div>
<nav class="site-navigation">
<ul>
{% for entry in collections.bottomNavigation | eleventyNavigation %}
<li{% if entry.url == page.url %} class="active"{% endif %}>
<a href="{{ entry.url }}">
{{ entry.title }}
</a>
</li>
{% endfor %}
</ul>
</nav>
</div>
</div>
</footer>
</body>
</html>
{% if site and site.id == "angestoepselt" %}
{% extends "layouts/base/angestoepselt.njk" %}
{% elseif site and site.id == "coderdojo" %}
{% extends "layouts/base/coderdojo.njk" %}
{% else %}
{% extends "layouts/base/main.njk" %}
{% endif %}

View file

@ -0,0 +1,12 @@
{% extends "layouts/base/main.njk" %}
{% block sitelogo %}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 90.55 64.6001" class="angestoepselt-logo">
<path d="M79.04 28.63h9.51"/>
<path d="M79.04 21.31h9.51"/>
<path d="M79.04 35.94h9.51"/>
<path d="M79.04 43.26h9.51"/>
<path class="plug" d="M2 40.19h6.32a1 1 0 0 1 .94 1v11.45a1.07 1.07 0 0 0 .28.73l8.07 8.93a.93.93 0 0 0 .67.3h31.19a2.38 2.38 0 0 0 1.14-.28l4.14-3.61a.86.86 0 0 1 1.1.25l1.58 3.3a.91.91 0 0 0 .71.34h11.17a.92.92 0 0 0 .82-.52l3.89-7.46a2.3 2.3 0 0 0 .28-1.12l.11-44.47a1.07 1.07 0 0 0-.2-.63l-4.18-6a.92.92 0 0 0-.75-.4h-51a.93.93 0 0 0-.67.3l-8.07 8.93a1.07 1.07 0 0 0-.28.73V23.1a1 1 0 0 1-.94 1H2m53.22 16.41a3.43 3.43 0 0 1-.86 2.27l-1.35 1.51a3.41 3.41 0 0 1-2.54 1.14h-19a3.45 3.45 0 0 1-2.54-1.1l-1.35-1.49a3.39 3.39 0 0 1-.87-2.27V23.42a3.39 3.39 0 0 1 .87-2.27l1.35-1.51a3.45 3.45 0 0 1 2.55-1.14h19a3.41 3.41 0 0 1 2.54 1.14l1.35 1.51a3.43 3.43 0 0 1 .86 2.27z" />
</svg>
<span>Angestöpselt</span>
{% endblock %}

View file

@ -0,0 +1,3 @@
{% extends "layouts/base/main.njk" %}
{% block htmltag %}data-coderdojo="true"{% block %}

View file

@ -0,0 +1,108 @@
<!doctype html>
<html lang="{{ metadata.language }}" {% block htmltag %}{% endblock %}>
<head>
<meta charset="utf-8">
<title>{{ title or metadata.title }}</title>
<link rel="preload" href="{{ '/assets/css/base.css' | url }}" as="style">
{# We only bother with preloading the variable font here because chances are
that if a browser doesn't support variable fonts it won't support
preloading either:
https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types/preload#browser_compatibility
#}
<link rel="preload" href="{{ '/assets/fonts/Comfortaa-VariableFont_wght.ttf' | url }}" as="font" crossorigin="anonymous">
{% for name in (extraStylesheets or []) %}
<link rel="preload" href="{{ '/assets/css/' + name + '.css' | url }}" as="style">
{% endfor %}
{% block headStart %}{% endblock %}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="manifest" href="/site.webmanifest">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<meta name="description" content="{{ description or metadata.description }}">
<link rel="alternate" href="{{ metadata.feed.path | url }}" type="application/atom+xml" title="{{ metadata.title }}">
<link rel="alternate" href="{{ metadata.jsonfeed.path | url }}" type="application/json" title="{{ metadata.title }}">
<link rel="stylesheet" href="{{ '/assets/css/base.css' | url }}">
{% for name in (extraStylesheets or []) %}
<link rel="stylesheet" href="{{ '/assets/css/' + name + '.css' | url }}">
{% endfor %}
{% block headEnd %}{% endblock %}
</head>
<body>
<header class="site-header">
<a class="site-logo" href="{{ '/' | url }}">
{% block sitelogo %}{{ metadata.title }}{% endblock %}
</a>
<details class="site-mobile-navigation">
<summary>Menü</summary>
<nav class="site-navigation">
<ul>
{% for entry in collections.topNavigation | eleventyNavigation %}
<li{% if entry.url == page.url %} class="active"{% endif %}>
<a href="{{ entry.url }}">
{{ entry.title }}
</a>
</li>
{% endfor %}
</ul>
</nav>
</details>
<nav class="site-navigation horizontal">
<ul>
{% for entry in collections.topNavigation | eleventyNavigation %}
<li{% if entry.url == page.url %} class="active"{% endif %}>
<a href="{{ entry.url }}">
{{ entry.title }}
</a>
</li>
{% endfor %}
</ul>
</nav>
</header>
<main id="content" {% if contentClass %} class="{{ contentClass }}"{% endif %}>
{% block content %}
{{ content | safe }}
{% endblock %}
</main>
<footer class="page-section footer">
<div class="page-content site-footer">
<div>
<p>
{{ metadata.author.name }}
{% for line in (metadata.author.address or []) %}
<br />
{{ line }}
{% endfor %}
</p>
<p>
{{ metadata.author.email }}
</p>
</div>
<div>
<nav class="site-navigation">
<ul>
{% for entry in collections.bottomNavigation | eleventyNavigation %}
<li{% if entry.url == page.url %} class="active"{% endif %}>
<a href="{{ entry.url }}">
{{ entry.title }}
</a>
</li>
{% endfor %}
</ul>
</nav>
</div>
</div>
</footer>
<script src="/assets/main.js" lang="text/javascript"></script>
</body>
</html>

View file

@ -0,0 +1,3 @@
{
"id": "angestoepselt"
}

View file

@ -57,7 +57,8 @@ h3 {
@extend %subheading;
}
p {
p,
pre {
@extend %content-gutter;
}

View file

@ -1,5 +1,6 @@
@use '../lib/colors';
@use '../lib/layout';
@use '../lib/motion';
@use '../lib/typography';
@mixin header-item {
@ -12,6 +13,48 @@
.site-logo {
margin: 0 layout.$large-gap;
text-transform: lowercase;
> .angestoepselt-logo {
height: 1em;
vertical-align: middle;
fill: none;
stroke-linecap: round;
stroke-linejoin: round;
stroke-width: 4px;
stroke: colors.$gray-900;
stroke-miterlimit: 10;
.plug {
fill: colors.$teal-500;
}
+ span {
display: inline-block;
}
}
&:hover > .angestoepselt-logo {
@keyframes angestoepselt-logo-hover {
0% {
transform: none;
}
50% {
transform: translateX(0.6rem);
}
100% {
transform: translateX(-0.6rem);
}
}
animation: angestoepselt-logo-hover motion.$prominent forwards;
+ span {
transform-origin: 100% 50%;
transition: transform #{0.5 * motion.$prominent-duration} motion.$prominent-timing #{0.5 * motion.$prominent-duration};
transform: scale(1.1);
}
}
}
// The navigation is present twice on the site: once in the header and once in

View file

@ -1,4 +1,6 @@
$subtle: 0.1s cubic-bezier(0.56, 0.03, 0.35, 0.9);
$gentle: 0.2s cubic-bezier(1, 0.11, 0.41, 0.69);
$prominent: 0.7s cubic-bezier(0.45, 0.16, 0.38, 0.7);
$prominent-duration: 0.7s;
$prominent-timing: cubic-bezier(0.45, 0.16, 0.38, 0.7);
$prominent: $prominent-duration $prominent-timing;
$background: 8s cubic-bezier(0.45, 0.16, 0.38, 0.7);