mirror of
https://git.kh3group.com/georgebiri/kh3_website.git
synced 2026-10-16 23:31:47 +00:00
Update 'about.html' to correct team member numbering and enhance 'index.html' with preloading of critical resources, optimized images, and deferred script loading for improved performance. Modify 'package.json' to include minification in the build script and enable JIT mode in 'tailwind.config.js'.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
38db6e6744
commit
84eafb8746
15 changed files with 382 additions and 384 deletions
74
js/menu-animations.js
Normal file
74
js/menu-animations.js
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
// Menu toggle functionality and animations
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const menuToggle = document.getElementById("menuToggle");
|
||||
const navMenu = document.getElementById("navMenu");
|
||||
const menuWrap = document.getElementById("menuWrap");
|
||||
const menuGrid = document.getElementById("menuGrid");
|
||||
const menuGridMobile = document.getElementById("menuGridMobile");
|
||||
|
||||
if (menuToggle && navMenu) {
|
||||
let isMenuOpen = false;
|
||||
|
||||
menuToggle.addEventListener("click", () => {
|
||||
if (isMenuOpen) {
|
||||
// Close menu
|
||||
navMenu.classList.add("hidden");
|
||||
if (menuWrap) menuWrap.classList.remove("open");
|
||||
isMenuOpen = false;
|
||||
} else {
|
||||
// Open menu
|
||||
navMenu.classList.remove("hidden");
|
||||
if (menuWrap) menuWrap.classList.add("open");
|
||||
isMenuOpen = true;
|
||||
}
|
||||
});
|
||||
|
||||
// Close menu when clicking outside
|
||||
document.addEventListener("click", (e) => {
|
||||
if (!menuToggle.contains(e.target) && !navMenu.contains(e.target)) {
|
||||
navMenu.classList.add("hidden");
|
||||
if (menuWrap) menuWrap.classList.remove("open");
|
||||
isMenuOpen = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Custom cursor functionality
|
||||
const customCursor = document.getElementById("customCursor");
|
||||
|
||||
if (customCursor) {
|
||||
// Hide default cursor
|
||||
document.body.style.cursor = "none";
|
||||
|
||||
// Follow mouse movement
|
||||
document.addEventListener("mousemove", (e) => {
|
||||
customCursor.style.left = e.clientX - 12 + "px";
|
||||
customCursor.style.top = e.clientY - 12 + "px";
|
||||
});
|
||||
|
||||
// Menu grid hover effects
|
||||
if (menuGrid) {
|
||||
menuGrid.addEventListener("mouseenter", () => {
|
||||
customCursor.style.borderColor = "#B03037";
|
||||
customCursor.style.transform = "scale(1.5)";
|
||||
customCursor.style.animation = "spin 0.5s linear infinite";
|
||||
});
|
||||
|
||||
menuGrid.addEventListener("mouseleave", () => {
|
||||
customCursor.style.borderColor = "#B03037";
|
||||
customCursor.style.transform = "scale(1)";
|
||||
customCursor.style.animation = "none";
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Add spin animation for cursor
|
||||
const style = document.createElement("style");
|
||||
style.textContent = `
|
||||
@keyframes spin {
|
||||
from { transform: scale(1.5) rotate(0deg); }
|
||||
to { transform: scale(1.5) rotate(360deg); }
|
||||
}
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue