/* Reset and Base Styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
/* Colors */
--primary-color: #667eea;
--secondary-color: #764ba2;
--accent-color: #f093fb;
--text-primary: #1a202c;
--text-secondary: #4a5568;
--bg-primary: #ffffff;
--bg-secondary: #f7fafc;
--bg-glass: rgba(255, 255, 255, 0.8);
--border-color: #e2e8f0;
--shadow-color: rgba(0, 0, 0, 0.1);
/* Dark mode colors */
--dark-text-primary: #f7fafc;
--dark-text-secondary: #cbd5e0;
--dark-bg-primary: #1a202c;
--dark-bg-secondary: #2d3748;
--dark-bg-glass: rgba(45, 55, 72, 0.8);
--dark-border-color: #4a5568;
--dark-shadow-color: rgba(0, 0, 0, 0.3);
/* Typography */
--font-primary: 'Inter', sans-serif;
--font-heading: 'Poppins', sans-serif;
/* Transitions */
--transition-fast: 0.2s ease;
--transition-medium: 0.3s ease;
--transition-slow: 0.5s ease;
}
body {
font-family: var(--font-primary);
line-height: 1.6;
color: var(--text-primary);
background-color: var(--bg-primary);
transition: background-color var(--transition-medium), color var(--transition-medium);
overflow-x: hidden;
}
body.dark-mode {
--text-primary: var(--dark-text-primary);
--text-secondary: var(--dark-text-secondary);
--bg-primary: var(--dark-bg-primary);
--bg-secondary: var(--dark-bg-secondary);
--bg-glass: var(--dark-bg-glass);
--border-color: var(--dark-border-color);
--shadow-color: var(--dark-shadow-color);
}
/* Typography */
h1, h2, h3, h4, h5, h6 {
font-family: var(--font-heading);
font-weight: 600;
line-height: 1.2;
}
h1 {
font-size: clamp(2.5rem, 5vw, 4rem);
}
h2 {
font-size: clamp(2rem, 4vw, 3rem);
}
h3 {
font-size: clamp(1.5rem, 3vw, 2rem);
}
p {
color: var(--text-secondary);
font-size: clamp(1rem, 1.5vw, 1.125rem);
}
/* Container */
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 1.5rem;
}
/* Navigation */
.navbar {
position: fixed;
top: 0;
left: 0;
right: 0;
background: var(--bg-glass);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border-bottom: 1px solid var(--border-color);
z-index: 1000;
transition: all var(--transition-medium);
}
.nav-container {
max-width: 1200px;
margin: 0 auto;
padding: 1rem 1.5rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.nav-logo {
display: flex;
align-items: center;
gap: 0.5rem;
font-family: var(--font-heading);
font-weight: 700;
font-size: 1.25rem;
}
.logo-icon {
font-size: 1.5rem;
animation: pulse 2s infinite;
}
.nav-links {
display: flex;
list-style: none;
gap: 2rem;
}
.nav-link {
text-decoration: none;
color: var(--text-secondary);
font-weight: 500;
position: relative;
transition: color var(--transition-fast);
}
.nav-link:hover {
color: var(--primary-color);
}
.nav-link::after {
content: '';
position: absolute;
bottom: -4px;
left: 50%;
width: 0;
height: 2px;
background: var(--primary-color);
transform: translateX(-50%);
transition: width var(--transition-medium);
}
.nav-link:hover::after,
.nav-link.active::after {
width: 100%;
}
.nav-actions {
display: flex;
align-items: center;
gap: 1rem;
}
.theme-toggle {
background: none;
border: none;
cursor: pointer;
padding: 0.5rem;
border-radius: 0.5rem;
transition: background-color var(--transition-fast);
display: flex;
align-items: center;
justify-content: center;
}
.theme-toggle:hover {
background-color: var(--bg-secondary);
}
.sun-icon,
.moon-icon {
transition: opacity var(--transition-fast), transform var(--transition-fast);
}
body:not(.dark-mode) .moon-icon {
display: none;
}
body.dark-mode .sun-icon {
display: none;
}
.mobile-menu-toggle {
display: none;
background: none;
border: none;
cursor: pointer;
padding: 0.5rem;
flex-direction: column;
gap: 4px;
}
.mobile-menu-toggle span {
display: block;
width: 24px;
height: 2px;
background: var(--text-primary);
transition: all var(--transition-fast);
}
.mobile-nav {
display: none;
list-style: none;
background: var(--bg-glass);
border-top: 1px solid var(--border-color);
padding: 1rem 1.5rem;
}
.mobile-nav.active {
display: block;
}
/* Hero Section */
.hero {
padding: 8rem 0 4rem;
text-align: center;
position: relative;
background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}
.hero-title {
margin-bottom: 1.5rem;
}
.gradient-text {
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.hero-subtitle {
max-width: 600px;
margin: 0 auto;
}
/* Floating Elements */
.floating-elements {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: hidden;
pointer-events: none;
}
.floating-circle {
position: absolute;
border-radius: 50%;
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
opacity: 0.1;
animation: float 20s infinite ease-in-out;
}
.floating-circle:nth-child(1) {
width: 300px;
height: 300px;
top: -150px;
left: -150px;
animation-delay: 0s;
}
.floating-circle:nth-child(2) {
width: 200px;
height: 200px;
bottom: -100px;
right: -100px;
animation-delay: 5s;
}
.floating-circle:nth-child(3) {
width: 150px;
height: 150px;
top: 50%;
right: 10%;
animation-delay: 10s;
}
/* Timer Section */
.timer-section {
padding: 4rem 0;
}
.timer-container {
padding: 3rem;
border-radius: 1.5rem;
margin-bottom: 3rem;
}
.glass-effect {
background: var(--bg-glass);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border: 1px solid var(--border-color);
box-shadow: 0 8px 32px var(--shadow-color);
}
.timer-header {
text-align: center;
margin-bottom: 3rem;
}
.timer-title {
margin-bottom: 2rem;
}
.timer-controls {
display: flex;
gap: 1rem;
justify-content: center;
align-items: center;
flex-wrap: wrap;
}
.datetime-input {
padding: 0.75rem 1.5rem;
border: 2px solid var(--border-color);
border-radius: 0.5rem;
font-family: var(--font-primary);
font-size: 1rem;
background: var(--bg-primary);
color: var(--text-primary);
transition: border-color var(--transition-fast);
}
.datetime-input:focus {
outline: none;
border-color: var(--primary-color);
}
/* Buttons */
.btn {
padding: 0.75rem 2rem;
border: none;
border-radius: 0.5rem;
font-family: var(--font-primary);
font-weight: 600;
font-size: 1rem;
cursor: pointer;
transition: all var(--transition-fast);
position: relative;
overflow: hidden;
}
.btn-primary {
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
color: white;
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}
.btn-primary:active {
transform: translateY(0);
}
/* Countdown Display */
.countdown-display {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 2rem;
margin-bottom: 3rem;
justify-items: center;
}
.countdown-item {
position: relative;
text-align: center;
}
.progress-ring {
transform: rotate(-90deg);
}
.progress-ring-circle {
stroke-dasharray: 326.73;
stroke-dashoffset: 326.73;
stroke-linecap: round;
transition: stroke-dashoffset 1s ease-in-out;
}
.countdown-value {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
}
.countdown-number {
font-size: 2rem;
font-weight: 700;
font-family: var(--font-heading);
line-height: 1;
transition: all var(--transition-fast);
}
.countdown-label {
font-size: 0.875rem;
color: var(--text-secondary);
margin-top: 0.25rem;
}
/* Event Name Input */
.event-name-container {
text-align: center;
}
.event-name-input {
width: 100%;
max-width: 400px;
padding: 0.75rem 1.5rem;
border: 2px solid var(--border-color);
border-radius: 0.5rem;
font-family: var(--font-primary);
font-size: 1rem;
text-align: center;
background: var(--bg-primary);
color: var(--text-primary);
transition: border-color var(--transition-fast);
}
.event-name-input:focus {
outline: none;
border-color: var(--primary-color);
}
/* Presets Section */
.presets-section {
padding: 4rem 0;
background: var(--bg-secondary);
}
.section-title {
text-align: center;
margin-bottom: 3rem;
}
.presets-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 2rem;
}
.preset-card {
background: var(--bg-primary);
padding: 2rem;
border-radius: 1rem;
text-align: center;
cursor: pointer;
transition: all var(--transition-medium);
border: 2px solid transparent;
}
.preset-card:hover {
transform: translateY(-5px) scale(1.02);
border-color: var(--primary-color);
box-shadow: 0 10px 30px var(--shadow-color);
}
.preset-icon {
font-size: 3rem;
margin-bottom: 1rem;
}
.preset-card h3 {
margin-bottom: 0.5rem;
font-size: 1.25rem;
}
.preset-card p {
font-size: 0.875rem;
}
/* Features Section */
.features-section {
padding: 4rem 0;
}
.features-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 2rem;
}
.feature-card {
padding: 2.5rem;
border-radius: 1rem;
text-align: center;
transition: transform var(--transition-medium);
}
.feature-card:hover {
transform: translateY(-5px);
}
.feature-icon {
font-size: 3rem;
margin-bottom: 1rem;
}
.feature-card h3 {
margin-bottom: 1rem;
font-size: 1.5rem;
}
/* About Section */
.about-section {
padding: 4rem 0;
background: var(--bg-secondary);
}
.about-content {
max-width: 800px;
margin: 0 auto;
text-align: center;
}
.about-content p {
font-size: 1.125rem;
line-height: 1.8;
margin-bottom: 3rem;
}
.about-stats {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 2rem;
}
.stat {
display: flex;
flex-direction: column;
}
.stat-number {
font-size: 2.5rem;
font-weight: 700;
font-family: var(--font-heading);
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.stat-label {
color: var(--text-secondary);
font-size: 0.875rem;
}
/* Animations */
@keyframes pulse {
0%, 100% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
}
@keyframes float {
0%, 100% {
transform: translate(0, 0) rotate(0deg);
}
25% {
transform: translate(100px, -100px) rotate(90deg);
}
50% {
transform: translate(-50px, -200px) rotate(180deg);
}
75% {
transform: translate(-150px, -100px) rotate(270deg);
}
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.animate-on-scroll {
opacity: 0;
transform: translateY(30px);
transition: all 0.6s ease;
}
.animate-on-scroll.visible {
opacity: 1;
transform: translateY(0);
}
/* Mobile Responsive */
@media (max-width: 768px) {
.desktop-nav {
display: none;
}
.mobile-menu-toggle {
display: flex;
}
.timer-container {
padding: 2rem 1rem;
}
.countdown-display {
grid-template-columns: repeat(2, 1fr);
gap: 1.5rem;
}
.countdown-number {
font-size: 1.5rem;
}
.progress-ring {
width: 100px;
height: 100px;
}
.progress-ring-circle {
r: 42;
cx: 50;
cy: 50;
stroke-dasharray: 263.89;
stroke-dashoffset: 263.89;
}
}
@media (max-width: 480px) {
.hero {
padding: 6rem 0 3rem;
}
.timer-controls {
flex-direction: column;
width: 100%;
}
.datetime-input,
.btn {
width: 100%;
}
}
// Theme Management
const themeToggle = document.querySelector('.theme-toggle');
const body = document.body;
const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)');
// Load saved theme or use system preference
function loadTheme() {
const savedTheme = localStorage.getItem('theme');
if (savedTheme) {
body.classList.toggle('dark-mode', savedTheme === 'dark');
} else {
body.classList.toggle('dark-mode', prefersDarkScheme.matches);
}
}
// Save theme preference
function saveTheme() {
const isDarkMode = body.classList.contains('dark-mode');
localStorage.setItem('theme', isDarkMode ? 'dark' : 'light');
}
// Theme toggle functionality
themeToggle.addEventListener('click', () => {
body.classList.toggle('dark-mode');
saveTheme();
});
// Mobile Menu
const mobileMenuToggle = document.querySelector('.mobile-menu-toggle');
const mobileNav = document.querySelector('.mobile-nav');
mobileMenuToggle.addEventListener('click', () => {
mobileNav.classList.toggle('active');
mobileMenuToggle.classList.toggle('active');
});
// Navigation Active State
const sections = document.querySelectorAll('section[id]');
const navLinks = document.querySelectorAll('.nav-link');
function updateActiveNav() {
const scrollY = window.pageYOffset;
sections.forEach(section => {
const sectionHeight = section.offsetHeight;
const sectionTop = section.offsetTop - 100;
const sectionId = section.getAttribute('id');
if (scrollY > sectionTop && scrollY <= sectionTop + sectionHeight) {
navLinks.forEach(link => {
link.classList.remove('active');
if (link.getAttribute('href') === `#${sectionId}`) {
link.classList.add('active');
}
});
}
});
}
// Smooth Scrolling
navLinks.forEach(link => {
link.addEventListener('click', (e) => {
e.preventDefault();
const targetId = link.getAttribute('href');
const targetSection = document.querySelector(targetId);
if (targetSection) {
targetSection.scrollIntoView({ behavior: 'smooth', block: 'start' });
// Close mobile menu if open
if (mobileNav.classList.contains('active')) {
mobileNav.classList.remove('active');
mobileMenuToggle.classList.remove('active');
}
}
});
});
// Intersection Observer for animations
const observerOptions = {
threshold: 0.1,
rootMargin: '0px 0px -50px 0px'
};
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('visible');
}
});
}, observerOptions);
document.querySelectorAll('.animate-on-scroll').forEach(el => {
observer.observe(el);
});
// Countdown Timer Functionality
let countdownInterval;
let targetDate;
const startTimerBtn = document.getElementById('start-timer');
const datetimePicker = document.getElementById('datetime-picker');
const eventNameInput = document.getElementById('event-name');
// Set minimum date to current date
const now = new Date();
const minDate = now.toISOString().slice(0, 16);
datetimePicker.min = minDate;
// Progress circle elements
const circles = {
days: document.getElementById('days-circle'),
hours: document.getElementById('hours-circle'),
minutes: document.getElementById('minutes-circle'),
seconds: document.getElementById('seconds-circle')
};
// Set up circle properties
Object.values(circles).forEach(circle => {
const radius = circle.r.baseVal.value;
const circumference = radius * 2 * Math.PI;
circle.style.strokeDasharray = `${circumference} ${circumference}`;
circle.style.strokeDashoffset = circumference;
});
function updateCountdown() {
const now = new Date().getTime();
const distance = targetDate - now;
if (distance < 0) {
clearInterval(countdownInterval);
document.getElementById('days').textContent = '00';
document.getElementById('hours').textContent = '00';
document.getElementById('minutes').textContent = '00';
document.getElementById('seconds').textContent = '00';
// Reset circles
Object.values(circles).forEach(circle => {
const radius = circle.r.baseVal.value;
const circumference = radius * 2 * Math.PI;
circle.style.strokeDashoffset = circumference;
});
// Show completion message
showNotification('🎉 Countdown Complete! 🎉');
return;
}
const days = Math.floor(distance / (1000 * 60 * 60 * 24));
const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Update numbers with animation
updateNumber('days', days);
updateNumber('hours', hours);
updateNumber('minutes', minutes);
updateNumber('seconds', seconds);
// Update progress circles
updateCircle(circles.days, days, 365);
updateCircle(circles.hours, hours, 24);
updateCircle(circles.minutes, minutes, 60);
updateCircle(circles.seconds, seconds, 60);
}
function updateNumber(id, value) {
const element = document.getElementById(id);
const currentValue = parseInt(element.textContent);
const newValue = String(value).padStart(2, '0');
if (currentValue !== value) {
element.style.transform = 'scale(1.2)';
setTimeout(() => {
element.textContent = newValue;
element.style.transform = 'scale(1)';
}, 150);
}
}
function updateCircle(circle, value, max) {
const radius = circle.r.baseVal.value;
const circumference = radius * 2 * Math.PI;
const offset = circumference - (value / max) * circumference;
circle.style.strokeDashoffset = offset;
}
startTimerBtn.addEventListener('click', () => {
const selectedDate = datetimePicker.value;
if (!selectedDate) {
showNotification('Please select a date and time');
return;
}
targetDate = new Date(selectedDate).getTime();
if (targetDate <= new Date().getTime()) {
showNotification('Please select a future date');
return;
}
// Clear any existing interval
if (countdownInterval) {
clearInterval(countdownInterval);
}
// Start countdown
updateCountdown();
countdownInterval = setInterval(updateCountdown, 1000);
// Save event name if provided
const eventName = eventNameInput.value.trim();
if (eventName) {
localStorage.setItem('eventName', eventName);
localStorage.setItem('targetDate', targetDate);
}
showNotification('⏰ Countdown started!');
});
// Preset functionality
const presetCards = document.querySelectorAll('.preset-card');
presetCards.forEach(card => {
card.addEventListener('click', () => {
const preset = card.dataset.preset;
const now = new Date();
let presetDate;
switch(preset) {
case 'new-year':
presetDate = new Date(now.getFullYear() + 1, 0, 1);
eventNameInput.value = "New Year's Eve";
break;
case 'ramadan':
// Approximate date - would need Islamic calendar calculation for accuracy
presetDate = new Date(2025, 2, 1); // March 1, 2025 (approximate)
eventNameInput.value = "Ramadan";
break;
case 'birthday':
// Set to next month same day
presetDate = new Date(now.getFullYear(), now.getMonth() + 1, now.getDate());
eventNameInput.value = "Birthday";
break;
case 'christmas':
presetDate = new Date(now.getFullYear(), 11, 25);
if (presetDate <= now) {
presetDate = new Date(now.getFullYear() + 1, 11, 25);
}
eventNameInput.value = "Christmas";
break;
}
// Set the datetime picker value
const dateString = presetDate.toISOString().slice(0, 16);
datetimePicker.value = dateString;
// Auto-start the countdown
startTimerBtn.click();
// Smooth scroll to timer
document.querySelector('.timer-section').scrollIntoView({ behavior: 'smooth' });
});
});
// Notification System
function showNotification(message) {
const notification = document.createElement('div');
notification.className = 'notification';
notification.textContent = message;
notification.style.cssText = `
position: fixed;
top: 100px;
left: 50%;
transform: translateX(-50%);
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
color: white;
padding: 1rem 2rem;
border-radius: 0.5rem;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
z-index: 10000;
animation: slideInDown 0.3s ease, slideOutUp 0.3s ease 2.7s;
`;
document.body.appendChild(notification);
setTimeout(() => {
notification.remove();
}, 3000);
}
// Add notification animations
const style = document.createElement('style');
style.textContent = `
@keyframes slideInDown {
from {
transform: translateX(-50%) translateY(-100px);
opacity: 0;
}
to {
transform: translateX(-50%) translateY(0);
opacity: 1;
}
}
@keyframes slideOutUp {
from {
transform: translateX(-50%) translateY(0);
opacity: 1;
}
to {
transform: translateX(-50%) translateY(-100px);
opacity: 0;
}
}
`;
document.head.appendChild(style);
// Load saved countdown on page load
window.addEventListener('load', () => {
loadTheme();
const savedEventName = localStorage.getItem('eventName');
const savedTargetDate = localStorage.getItem('targetDate');
if (savedEventName && savedTargetDate) {
eventNameInput.value = savedEventName;
targetDate = parseInt(savedTargetDate);
if (targetDate > new Date().getTime()) {
const date = new Date(targetDate);
datetimePicker.value = date.toISOString().slice(0, 16);
updateCountdown();
countdownInterval = setInterval(updateCountdown, 1000);
}
}
});
// Update active navigation on scroll
window.addEventListener('scroll', updateActiveNav);
window.addEventListener('load', updateActiveNav);
// Add tilt effect to cards on hover
const tiltElements = document.querySelectorAll('.preset-card, .feature-card');
tiltElements.forEach(element => {
element.addEventListener('mousemove', (e) => {
const rect = element.getBoundingClientRect();
const x = e.clientX - rect.left;
const y = e.clientY - rect.top;
const centerX = rect.width / 2;
const centerY = rect.height / 2;
const rotateX = (y - centerY) / 10;
const rotateY = (centerX - x) / 10;
element.style.transform = `perspective(1000px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) translateZ(10px)`;
});
element.addEventListener('mouseleave', () => {
element.style.transform = 'perspective(1000px) rotateX(0) rotateY(0) translateZ(0)';
});
});