kh3_website/index.html

1107 lines
38 KiB
HTML

<!DOCTYPE html>
<html lang="en" class="dark">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>KH3 - Building Inspiring Spaces</title>
<link rel="stylesheet" href="styles/main.css" />
<meta
name="description"
content="KH3 - Construction Project Management and Fit-out Services in Accra, Ghana. Building inspiring spaces since 2014."
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&display=swap"
rel="stylesheet"
/>
</head>
<body class="bg-kh3-black text-white font-montserrat overflow-x-hidden">
<!-- Navigation Menu -->
<div
class="fixed left-0 top-0 h-full w-1/3 bg-kh3-black z-50 hidden shadow-2xl"
id="navMenu"
>
<div class="p-8 flex flex-col h-full">
<!-- Logo -->
<div class="flex items-center gap-3 mb-12">
<img src="assets/images/kh3_logo.png" alt="KH3" class="w-12 h-12" />
<span class="text-white text-2xl font-bold tracking-wider">KH3</span>
</div>
<!-- Navigation Links - Inverted C Layout -->
<nav class="flex-1 relative">
<div class="absolute inset-0 flex items-center">
<div class="relative ml-8">
<!-- Navigation items in inverted C shape -->
<div class="space-y-6">
<!-- HOME - Top -->
<a
href="index.html"
class="block text-white text-lg font-medium border-b border-white pb-1 ml-0 font-montserrat"
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.05s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>H</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.075s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>O</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.1s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>M</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.125s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>E</span
>
</a>
<!-- ABOUT US - Slightly right -->
<a
href="about.html"
class="block text-white text-lg font-medium hover:text-kh3-red transition-colors ml-6 font-montserrat"
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.15s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>A</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.175s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>B</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.2s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>O</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.225s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>U</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.25s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>T</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.275s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>&nbsp;</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.3s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>U</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.325s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>S</span
>
</a>
<!-- SERVICES - More right -->
<a
href="services.html"
class="block text-white text-lg font-medium hover:text-kh3-red transition-colors ml-12 font-montserrat"
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.35s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>S</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.375s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>E</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.4s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>R</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.425s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>V</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.45s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>I</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.475s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>C</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.5s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>E</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.525s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>S</span
>
</a>
<!-- PROJECTS - Most right -->
<a
href="projects.html"
class="block text-white text-lg font-medium hover:text-kh3-red transition-colors ml-20 font-montserrat"
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.55s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>P</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.575s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>R</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.6s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>O</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.625s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>J</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.65s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>E</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.675s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>C</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.7s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>T</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.725s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>S</span
>
</a>
<!-- CONTACTS - More right -->
<a
href="contact.html"
class="block text-white text-lg font-medium hover:text-kh3-red transition-colors ml-12 font-montserrat"
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.75s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>C</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.775s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>O</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.8s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>N</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.825s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>T</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.85s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>A</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.875s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>C</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.9s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>T</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.925s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>S</span
>
</a>
<!-- PARTNERS - Back to left -->
<a
href="partners.html"
class="block text-white text-lg font-medium hover:text-kh3-red transition-colors ml-0 font-montserrat"
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.95s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>P</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 0.975s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>A</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 1s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>R</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 1.025s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>T</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 1.05s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>N</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 1.075s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>E</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 1.1s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>R</span
>
<span
class="inline-block opacity-0 animate-fade-in-left"
style="
animation-delay: 1.125s;
animation-fill-mode: forwards;
animation-duration: 0.15s;
"
>S</span
>
</a>
</div>
</div>
</div>
</nav>
</div>
</div>
<!-- Main Layout -->
<div class="min-h-screen relative">
<section class="relative h-screen flex">
<!-- KH3 Logo -->
<div
class="absolute top-8 left-8 z-20 opacity-0 animate-fade-in-left"
style="animation-delay: 0.2s; animation-fill-mode: forwards"
>
<div class="flex items-center gap-3 animate-logo-float">
<img
src="assets/images/kh3_logo_dark.png"
alt="KH3"
class="w-16 h-16"
/>
<span
class="text-white text-2xl font-bold tracking-wider animate-logo-glow"
>KH3</span
>
</div>
</div>
<!-- Menu Grid -->
<div
class="fixed bottom-12 left-12 z-50 opacity-0 animate-fade-in-left"
style="animation-delay: 0.4s; animation-fill-mode: forwards"
>
<div class="cursor-pointer" id="menuToggle">
<div
class="grid grid-cols-3 gap-1 w-6 h-6 animate-logo-float"
id="menuGrid"
>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
</div>
</div>
</div>
<!-- Floating Text - Center -->
<div
class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-10 opacity-0"
style="animation: fadeInScale 1s ease-out 0.6s forwards"
>
<div class="text-center">
<h1
class="text-4xl md:text-6xl font-semibold text-white animate-logo-float"
>
KH3 Group Limited
</h1>
</div>
</div>
<!-- LEFT COLUMN -->
<div
class="w-1/3 bg-kh3-black flex items-center p-8 opacity-0 animate-fade-in-left"
style="animation-delay: 0.8s; animation-fill-mode: forwards"
>
<div class="max-w-xl space-y-2">
<div class="flex flex-col space-y-8">
<!-- DREAM -->
<div class="flex items-center gap-6">
<div class="flex flex-col items-center justify-center">
<div class="w-px h-8 bg-kh3-red"></div>
<div
class="w-3 h-3 bg-kh3-red transform rotate-45 -mt-1.5"
></div>
<div class="w-px h-8 bg-kh3-red"></div>
</div>
<div class="flex items-center h-16">
<span
class="text-xs md:text-sm tracking-widest text-neutral-400"
>DREAM</span
>
</div>
</div>
<!-- DESIGN -->
<div class="flex items-center gap-6">
<div class="flex flex-col items-center justify-center">
<div class="w-px h-8 bg-kh3-red"></div>
<div
class="w-3 h-3 bg-kh3-red transform rotate-45 -mt-1.5"
></div>
<div class="w-px h-8 bg-kh3-red"></div>
</div>
<div class="flex items-center h-16">
<span
class="text-xs md:text-sm tracking-widest text-neutral-400"
>DESIGN</span
>
</div>
</div>
<!-- DELIVER -->
<div class="flex items-center gap-6">
<div class="flex flex-col items-center justify-center">
<div class="w-px h-8 bg-kh3-red"></div>
<div
class="w-3 h-3 bg-kh3-red transform rotate-45 -mt-1.5"
></div>
<div class="w-px h-8 bg-kh3-red"></div>
</div>
<div class="flex items-center h-16">
<span
class="text-xs md:text-sm tracking-widest text-neutral-400"
>DELIVER</span
>
</div>
</div>
</div>
</div>
</div>
<!-- RIGHT COLUMN -->
<div
class="w-2/3 relative opacity-0 animate-fade-in-right overflow-hidden"
style="animation-delay: 0.3s; animation-fill-mode: forwards"
>
<div class="relative h-full">
<!-- Current Image -->
<img
id="currentImg"
src="assets/images/room.png"
alt="Sample interior fit-out by KH3"
class="absolute inset-0 w-full h-full object-cover"
/>
<!-- Next Image (hidden initially) -->
<img
id="nextImg"
src="assets/images/chair.png"
alt="Sample interior fit-out by KH3"
class="absolute inset-0 w-full h-full object-cover opacity-0"
/>
<div class="absolute inset-0 bg-black bg-opacity-20 z-10"></div>
</div>
</div>
<!-- About Us Button - Bottom Center -->
<div
class="absolute bottom-8 left-1/2 transform -translate-x-1/2 z-20 opacity-0"
style="animation: fadeInUp 0.8s ease-out 1.2s forwards"
>
<a
class="inline-block uppercase tracking-wider px-6 py-3 border border-white text-white hover:bg-kh3-red hover:border-kh3-red transition-all duration-300 rounded-none animate-border-glow"
href="about.html"
data-trans
>
About us
</a>
</div>
<!-- Contact Link - Bottom Right -->
<div
class="absolute bottom-8 right-8 flex items-center space-x-4 z-20 opacity-0 animate-fade-in-right"
style="animation-delay: 1.4s; animation-fill-mode: forwards"
>
<div class="w-8 h-px bg-kh3-red"></div>
<a
href="contact.html"
data-trans
class="text-white hover:text-kh3-red transition-colors uppercase tracking-wider"
>
CONTACTS
</a>
<div class="w-8 h-px bg-kh3-red"></div>
</div>
</section>
</div>
<!-- Custom Cursor -->
<div
class="fixed w-6 h-6 border-2 border-kh3-red rounded-full pointer-events-none z-50"
id="customCursor"
></div>
<!-- Loading Screen -->
<div
class="fixed inset-0 bg-kh3-black z-50 flex items-center justify-center"
id="loadingScreen"
>
<div class="text-center">
<div class="flex items-center gap-3 mb-8">
<img
src="assets/images/kh3_logo_dark.png"
alt="KH3"
class="w-16 h-16"
/>
<span class="text-4xl font-bold tracking-wider">KH3</span>
</div>
<div class="w-64 h-1 bg-neutral-800 rounded-full overflow-hidden">
<div class="h-full bg-kh3-red rounded-full animate-pulse"></div>
</div>
</div>
</div>
<style>
@keyframes fadeInScale {
0% {
opacity: 0;
transform: translate(-50%, -50%) scale(0.8);
}
100% {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
}
}
@keyframes fadeInUp {
0% {
opacity: 0;
transform: translate(-50%, 20px);
}
100% {
opacity: 1;
transform: translate(-50%, 0);
}
}
@keyframes pageEnter {
0% {
opacity: 0;
transform: scale(1.02);
}
100% {
opacity: 1;
transform: scale(1);
}
}
@keyframes pageExit {
0% {
opacity: 1;
transform: scale(1);
}
100% {
opacity: 0;
transform: scale(0.98);
}
}
@keyframes staggerFadeOut {
to {
opacity: 0;
transform: translateY(10px) scale(0.98);
}
}
@keyframes slideOutLeft {
0% {
transform: translateX(0) scale(1);
opacity: 1;
}
100% {
transform: translateX(-100%) scale(0.8);
opacity: 0;
}
}
@keyframes slideOutRight {
0% {
transform: translateX(0) scale(1);
opacity: 1;
}
100% {
transform: translateX(100%) scale(0.8);
opacity: 0;
}
}
@keyframes zoomInFromLeft {
0% {
transform: translateX(-100%) scale(1.3);
opacity: 0;
}
100% {
transform: translateX(0) scale(1);
opacity: 1;
}
}
@keyframes zoomInFromRight {
0% {
transform: translateX(100%) scale(1.3);
opacity: 0;
}
100% {
transform: translateX(0) scale(1);
opacity: 1;
}
}
</style>
<script src="js/main.js"></script>
<script>
// Top/Bottom curtain transition system
const curtainTop =
document.getElementById("pageCurtainTop") ||
(() => {
const div = document.createElement("div");
div.id = "pageCurtainTop";
div.className =
"fixed inset-x-0 top-0 h-1/2 z-50 transform -translate-y-full transition-transform duration-600 ease-in-out";
div.style.background = "linear-gradient(0deg, #b03037, #8a252a)";
document.body.appendChild(div);
return div;
})();
const curtainBottom =
document.getElementById("pageCurtainBottom") ||
(() => {
const div = document.createElement("div");
div.id = "pageCurtainBottom";
div.className =
"fixed inset-x-0 bottom-0 h-1/2 z-50 transform translate-y-full transition-transform duration-600 ease-in-out";
div.style.background = "linear-gradient(180deg, #b03037, #8a252a)";
document.body.appendChild(div);
return div;
})();
// Add entrance animation class
document.body.style.animation = "pageEnter 0.6s ease-out";
document.querySelectorAll("a[data-trans]").forEach((a) => {
a.addEventListener("click", (e) => {
const href = a.getAttribute("href");
if (!href || href.startsWith("#")) return;
e.preventDefault();
// Collect elements that had delayed entrance and fade them out in reverse order
const animatedEls = Array.from(
document.querySelectorAll('[style*="animation-delay"]')
).map((el) => {
const m = (el.getAttribute("style") || "").match(
/animation-delay:\s*([0-9.]+)s/
);
const delay = m ? parseFloat(m[1]) : 0;
return { el, delay };
});
const sorted = animatedEls
.sort((a, b) => b.delay - a.delay)
.map((item, idx) => ({ ...item, order: idx }));
sorted.forEach((item) => {
setTimeout(() => {
item.el.style.animation =
"staggerFadeOut 260ms ease-out forwards";
}, item.order * 50);
});
const totalStaggerTime = (sorted.length - 1) * 50 + 260 + 130;
setTimeout(() => {
// Crossfade + tiny zoom of the whole page (longer)
document.body.style.animation = "pageExit 900ms ease forwards";
setTimeout(() => {
location.href = href;
}, 920);
}, totalStaggerTime);
});
});
// Enhanced slide + zoom hero image transitions
const imgs = [
"assets/images/room.png",
"assets/images/chair.png",
"assets/images/google.png",
];
const currentImg = document.getElementById("currentImg");
const nextImg = document.getElementById("nextImg");
if (currentImg && nextImg) {
let currentIndex = 0;
let isTransitioning = false;
// Alternate slide directions for dynamic effect
const slideDirections = ["left", "right"];
let slideIndex = 0;
function performSlideZoomTransition() {
if (isTransitioning) return;
isTransitioning = true;
// Get next image index
const nextIndex = (currentIndex + 1) % imgs.length;
const slideDirection =
slideDirections[slideIndex % slideDirections.length];
slideIndex++;
// Set up next image
nextImg.src = imgs[nextIndex];
nextImg.style.opacity = "1";
// Apply animations based on slide direction
if (slideDirection === "left") {
// Current slides out left, next zooms in from right
currentImg.style.animation = "slideOutLeft 1s ease-in-out forwards";
nextImg.style.animation = "zoomInFromRight 1s ease-in-out forwards";
} else {
// Current slides out right, next zooms in from left
currentImg.style.animation =
"slideOutRight 1s ease-in-out forwards";
nextImg.style.animation = "zoomInFromLeft 1s ease-in-out forwards";
}
// After animation completes, swap the images
setTimeout(() => {
// Swap the images
currentImg.src = imgs[nextIndex];
currentImg.style.animation = "";
currentImg.style.transform = "";
currentImg.style.opacity = "1";
// Reset next image
nextImg.style.animation = "";
nextImg.style.transform = "";
nextImg.style.opacity = "0";
currentIndex = nextIndex;
isTransitioning = false;
}, 1000); // Match animation duration
}
// Start the transition cycle
setInterval(performSlideZoomTransition, 10000); // Every 10 seconds for better viewing
}
// Menu toggle functionality
const menuToggle = document.getElementById("menuToggle");
const navMenu = document.getElementById("navMenu");
const menuGrid = document.getElementById("menuGrid");
if (menuToggle && navMenu && menuGrid) {
let isMenuOpen = false;
menuToggle.addEventListener("click", () => {
if (isMenuOpen) {
// Close menu
navMenu.classList.add("hidden");
menuGrid.innerHTML = `
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
`;
isMenuOpen = false;
} else {
// Open menu
navMenu.classList.remove("hidden");
menuGrid.innerHTML = `
<div class="absolute inset-0 flex items-center justify-center">
<svg class="w-5 h-5 text-kh3-red" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>
</div>
`;
isMenuOpen = true;
}
});
// Close menu when clicking outside
document.addEventListener("click", (e) => {
if (!menuToggle.contains(e.target) && !navMenu.contains(e.target)) {
navMenu.classList.add("hidden");
menuGrid.innerHTML = `
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
<span class="w-1 h-1 bg-white"></span>
`;
isMenuOpen = false;
}
});
}
// Loading screen with improved timing
window.addEventListener("load", () => {
const loadingScreen = document.getElementById("loadingScreen");
if (loadingScreen) {
// Show loading screen briefly, then fade out just before animations start
setTimeout(() => {
loadingScreen.style.transition = "opacity 0.3s ease-out";
loadingScreen.style.opacity = "0";
setTimeout(() => {
loadingScreen.style.display = "none";
}, 300);
}, 400); // Reduced from 1000ms to 400ms to sync with animations
}
});
// Menu grid animation sequence
function startMenuGridAnimation() {
const menuGrid = document.getElementById("menuGrid");
if (!menuGrid) return;
// Remove CSS animation to prevent conflicts
menuGrid.style.animation = "none";
let phase = 0;
let isEnlarged = false;
let isSpinning = true;
let isResting = false;
const animationInterval = setInterval(() => {
phase += 0.02;
if (isSpinning) {
// Spinning animation
const rotation = phase * 360;
const floatY = Math.sin(phase * 2) * 6;
const rippleScale = 1 + Math.sin(phase * 3) * 0.08;
const sizeScale = isEnlarged ? 1.5 : 1;
menuGrid.style.transform = `rotate(${rotation}deg) scale(${
rippleScale * sizeScale
}) translateY(${floatY}px)`;
// Handle color changes
const spans = menuGrid.querySelectorAll("span");
spans.forEach((span) => {
span.style.backgroundColor = isEnlarged ? "#B03037" : "#ffffff";
});
} else if (isResting) {
// Resting animation - just floating with upward ripple effect
const floatY = Math.sin(phase * 1.5) * 8;
const rippleScale = 1 + Math.sin(phase * 2) * 0.1;
menuGrid.style.transform = `scale(${rippleScale}) translateY(${floatY}px)`;
// Keep white color during rest
const spans = menuGrid.querySelectorAll("span");
spans.forEach((span) => {
span.style.backgroundColor = "#ffffff";
});
}
}, 50);
function startCycle() {
// Step 1: Default spinning for 7 seconds
isSpinning = true;
isEnlarged = false;
isResting = false;
// Step 2: After 7 seconds, change to red and bigger, spin once
setTimeout(() => {
isEnlarged = true;
// After one spin (3 seconds), go to rest
setTimeout(() => {
isEnlarged = false;
isSpinning = false;
isResting = true;
// Step 3: Rest for 7 seconds (just floating)
setTimeout(() => {
// Step 4: Start spinning again (repeat cycle)
startCycle();
}, 7000);
}, 3000);
}, 7000);
}
// Start the cycle
startCycle();
}
// Start the animation
startMenuGridAnimation();
// Custom cursor functionality
const customCursor = document.getElementById("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);
</script>
</body>
</html>