<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Beating Heart Animation</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { display: flex; justify-content: center; align-items: center; min-height: 100vh; overflow: hidden; } .container { text-align: center; position: relative; } .heart { position: relative; width: 200px; height: 200px; margin: 0 auto; animation: heartbeat 1.2s ease-in-out infinite; } .heart::before, .heart::after { content: ""; position: absolute; top: 0; width: 100px; height: 160px; background: #d00000; border-radius: 100px 100px 0 0; box-shadow: 0 0 30px rgba(208, 0, 0, 0.5); } .heart::before { left: 100px; transform: rotate(-45deg); transform-origin: 0 100%; } .heart::after { left: 0; transform: rotate(45deg); transform-origin: 100% 100%; } @keyframes heartbeat { 0% { transform: scale(1); } 10% { transform: scale(1.1); } 20% { transform: scale(1); } 30% { transform: scale(1.1); } 40% { transform: scale(1); } 100% { transform: scale(1); } } .pulse-ring { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 200px; height: 200px; border: 3px solid #d00000; border-radius: 50%; animation: pulse 1.2s ease-out infinite; opacity: 0; pointer-events: none; } .pulse-ring:nth-child(2) { animation-delay: 0.4s; } .pulse-ring:nth-child(3) { animation-delay: 0.8s; } @keyframes pulse { 0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; } 50% { opacity: 0.8; } 100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; } } .text { margin-top: 80px; color: #d00000; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 2rem; font-weight: 300; letter-spacing: 3px; text-shadow: 0 0 20px rgba(208, 0, 0, 0.5); animation: textPulse 1.2s ease-in-out infinite; } @keyframes textPulse { 0%, 40%, 100% { opacity: 0.7; } 10%, 30% { opacity: 1; } } .particles { position: absolute; width: 100%; height: 100%; pointer-events: none; } .particle { position: absolute; width: 8px; height: 8px; background: #d00000; border-radius: 50%; opacity: 0; animation: float 3s ease-in-out infinite; } .particle:nth-child(1) { left: 20%; animation-delay: 0s; } .particle:nth-child(2) { left: 40%; animation-delay: 0.5s; } .particle:nth-child(3) { left: 60%; animation-delay: 1s; } .particle:nth-child(4) { left: 80%; animation-delay: 1.5s; } @keyframes float { 0% { bottom: 0; opacity: 0; transform: translateX(0) scale(1); } 50% { opacity: 1; } 100% { bottom: 100%; opacity: 0; transform: translateX(100px) scale(0.5); } } @media (max-width: 600px) { .heart { width: 150px; height: 150px; } .heart::before, .heart::after { width: 75px; height: 120px; } .heart::before { left: 75px; } .pulse-ring { width: 150px; height: 150px; } .text { font-size: 1.5rem; margin-top: 60px; } } </style> </head> <body> <div class="particles"> <div class="particle"></div> <div class="particle"></div> <div class="particle"></div> <div class="particle"></div> </div> <div class="container"> <div class="heart"> <div class="pulse-ring"></div> <div class="pulse-ring"></div> <div class="pulse-ring"></div> </div> <div class="text">HEARTBEAT</div> </div> </body> </html>
Login to leave a comment
No comments yet. Be the first!
View Project
No comments yet. Be the first!