Travel Card
Preview
Edit
Download
Run
Download Options
HTML File
Download as .html file
CSS File
Download as .css file
JavaScript File
Download as .js file
Combined HTML
All code in one HTML file
Project ZIP
All files in a ZIP archive
Cancel
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Wanderlust Travel - Animated Card</title> </head> <body> <div class="travel-card"> <div class="badge">Hot Deal</div> <div class="card-image"> <div class="rating"> ⭐ 4.9 </div> <div class="floating-elements"> <div class="plane">✈️</div> <div class="clouds">☁️</div> </div> </div> <div class="card-content"> <div class="company-logo"> <div class="logo-icon">?</div> <div class="company-name">Wanderlust Travel</div> </div> <h2 class="card-title">Tropical Paradise</h2> <p class="card-subtitle">7 Days in Bali, Indonesia</p> <div class="features"> <div class="feature-item"> <div class="feature-icon">?</div> <div class="feature-text">5-Star Resort Stay</div> </div> <div class="feature-item"> <div class="feature-icon">?️</div> <div class="feature-text">All Meals Included</div> </div> <div class="feature-item"> <div class="feature-icon">?</div> <div class="feature-text">Airport Transfers</div> </div> <div class="feature-item"> <div class="feature-icon">?</div> <div class="feature-text">Water Sports Activities</div> </div> </div> <div class="price-section"> <div class="price"> <div class="price-label">Starting from</div> <div class="price-amount">$1,299</div> </div> <button class="book-btn"> <span>Book Now</span> </button> </div> </div> </div> </body> </html>
CSS
* { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; } .travel-card { width: 100%; max-width: 400px; height: 600px; background: white; border-radius: 25px; overflow: hidden; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); position: relative; cursor: pointer; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); } .travel-card:hover { transform: translateY(-10px) scale(1.02); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2); } .card-image { width: 100%; height: 250px; background: linear-gradient(45deg, rgba(102, 126, 234, 0.389), rgba(118, 75, 162, 0.331)), url('https://images.unsplash.com/photo-1469854523086-cc02fe5d8800?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Nnx8dHJhdmVsfGVufDB8fDB8fHww,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 250"><rect fill="%2367B26F" width="400" height="250"/><circle fill="%234A90E2" cx="100" cy="80" r="30"/><polygon fill="%23F5A623" points="200,50 220,90 180,90"/><polygon fill="%23F5A623" points="250,60 270,100 230,100"/><polygon fill="%23F5A623" points="300,40 320,80 280,80"/><rect fill="%237ED321" x="0" y="200" width="400" height="50"/><circle fill="%23FFFFFF" cx="320" cy="70" r="15" opacity="0.8"/><circle fill="%23FFFFFF" cx="340" cy="90" r="10" opacity="0.6"/><circle fill="%23FFFFFF" cx="360" cy="60" r="8" opacity="0.7"/></svg>'); background-size: cover; background-position: center; position: relative; overflow: hidden; } .card-image::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(45deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3)); opacity: 0; transition: opacity 0.3s ease; } .travel-card:hover .card-image::before { opacity: 1; } .floating-elements { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; } .plane { position: absolute; top: 30px; right: -50px; font-size: 24px; animation: fly 8s linear infinite; } @keyframes fly { 0% { transform: translateX(-450px) translateY(0px); } 25% { transform: translateX(-300px) translateY(-10px); } 50% { transform: translateX(-150px) translateY(5px); } 75% { transform: translateX(-50px) translateY(-5px); } 100% { transform: translateX(50px) translateY(0px); } } .clouds { position: absolute; top: 20px; left: 20px; font-size: 20px; animation: float 6s ease-in-out infinite; } @keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-10px); } } .card-content { padding: 2rem; height: 350px; display: flex; flex-direction: column; position: relative; } .company-logo { display: flex; align-items: center; margin-bottom: 1rem; animation: slideInLeft 0.6s ease-out; } .logo-icon { width: 40px; height: 40px; background: linear-gradient(45deg, #667eea, #764ba2); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-right: 0.75rem; font-size: 20px; animation: rotate 4s linear infinite; } @keyframes rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .company-name { font-size: 1.5rem; font-weight: 700; color: #2c3e50; background: linear-gradient(45deg, #667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; } .card-title { font-size: 1.8rem; font-weight: 800; color: #2c3e50; margin-bottom: 0.5rem; animation: slideInRight 0.6s ease-out 0.2s both; } .card-subtitle { font-size: 1rem; color: #7f8c8d; margin-bottom: 1.5rem; animation: slideInRight 0.6s ease-out 0.4s both; } .features { flex-grow: 1; animation: fadeInUp 0.6s ease-out 0.6s both; } .feature-item { display: flex; align-items: center; margin-bottom: 0.75rem; padding: 0.5rem; border-radius: 10px; transition: all 0.3s ease; } .feature-item:hover { background: #f8f9fa; transform: translateX(5px); } .feature-icon { width: 30px; height: 30px; background: linear-gradient(45deg, #667eea, #764ba2); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-right: 0.75rem; font-size: 14px; color: white; } .feature-text { color: #34495e; font-weight: 500; } .price-section { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; padding-top: 1rem; border-top: 2px solid #ecf0f1; animation: fadeInUp 0.6s ease-out 0.8s both; } .price { display: flex; flex-direction: column; } .price-label { font-size: 0.9rem; color: #7f8c8d; margin-bottom: 0.25rem; } .price-amount { font-size: 2rem; font-weight: 800; background: linear-gradient(45deg, #667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; } .book-btn { background: linear-gradient(45deg, #667eea, #764ba2); color: white; border: none; padding: 12px 24px; border-radius: 25px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; position: relative; overflow: hidden; } .book-btn::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(45deg, #764ba2, #667eea); transition: left 0.3s ease; } .book-btn:hover::before { left: 0; } .book-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3); } .book-btn span { position: relative; z-index: 1; } .rating { position: absolute; top: 15px; right: 15px; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px); padding: 8px 12px; border-radius: 20px; display: flex; align-items: center; font-size: 0.9rem; font-weight: 600; color: #f39c12; animation: pulse 2s ease-in-out infinite; } @keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } } .badge { position: absolute; top: -10px; left: 20px; background: linear-gradient(45deg, #e74c3c, #c0392b); color: white; padding: 8px 16px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; animation: bounce 2s ease-in-out infinite; } @keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } } @keyframes slideInLeft { 0% { transform: translateX(-50px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } } @keyframes slideInRight { 0% { transform: translateX(50px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } } @keyframes fadeInUp { 0% { transform: translateY(30px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } } /* Responsive Design */ @media (max-width: 768px) { body { padding: 1rem; } .travel-card { max-width: 350px; height: auto; min-height: 550px; } .card-image { height: 200px; } .card-content { padding: 1.5rem; height: auto; } .card-title { font-size: 1.5rem; } .price-amount { font-size: 1.7rem; } } @media (max-width: 480px) { .travel-card { max-width: 300px; } .card-content { padding: 1rem; } .card-title { font-size: 1.3rem; } .feature-item { margin-bottom: 0.5rem; } }
JavaScript
// Add interactive click effects const card = document.querySelector('.travel-card'); const bookBtn = document.querySelector('.book-btn'); // Card tilt effect on mouse move card.addEventListener('mousemove', (e) => { const rect = card.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; card.style.transform = `perspective(1000px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) translateY(-10px) scale(1.02)`; }); card.addEventListener('mouseleave', () => { card.style.transform = ''; }); // Book button click effect bookBtn.addEventListener('click', (e) => { e.preventDefault(); // Create ripple effect const ripple = document.createElement('div'); ripple.style.position = 'absolute'; ripple.style.borderRadius = '50%'; ripple.style.background = 'rgba(255, 255, 255, 0.6)'; ripple.style.transform = 'scale(0)'; ripple.style.animation = 'ripple 0.6s linear'; ripple.style.left = '50%'; ripple.style.top = '50%'; ripple.style.width = '20px'; ripple.style.height = '20px'; ripple.style.marginLeft = '-10px'; ripple.style.marginTop = '-10px'; bookBtn.appendChild(ripple); setTimeout(() => { ripple.remove(); }, 600); // Show booking confirmation bookBtn.innerHTML = '<span>✓ Booked!</span>'; bookBtn.style.background = 'linear-gradient(45deg, #27ae60, #2ecc71)'; setTimeout(() => { bookBtn.innerHTML = '<span>Book Now</span>'; bookBtn.style.background = 'linear-gradient(45deg, #667eea, #764ba2)'; }, 2000); }); // Add CSS for ripple animation const style = document.createElement('style'); style.textContent = ` @keyframes ripple { to { transform: scale(4); opacity: 0; } } `; document.head.appendChild(style);
Output Preview
Desktop
Mobile
Fullscreen