update
This commit is contained in:
61
footer.php
61
footer.php
@@ -318,6 +318,67 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
const row = document.querySelector('.timeline-row');
|
||||
// Duplicate content for seamless scroll
|
||||
row.innerHTML += row.innerHTML;
|
||||
|
||||
// Set speed based on screen width
|
||||
let speed = window.innerWidth < 768 ? 0.6 : 0.5; // slower on mobile
|
||||
|
||||
let scrollPos = 0;
|
||||
|
||||
function marquee() {
|
||||
scrollPos += speed;
|
||||
if (scrollPos >= row.scrollWidth / 2) {
|
||||
scrollPos = 0; // reset for infinite loop
|
||||
}
|
||||
row.style.transform = `translateX(-${scrollPos}px)`;
|
||||
requestAnimationFrame(marquee);
|
||||
}
|
||||
|
||||
marquee();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
|
||||
// Close button
|
||||
document.querySelectorAll(".tmp-lookbook-close-btn").forEach(function(btn) {
|
||||
btn.addEventListener("click", function(e) {
|
||||
e.stopPropagation();
|
||||
this.closest(".tmp-lookbook-content-box-wrapper")
|
||||
.classList.add("is-hidden");
|
||||
});
|
||||
});
|
||||
|
||||
// Thumbnail click (open)
|
||||
document.querySelectorAll(".tmp-lookbook-thumb").forEach(function(thumb) {
|
||||
thumb.addEventListener("click", function() {
|
||||
const wrapper = this.closest(".tmp-lookbook-portion")
|
||||
.querySelector(".tmp-lookbook-content-box-wrapper");
|
||||
|
||||
wrapper.classList.remove("is-hidden");
|
||||
});
|
||||
});
|
||||
|
||||
// Auto-hide on scroll
|
||||
let scrollTimeout;
|
||||
window.addEventListener("scroll", function() {
|
||||
clearTimeout(scrollTimeout);
|
||||
|
||||
scrollTimeout = setTimeout(function() {
|
||||
document.querySelectorAll(".tmp-lookbook-content-box-wrapper")
|
||||
.forEach(function(box) {
|
||||
box.classList.add("is-hidden");
|
||||
});
|
||||
}, 80); // small delay = smooth UX
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
document.querySelectorAll('.tab-btns li').forEach(tab => {
|
||||
|
||||
Reference in New Issue
Block a user