<section class="hero-section">
<div class="hero-background">
<div class="floating-shapes">
<div class="shape shape-1"></div>
<div class="shape shape-2"></div>
<div class="shape shape-3"></div>
<div class="shape shape-4"></div>
<div class="shape shape-5"></div>
</div>
</div>
<div class="hero-content">
<div class="hero-text">
<h1 class="hero-title">
<span class="title-line">Build Amazing</span>
<span class="title-line highlight">Web Experiences</span>
</h1>
<p class="hero-subtitle">
Create stunning websites with modern design patterns and cutting-edge technologies
</p>
</div>
<div class="hero-actions">
<button class="cta-primary">Get Started</button>
<button class="cta-secondary">
<span class="play-icon">▶</span>
Watch Demo
</button>
</div>
<div class="hero-stats">
<div class="stat-item">
<span class="stat-number" data-target="10000">0</span>
<span class="stat-label">Happy Clients</span>
</div>
<div class="stat-item">
<span class="stat-number" data-target="500">0</span>
<span class="stat-label">Projects Done</span>
</div>
<div class="stat-item">
<span class="stat-number" data-target="50">0</span>
<span class="stat-label">Team Members</span>
</div>
</div>
</div>
</section>
.hero-section {
position: relative;
min-height: 350px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
border-radius: 15px;
color: white;
}
.hero-background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
.floating-shapes {
position: relative;
width: 100%;
height: 100%;
}
.shape {
position: absolute;
background: rgba(255, 255, 255, 0.1);
border-radius: 50%;
animation: float 6s ease-in-out infinite;
}
.shape-1 {
width: 80px;
height: 80px;
top: 20%;
left: 10%;
animation-delay: 0s;
}
.shape-2 {
width: 60px;
height: 60px;
top: 60%;
left: 80%;
animation-delay: 1s;
}
.shape-3 {
width: 40px;
height: 40px;
top: 30%;
left: 70%;
animation-delay: 2s;
}
.shape-4 {
width: 100px;
height: 100px;
top: 70%;
left: 20%;
animation-delay: 3s;
}
.shape-5 {
width: 50px;
height: 50px;
top: 10%;
left: 50%;
animation-delay: 4s;
}
@keyframes float {
0%, 100% {
transform: translateY(0px) rotate(0deg);
opacity: 0.7;
}
50% {
transform: translateY(-20px) rotate(180deg);
opacity: 1;
}
}
.hero-content {
position: relative;
z-index: 2;
text-align: center;
max-width: 800px;
padding: 40px 20px;
}
.hero-title {
font-size: 3rem;
font-weight: 700;
margin: 0 0 20px 0;
line-height: 1.2;
}
.title-line {
display: block;
opacity: 0;
transform: translateY(30px);
animation: slideInUp 0.8s ease-out forwards;
}
.title-line:nth-child(2) {
animation-delay: 0.3s;
}
.highlight {
background: linear-gradient(45deg, #ffd700, #ffed4e);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.hero-subtitle {
font-size: 1.2rem;
margin: 0 0 40px 0;
opacity: 0.9;
line-height: 1.6;
opacity: 0;
transform: translateY(20px);
animation: slideInUp 0.8s ease-out 0.6s forwards;
}
.hero-actions {
display: flex;
gap: 20px;
justify-content: center;
margin-bottom: 50px;
flex-wrap: wrap;
opacity: 0;
transform: translateY(20px);
animation: slideInUp 0.8s ease-out 0.9s forwards;
}
.cta-primary, .cta-secondary {
padding: 15px 30px;
border: none;
border-radius: 50px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
gap: 10px;
}
.cta-primary {
background: rgba(255, 255, 255, 0.9);
color: #333;
}
.cta-primary:hover {
background: white;
transform: translateY(-3px);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
.cta-secondary {
background: transparent;
color: white;
border: 2px solid rgba(255, 255, 255, 0.3);
backdrop-filter: blur(10px);
}
.cta-secondary:hover {
background: rgba(255, 255, 255, 0.1);
border-color: rgba(255, 255, 255, 0.5);
transform: translateY(-3px);
}
.play-icon {
font-size: 12px;
}
.hero-stats {
display: flex;
justify-content: center;
gap: 40px;
flex-wrap: wrap;
opacity: 0;
transform: translateY(20px);
animation: slideInUp 0.8s ease-out 1.2s forwards;
}
.stat-item {
text-align: center;
}
.stat-number {
display: block;
font-size: 2rem;
font-weight: 700;
margin-bottom: 5px;
}
.stat-label {
font-size: 0.9rem;
opacity: 0.8;
text-transform: uppercase;
letter-spacing: 1px;
}
@keyframes slideInUp {
to {
opacity: 1;
transform: translateY(0);
}
}
/* Responsive design */
@media (max-width: 768px) {
.hero-title {
font-size: 2.5rem;
}
.hero-subtitle {
font-size: 1.1rem;
}
.hero-actions {
flex-direction: column;
align-items: center;
}
.cta-primary, .cta-secondary {
width: 200px;
justify-content: center;
}
.hero-stats {
gap: 30px;
}
.stat-number {
font-size: 1.5rem;
}
}
@media (max-width: 480px) {
.hero-content {
padding: 30px 15px;
}
.hero-title {
font-size: 2rem;
}
.hero-subtitle {
font-size: 1rem;
}
.hero-stats {
gap: 20px;
}
}
document.addEventListener('DOMContentLoaded', function() {
// Animate counter numbers
const statNumbers = document.querySelectorAll('.stat-number');
function animateCounter(element) {
const target = parseInt(element.getAttribute('data-target'));
const duration = 2000; // 2 seconds
const increment = target / (duration / 16); // 60fps
let current = 0;
const timer = setInterval(() => {
current += increment;
if (current >= target) {
current = target;
clearInterval(timer);
}
// Format number with commas
element.textContent = Math.floor(current).toLocaleString();
}, 16);
}
// Start counter animation with delay
setTimeout(() => {
statNumbers.forEach((stat, index) => {
setTimeout(() => {
animateCounter(stat);
}, index * 200);
});
}, 1500);
// Button interactions
const ctaPrimary = document.querySelector('.cta-primary');
const ctaSecondary = document.querySelector('.cta-secondary');
ctaPrimary.addEventListener('click', function() {
// Add click animation
this.style.transform = 'scale(0.95)';
setTimeout(() => {
this.style.transform = '';
}, 150);
console.log('Primary CTA clicked!');
// Add your action here
});
ctaSecondary.addEventListener('click', function() {
// Add click animation
this.style.transform = 'scale(0.95)';
setTimeout(() => {
this.style.transform = '';
}, 150);
console.log('Secondary CTA clicked!');
// Add your action here (e.g., open video modal)
});
// Add parallax effect to floating shapes
const shapes = document.querySelectorAll('.shape');
document.addEventListener('mousemove', function(e) {
const mouseX = e.clientX / window.innerWidth;
const mouseY = e.clientY / window.innerHeight;
shapes.forEach((shape, index) => {
const speed = (index + 1) * 0.5;
const x = (mouseX - 0.5) * speed * 20;
const y = (mouseY - 0.5) * speed * 20;
shape.style.transform = `translate(${x}px, ${y}px)`;
});
});
// Reset shapes position when mouse leaves
document.addEventListener('mouseleave', function() {
shapes.forEach(shape => {
shape.style.transform = 'translate(0, 0)';
});
});
// Add scroll indicator (if needed)
const heroSection = document.querySelector('.hero-section');
// Optional: Add scroll down indicator
const scrollIndicator = document.createElement('div');
scrollIndicator.innerHTML = `
<div style="
position: absolute;
bottom: 30px;
left: 50%;
transform: translateX(-50%);
color: rgba(255, 255, 255, 0.7);
animation: bounce 2s infinite;
cursor: pointer;
">
<div style="font-size: 12px; margin-bottom: 5px;">Scroll Down</div>
<div style="font-size: 20px;">↓</div>
</div>
`;
heroSection.appendChild(scrollIndicator);
// Add bounce animation
const bounceAnimation = `
@keyframes bounce {
0%, 20%, 50%, 80%, 100% {
transform: translateX(-50%) translateY(0);
}
40% {
transform: translateX(-50%) translateY(-10px);
}
60% {
transform: translateX(-50%) translateY(-5px);
}
}
`;
const styleSheet = document.createElement('style');
styleSheet.textContent = bounceAnimation;
document.head.appendChild(styleSheet);
});