implement terminal autoscrolling

pull/1/head
Florian Sorg 3 years ago
parent 084739b7a7
commit 442b239b12

@ -8,7 +8,6 @@
<link rel="icon" href="{% static 'tonkakt.svg' %}" sizes="any" type="image/svg+xml"> <link rel="icon" href="{% static 'tonkakt.svg' %}" sizes="any" type="image/svg+xml">
<link rel="stylesheet" href="{% static 'bulma.min.css' %}"> <link rel="stylesheet" href="{% static 'bulma.min.css' %}">
<link rel="stylesheet" href="{% static 'bulma-prefers-dark.min.css' %}"> <link rel="stylesheet" href="{% static 'bulma-prefers-dark.min.css' %}">
<meta http-equiv="refresh" content="60">
<style> <style>
@font-face { @font-face {
font-family: "Maven Pro"; font-family: "Maven Pro";
@ -29,6 +28,34 @@
} }
} }
</style> </style>
<script>
window.addEventListener('load', () => {
const max = document.body.scrollHeight - window.innerHeight;
let current = 0;
let interval;
window.scrollTo({top: 0});
if (max > 0) {
setTimeout(() => {
interval = setInterval(() => {
current += 1;
window.scrollTo({top: current});
if (window.scrollY >= max) {
clearInterval(interval);
setTimeout(() => {
window.location.reload();
}, 5000)
}
}, 20);
}, 5000)
}
setTimeout(window.location.reload, 120 * 1000)
});
</script>
</head> </head>
<body> <body>
<section class="section"> <section class="section">

Loading…
Cancel
Save