Profile-Page/scripts/scripts.js

31 lines
920 B
JavaScript
Raw Normal View History

2024-06-08 17:32:28 -05:00
// Configuration options
const HERO_TITLE_INTERVAL = 4000;
const HERO_TITLE_LIST = ["Maker", "IT Support Specialist", "Nerd", "Homelab-er"];
let title_selector = 0;
const hero_title_rotator = () => {
const hero_titles = document.querySelector("#hero-titles");
hero_titles.innerHTML = HERO_TITLE_LIST[title_selector];
title_selector = ++title_selector % HERO_TITLE_LIST.length;
}
window.onload = function(){
console.debug("DOM Loaded");
setInterval(hero_title_rotator, HERO_TITLE_INTERVAL);
window.onscroll = clearArrowHint;
};
function clearArrowHint() {
console.debug("Clearing Arrow Hint");
var arrow_hint = document.getElementById("arrow-hint");
arrow_hint.style.transitionDelay = "0s";
arrow_hint.style.transitionDuration = "1s";
arrow_hint.style.transitionProperty = "opacity, visibility";
arrow_hint.style.opacity = "0%";
arrow_hint.style.visibility = "hidden";
window.onscroll = null;
}