Sure! I'll help you enhance your hero section by removing the white circle effect and adding more interactive animations and features to make the design even more engaging. Below is the updated code with these improvements:
html Copy code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Interactive Hero Section</title>
<style>
/* Global Styles */
:root {
--c-gold: #D1C287;
--c-white: #ffffff;
--c-gradient: linear-gradient(45deg, #4F3F02, #D1C287);
--f-primary: 'Poppins', sans-serif;
--s-border-radius: 8px;
--transition-speed: 0.3s;
--particle-count: 30; /* Increased for a richer background */
--bg-gradient-start: #1e3c72;
--bg-gradient-end: #2a5298;
}
/* Reset and Box-Sizing */
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body, html {
height: 100%;
font-family: var(--f-primary);
background: var(--c-gradient);
background-size: 400% 400%;
animation: backgroundAnimation 15s ease infinite;
}
/* Background Gradient Animation */
@keyframes backgroundAnimation {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
/* Hero Container */
.hero-container {
display: flex;
align-items: center;
justify-content: center;
position: relative;
overflow: hidden;
color: var(--c-white);
padding: 2rem 1rem;
height: 100vh;
}
/* Particle Container */
.particle-container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
pointer-events: none;
z-index: 1;
}
/* Particle Lines */
.particle-lines {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 0;
pointer-events: none;
}
/* Hero Content */
.hero-content {
padding: 4rem 1.5rem;
position: relative;
z-index: 2;
text-align: center;
max-width: 800px;
margin: auto;
opacity: 0;
transform: translateY(20px);
animation: fadeInUp 1s ease forwards;
animation-delay: 0.5s;
}
/* Subtitle */
.hero-subtitle {
color: var(--c-gold);
font-size: 1.2rem;
font-weight: 600;
text-transform: uppercase;
margin-bottom: 1rem;
opacity: 0;
transform: translateY(20px);
animation: fadeInUp 1s ease forwards;
animation-delay: 0.7s;
}
/* Divider Line */
.divider {
width: 50%;
height: 2px;
background: var(--c-gold);
margin: 0 auto 1.5rem auto;
opacity: 0;
transform: scaleX(0);
animation: growX 1s ease forwards;
animation-delay: 0.9s;
}
/* Main Title */
.hero-title {
font-family: var(--f-primary);
font-size: 3rem;
line-height: 1.2;
color: var(--c-white);
margin-bottom: 1.5rem;
position: relative;
display: inline-block;
opacity: 0;
transform: translateY(20px);
animation: fadeInUp 1s ease forwards;
animation-delay: 1.1s;
font-weight: 700;
}
/* Description */
.hero-description {
font-size: 1.1rem;
color: var(--c-white);
opacity: 0;
margin-bottom: 2rem;
transform: translateY(20px);
animation: fadeInUp 1s ease forwards;
animation-delay: 1.3s;
line-height: 1.6;
}
/* Call-to-Action Button */
.hero-cta {
background: var(--c-gradient);
color: var(--c-white);
padding: 0.8rem 2rem;
font-weight: 600;
border-radius: var(--s-border-radius);
text-decoration: none;
display: inline-block;
transition: transform var(--transition-speed), box-shadow var(--transition-speed), opacity var(--transition-speed);
opacity: 0;
transform: scale(0.9);
animation: fadeIn 1s ease forwards;
animation-delay: 1.5s;
position: relative;
overflow: hidden;
cursor: pointer;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.hero-cta:hover {
transform: scale(1);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}
/* Fade In Animation */
@keyframes fadeIn {
to { opacity: 1; }
}
/* Fade In Up Animation */
@keyframes fadeInUp {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
/* Grow X Animation for Divider */
@keyframes growX {
from { transform: scaleX(0); }
to { transform: scaleX(1); }
}
/* Floating Particles */
.floating-particle {
position: absolute;
width: 40px;
height: 40px;
opacity: 0.1;
pointer-events: none;
animation: float 20s linear infinite, rotate 10s linear infinite;
}
.dna, .heart, .stethoscope {
fill: var(--c-gold);
opacity: 0.1;
width: 40px;
height: 40px;
}
/* Animations */
@keyframes float {
0% { transform: translateY(0) scale(1); opacity: 0.1; }
50% { transform: translateY(-30px) scale(1.1); opacity: 0.2; }
100% { transform: translateY(0) scale(1); opacity: 0.1; }
}
@keyframes rotate {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
/* Interactive Particle Hover Effect */
.hero-container:hover .floating-particle {
animation-play-state: running;
}
.floating-particle:hover {
transform: scale(1.5) rotate(360deg);
opacity: 0.5;
animation-play-state: paused;
z-index: 3;
}
/* Particle Lines */
.particle-line {
position: absolute;
background: rgba(209, 194, 135, 0.2);
width: 2px;
height: 2px;
transform-origin: top left;
pointer-events: none;
}
/* Responsive Design */
@media (min-width: 768px) {
.hero-title { font-size: 3.5rem; }
.hero-description { font-size: 1.3rem; }
}
@media (min-width: 1024px) {
.hero-title { font-size: 4rem; }
.hero-description { font-size: 1.4rem; }
}
@media (max-width: 480px) {
.hero-content {
padding: 2rem 1rem;
}
.hero-title {
font-size: 2.5rem;
}
.hero-description {
font-size: 1rem;
}
.hero-cta {
padding: 0.6rem 1.5rem;
}
}
</style>
</head>
<body>
<section class="hero-container" aria-label="Welcome to Longeva">
<div class="particle-container" id="particles"></div>
<canvas class="particle-lines" id="particleLines"></canvas>
<div class="hero-content">
<!-- Subtitle -->
<p class="hero-subtitle">Advanced Health Solutions</p>
<!-- Divider Line -->
<div class="divider"></div>
<!-- Main Title -->
<h1 class="hero-title">
We Care For You, One Cell at A Time
</h1>
<!-- Description -->
<p class="hero-description">
Luxury Concierge Medicine. <br>
Discover personalized solutions to reverse chronic conditions and break free from disease and aging with Longeva.
</p>
<!-- Call to Action Button -->
<a href="#scrollDown" class="hero-cta" aria-label="Scroll down to learn more">
Transform Your Future
</a>
</div>
</section>
<script>
// SVG Icons as Particle Data
const svgIcons = [
`<svg class="dna" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
<path d="M32 2C15.432 2 2 15.432 2 32s13.432 30 30 30 30-13.432 30-30S48.568 2 32 2zm0 58C17.664 60 4 46.336 4 32S17.664 4 32 4s28 13.664 28 28-13.664 28-28 28z"/>
<path d="M32 6C18.745 6 8 16.745 8 30s10.745 24 24 24 24-10.745 24-24S45.255 6 32 6zm0 44c-11.046 0-20-8.954-20-20S20.954 10 32 10s20 8.954 20 20-8.954 20-20 20z"/>
</svg>`,
`<svg class="heart" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 29.6">
<path d="M23.6,0c-3.4,0-6.4,1.7-8,4.3C14.8,1.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,10.1,16,21.2,16,21.2s16-11.1,16-21.2
C32,3.8,28.2,0,23.6,0z"/>
</svg>`,
`<svg class="stethoscope" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
<path d="M32 2C17.664 2 6 13.664 6 28s11.664 26 26 26 26-11.664 26-26S46.336 2 32 2zm0 48c-11.046 0-20-8.954-20-20S20.954 10 32 10s20 8.954 20 20-8.954 20-20 20z"/>
<path d="M32 16a12 12 0 100 24 12 12 0 000-24zm0 20a8 8 0 110-16 8 8 0 010 16z"/>
</svg>`
];
// Particle Class
class Particle {
constructor(svg, x, y, size, speed, direction) {
this.svg = svg;
this.x = x;
this.y = y;
this.size = size;
this.speed = speed;
this.direction = direction;
this.element = this.createElement();
}
createElement() {
const div = document.createElement('div');
div.className = 'floating-particle';
div.innerHTML = this.svg;
div.style.width = `${this.size}px`;
div.style.height = `${this.size}px`;
div.style.left = `${this.x}%`;
div.style.top = `${this.y}%`;
div.style.animationDuration = `${this.speed}s, ${this.speed / 2}s`;
div.style.animationDelay = `${Math.random() * 5}s, ${Math.random() * 5}s`;
return div;
}
}
// Create floating particles with healthcare-themed SVGs
function createParticles() {
const container = document.getElementById('particles');
const particleCount = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--particle-count')) || 30;
window.particlesList = [];
for (let i = 0; i < particleCount; i++) {
const svgIcon = svgIcons[Math.floor(Math.random() * svgIcons.length)];
const size = Math.random() * 20 + 30; // Size between 30px and 50px
const x = Math.random() * 100;
const y = Math.random() * 100;
const speed = Math.random() * 10 + 15; // Animation speed between 15-25s
const direction = Math.random() < 0.5 ? 'normal' : 'reverse';
const particle = new Particle(svgIcon, x, y, size, speed, direction);
container.appendChild(particle.element);
window.particlesList.push(particle);
}
}
// Particle Lines Connection
function connectParticles() {
const canvas = document.getElementById('particleLines');
const ctx = canvas.getContext('2d');
const particles = Array.from(document.getElementsByClassName('floating-particle'));
const maxDistance = 100;
// Resize canvas to cover the container
function resizeCanvas() {
canvas.width = canvas.offsetWidth;
canvas.height = canvas.offsetHeight;
}
resizeCanvas();
window.addEventListener('resize', resizeCanvas);
function drawLines() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
particles.forEach((p1, index) => {
const rect1 = p1.getBoundingClientRect();
const x1 = rect1.left + rect1.width / 2;
const y1 = rect1.top + rect1.height / 2;
for (let j = index + 1; j < particles.length; j++) {
const p2 = particles[j];
const rect2 = p2.getBoundingClientRect();
const x2 = rect2.left + rect2.width / 2;
const y2 = rect2.top + rect2.height / 2;
const distance = Math.hypot(x2 - x1, y2 - y1);
if (distance < maxDistance) {
const opacity = 1 - distance / maxDistance;
ctx.strokeStyle = `rgba(209, 194, 135, ${opacity})`;
ctx.lineWidth = 1;
ctx.beginPath();
ctx.moveTo(x1, y1);
ctx.lineTo(x2, y2);
ctx.stroke();
}
}
});
requestAnimationFrame(drawLines);
}
drawLines();
}
// Initialize particles and connections when the page loads
document.addEventListener('DOMContentLoaded', () => {
createParticles();
connectParticles();
setupInteractivity();
});
// Interactivity: Mouse Movement and Particle Repulsion
function setupInteractivity() {
const particleContainer = document.getElementById('particles');
const particles = Array.from(document.getElementsByClassName('floating-particle'));
// Repel particles from mouse
window.addEventListener('mousemove', (e) => {
const mouseX = e.clientX;
const mouseY = e.clientY;
particles.forEach((particle) => {
const rect = particle.getBoundingClientRect();
const px = rect.left + rect.width / 2;
const py = rect.top + rect.height / 2;
const distance = Math.hypot(px - mouseX, py - mouseY);
const maxDistance = 100;
if (distance < maxDistance) {
const angle = Math.atan2(py - mouseY, px - mouseX);
const moveX = Math.cos(angle) * (maxDistance - distance) / maxDistance * 5;
const moveY = Math.sin(angle) * (maxDistance - distance) / maxDistance * 5;
particle.style.transform += ` translate(${moveX}px, ${moveY}px)`;
}
});
});
// Reset particle positions on mouse leave
window.addEventListener('mouseleave', () => {
particles.forEach((particle) => {
particle.style.transform = '';
});
});
}
</script>
</body>
</html>
Feel free to customize the colors, particle types, and other styles further to match your brand or design preferences!