new: Added motto display on home page and archive pages

This commit is contained in:
yv1ing
2024-12-18 17:46:15 +08:00
parent 27f0dc79b2
commit f39923654d
12 changed files with 105 additions and 16 deletions

View File

@@ -1,4 +1,25 @@
function search() {
const keyword = document.getElementById("index-search-input").value;
window.location.href = "/search?keyword=" + keyword;
}
function typeWriter(element_id, text) {
const element = document.getElementById(element_id);
let i = 0;
element.innerHTML = '';
function type() {
if (i < text.length) {
const minSpeed = 50;
const maxSpeed = 200;
const randomSpeed = Math.floor(Math.random() * (maxSpeed - minSpeed + 1)) + minSpeed;
element.innerHTML += text.charAt(i);
i++;
setTimeout(type, randomSpeed);
}
}
type();
}