Spaces:
Running
Running
File size: 1,190 Bytes
3478103 815d828 3478103 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
document.addEventListener('DOMContentLoaded', function() {
// Initialize tooltips
const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl);
});
// Cart quantity handlers
document.querySelectorAll('.quantity-btn').forEach(btn => {
btn.addEventListener('click', function() {
const input = this.parentNode.querySelector('.quantity-input');
let value = parseInt(input.value);
if (this.classList.contains('minus') && value > 1) {
input.value = value - 1;
} else if (this.classList.contains('plus')) {
input.value = value + 1;
}
});
});
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
});
|