refactor: reworked the layout system
This commit is contained in:
parent
5604d287c8
commit
ce073b0f1a
25
src/_includes/chaffle.njk
Normal file
25
src/_includes/chaffle.njk
Normal file
|
@ -0,0 +1,25 @@
|
|||
<script>
|
||||
var elm_mouseover = document.querySelectorAll('[data-chaffle]');
|
||||
var elm_onload = document.querySelectorAll('[data-chaffle-onLoad]');
|
||||
|
||||
Array
|
||||
.prototype
|
||||
.forEach
|
||||
.call(elm_mouseover, function (el) {
|
||||
var chaffle = new Chaffle(el)
|
||||
el.addEventListener('mouseover', function () {
|
||||
chaffle.init();
|
||||
});
|
||||
});
|
||||
|
||||
Array
|
||||
.prototype
|
||||
.forEach
|
||||
.call(elm_onload, function (el) {
|
||||
var chaffle = new Chaffle(el)
|
||||
chaffle.init();
|
||||
setInterval(function () {
|
||||
chaffle.init();
|
||||
}, 10000)
|
||||
});
|
||||
</script>
|
4
src/_includes/footer.njk
Normal file
4
src/_includes/footer.njk
Normal file
|
@ -0,0 +1,4 @@
|
|||
<footer role="contentinfo">
|
||||
© {% year %}
|
||||
{{ username }}
|
||||
</footer>
|
7
src/_includes/head.njk
Normal file
7
src/_includes/head.njk
Normal file
|
@ -0,0 +1,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ username }}</title>
|
||||
<link rel="stylesheet" href="{{ '/css/style.css' | url }}">
|
||||
<link rel="stylesheet" href="{{ '/css/anim.css' | url }}">
|
||||
<link rel="shortcut icon" type="image/x-icon" href="{{ '/favicon.png' | url }}">
|
||||
<script src="{{ '/javascript/chaffle.min.js' | url }}"></script>
|
4
src/_includes/header.njk
Normal file
4
src/_includes/header.njk
Normal file
|
@ -0,0 +1,4 @@
|
|||
<header role="banner">
|
||||
<span data-chaffle-onload="" data-chaffle="en">{{ username }}</span>
|
||||
<i class="blink">_</i>
|
||||
</header>
|
|
@ -13,50 +13,19 @@ username: Laureηt
|
|||
<link rel="stylesheet" href="{{ '/css/anim.css' | url }}">
|
||||
<link rel="shortcut icon" type="image/x-icon" href="{{ '/favicon.png' | url }}">
|
||||
<script src="{{ '/javascript/chaffle.min.js' | url }}"></script>
|
||||
{% block head %}{% endblock head %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<header role="banner">
|
||||
<span data-chaffle-onload="" data-chaffle="en">{{ username }}</span>
|
||||
<i class="blink">_</i>
|
||||
</header>
|
||||
|
||||
{% include "header.njk" %}
|
||||
{% block precontent %}{% endblock precontent %}
|
||||
<main role="main">
|
||||
{{ content | safe }}
|
||||
</main>
|
||||
|
||||
<footer role="contentinfo">
|
||||
© {% year %}
|
||||
{{ username }}
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
var elm_mouseover = document.querySelectorAll('[data-chaffle]');
|
||||
var elm_onload = document.querySelectorAll('[data-chaffle-onLoad]');
|
||||
|
||||
Array
|
||||
.prototype
|
||||
.forEach
|
||||
.call(elm_mouseover, function (el) {
|
||||
var chaffle = new Chaffle(el)
|
||||
el.addEventListener('mouseover', function () {
|
||||
chaffle.init();
|
||||
});
|
||||
});
|
||||
|
||||
Array
|
||||
.prototype
|
||||
.forEach
|
||||
.call(elm_onload, function (el) {
|
||||
var chaffle = new Chaffle(el)
|
||||
chaffle.init();
|
||||
setInterval(function () {
|
||||
chaffle.init();
|
||||
}, 10000)
|
||||
});
|
||||
</script>
|
||||
|
||||
{% block postcontent %}{% endblock postcontent %}
|
||||
{% include "footer.njk" %}
|
||||
{% include "chaffle.njk" %}
|
||||
{% block foot %}{% endblock foot %}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -1,77 +1,27 @@
|
|||
---
|
||||
username: Laureηt
|
||||
layout: layout.njk
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
{% block head %}
|
||||
<link rel="stylesheet" href="{{ '/css/eportfolio.css' | url }}">
|
||||
{% endblock head %}
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ username }}</title>
|
||||
<link rel="stylesheet" href="{{ '/css/style.css' | url }}">
|
||||
<link rel="stylesheet" href="{{ '/css/eportfolio.css' | url }}">
|
||||
<link rel="stylesheet" href="{{ '/css/anim.css' | url }}">
|
||||
<link rel="shortcut icon" type="image/x-icon" href="{{ '/favicon.png' | url }}">
|
||||
<script src="{{ '/javascript/chaffle.min.js' | url }}"></script>
|
||||
</head>
|
||||
{% block precontent %}
|
||||
<nav class="11ty-nav" role="navigation">
|
||||
<div>
|
||||
{% for entry in collections.all | eleventyNavigation %}
|
||||
<a href="{{ entry.url | url }}">{{ entry.title }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<hr>
|
||||
</nav>
|
||||
{% endblock precontent %}
|
||||
|
||||
<body>
|
||||
{{ content | safe }}
|
||||
|
||||
<header role="banner">
|
||||
<span data-chaffle-onload="" data-chaffle="en">{{ username }}</span>
|
||||
<i class="blink" style="display:inline;">_</i>
|
||||
</header>
|
||||
|
||||
<nav role="navigation">
|
||||
<div class="11ty-nav">
|
||||
{% for entry in collections.all | eleventyNavigation %}
|
||||
<a href="{{ entry.url | url }}">{{ entry.title }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<hr>
|
||||
</nav>
|
||||
|
||||
<main role="main">
|
||||
{{ content | safe }}
|
||||
</main>
|
||||
|
||||
<nav id="btn-back" role="navigation">
|
||||
<i>«</i>
|
||||
<a href="{{ '/' | url }}">Go back</a>
|
||||
</nav>
|
||||
|
||||
<footer role="contentinfo">
|
||||
© {% year %}
|
||||
{{ username }}
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
var elm_mouseover = document.querySelectorAll('[data-chaffle]');
|
||||
var elm_onload = document.querySelectorAll('[data-chaffle-onLoad]');
|
||||
|
||||
Array
|
||||
.prototype
|
||||
.forEach
|
||||
.call(elm_mouseover, function (el) {
|
||||
var chaffle = new Chaffle(el)
|
||||
el.addEventListener('mouseover', function () {
|
||||
chaffle.init();
|
||||
});
|
||||
});
|
||||
|
||||
Array
|
||||
.prototype
|
||||
.forEach
|
||||
.call(elm_onload, function (el) {
|
||||
var chaffle = new Chaffle(el)
|
||||
chaffle.init();
|
||||
setInterval(function () {
|
||||
chaffle.init();
|
||||
}, 10000)
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
{% block postcontent %}
|
||||
<nav id="btn-back" role="navigation">
|
||||
<i>«</i>
|
||||
<a href="{{ '/' | url }}">Go back</a>
|
||||
</nav>
|
||||
{% endblock postcontent %}
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
body {
|
||||
font-size: 20px;
|
||||
max-width: 60em;
|
||||
width: 80rem;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2 {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.row {
|
||||
|
|
|
@ -28,6 +28,7 @@ body {
|
|||
a {
|
||||
color: $foreground-text;
|
||||
text-decoration: underline;
|
||||
text-decoration-thickness: 2px;
|
||||
text-decoration-color: #283593;
|
||||
|
||||
&:hover {
|
||||
|
|
Reference in a new issue