added animation to title
This commit is contained in:
parent
6fa6b04b40
commit
6e8611266b
@ -30,8 +30,16 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
function putString(element, s, i) {
|
||||||
|
i++
|
||||||
|
element.textContent = s.substring(0, i)
|
||||||
|
|
||||||
|
if (i >=s.length) return;
|
||||||
|
setTimeout(() => putString(element, s, i), 100);
|
||||||
|
}
|
||||||
|
|
||||||
Array.from(document.querySelectorAll(".phrases")).forEach(element => {
|
Array.from(document.querySelectorAll(".phrases")).forEach(element => {
|
||||||
element.textContent = phrases[Math.floor(Math.random()*phrases.length)];
|
putString(element, phrases[Math.floor(Math.random()*phrases.length)], 0)
|
||||||
})
|
})
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user