feat: implemented a "fade in" animation on every page

This commit is contained in:
Laureηt 2021-08-30 13:43:46 +02:00
parent 92b0652cda
commit 1eae4e9de7
No known key found for this signature in database
GPG key ID: D88C6B294FD40994
3 changed files with 65 additions and 37 deletions

View file

@ -23,21 +23,28 @@ username: Laureηt
{{ content | safe }} {{ content | safe }}
<footer> <footer>
&copy; {% year %} {{ username }} &copy; {% year %}
{{ username }}
</footer> </footer>
<script> <script>
var elm_mouseover = document.querySelectorAll('[data-chaffle]'); var elm_mouseover = document.querySelectorAll('[data-chaffle]');
var elm_onload = document.querySelectorAll('[data-chaffle-onLoad]'); var elm_onload = document.querySelectorAll('[data-chaffle-onLoad]');
Array.prototype.forEach.call(elm_mouseover, function (el) { Array
.prototype
.forEach
.call(elm_mouseover, function (el) {
var chaffle = new Chaffle(el) var chaffle = new Chaffle(el)
el.addEventListener('mouseover', function () { el.addEventListener('mouseover', function () {
chaffle.init(); chaffle.init();
}); });
}); });
Array.prototype.forEach.call(elm_onload, function (el) { Array
.prototype
.forEach
.call(elm_onload, function (el) {
var chaffle = new Chaffle(el) var chaffle = new Chaffle(el)
chaffle.init(); chaffle.init();
setInterval(function () { setInterval(function () {

View file

@ -30,21 +30,28 @@ username: Laureηt
</div> </div>
<footer> <footer>
&copy; {% year %} {{ username }} &copy; {% year %}
{{ username }}
</footer> </footer>
<script> <script>
var elm_mouseover = document.querySelectorAll('[data-chaffle]'); var elm_mouseover = document.querySelectorAll('[data-chaffle]');
var elm_onload = document.querySelectorAll('[data-chaffle-onLoad]'); var elm_onload = document.querySelectorAll('[data-chaffle-onLoad]');
Array.prototype.forEach.call(elm_mouseover, function (el) { Array
.prototype
.forEach
.call(elm_mouseover, function (el) {
var chaffle = new Chaffle(el) var chaffle = new Chaffle(el)
el.addEventListener('mouseover', function () { el.addEventListener('mouseover', function () {
chaffle.init(); chaffle.init();
}); });
}); });
Array.prototype.forEach.call(elm_onload, function (el) { Array
.prototype
.forEach
.call(elm_onload, function (el) {
var chaffle = new Chaffle(el) var chaffle = new Chaffle(el)
chaffle.init(); chaffle.init();
setInterval(function () { setInterval(function () {

View file

@ -14,6 +14,8 @@ body {
max-width: 40em; max-width: 40em;
margin: 0 auto; margin: 0 auto;
padding: 1em; padding: 1em;
animation: intro .3s both;
animation-delay: .15s;
} }
body, body,
@ -89,6 +91,7 @@ footer {
body { body {
font-size: 17px; font-size: 17px;
} }
ol, ol,
ul { ul {
padding-left: 17px; padding-left: 17px;
@ -112,3 +115,14 @@ header>ul>li {
display: inline; display: inline;
margin-right: .5em; margin-right: .5em;
} }
@keyframes intro {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}