Deploy from Lumerel
This commit is contained in:
27
assets/js/main.js
Normal file
27
assets/js/main.js
Normal file
@@ -0,0 +1,27 @@
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// Smooth scroll for internal links
|
||||
document.querySelectorAll('a[href^="/"]').forEach(anchor => {
|
||||
anchor.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
const targetPath = this.getAttribute('href');
|
||||
|
||||
// Optional: Add a subtle fade out/in transition
|
||||
document.body.style.opacity = '0';
|
||||
setTimeout(() => {
|
||||
window.location.href = targetPath;
|
||||
}, 300);
|
||||
});
|
||||
});
|
||||
|
||||
// Optional: Add hover effects or other interactive elements
|
||||
const buttons = document.querySelectorAll('.btn');
|
||||
buttons.forEach(btn => {
|
||||
btn.addEventListener('mouseenter', function() {
|
||||
this.style.transform = 'scale(1.05)';
|
||||
});
|
||||
btn.addEventListener('mouseleave', function() {
|
||||
this.style.transform = 'scale(1)';
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user