Remove jquery-3.7.1.min.js (162 KB) and countdown.js plugin. Rewrite main.js, back-to-top.js, agenda.js in vanilla JS. Replace jQuery countdown init with inline vanilla countdown.
25 lines
667 B
JavaScript
25 lines
667 B
JavaScript
document.addEventListener("DOMContentLoaded", function () {
|
|
var bar = document.getElementById("sticky-bar");
|
|
var btn = document.getElementById("back-to-top");
|
|
if (!bar || !btn) return;
|
|
|
|
window.addEventListener("scroll", function () {
|
|
var y = window.pageYOffset || document.documentElement.scrollTop;
|
|
|
|
if (y > 600) {
|
|
bar.classList.add("is-visible");
|
|
} else {
|
|
bar.classList.remove("is-visible");
|
|
}
|
|
|
|
if (y > 100) {
|
|
btn.classList.add("is-visible");
|
|
} else {
|
|
btn.classList.remove("is-visible");
|
|
}
|
|
});
|
|
|
|
btn.addEventListener("click", function () {
|
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
});
|
|
}); |