Features
- Responsive Design: Works on mobile, tablet, and desktop screens
- Modern Gradient Background: Eye-catching dark gradient background
- Dynamic Countdown Timer: Shows days, hours, minutes, and seconds until launch
- Email Subscription Form: With validation and notification
- Social Media Links: Using Font Awesome icons
- Smooth Animations: Fade-in on load and hover effects
- Clean Typography: Using Google's Poppins font
- Accessibility: Proper aria-labels for social icons
How to Use
Simply copy and paste the entire code into an HTML file and open it in a browser. The template is ready to use as-is, but you can customize:
- Change the launch date in the JavaScript (line 224)
- Update the brand name and logo
- Modify the description text
- Add your actual social media links
- Adjust colors in the CSS to match your brand
The template includes all necessary CDN links for fonts and icons, so no additional files are required.
/* CSS Reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Poppins', sans-serif;
background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
color: #fff;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
opacity: 0;
animation: fadeIn 1s ease-in-out forwards;
}
@keyframes fadeIn {
to {
opacity: 1;
}
}
.container {
max-width: 800px;
width: 100%;
text-align: center;
padding: 40px 20px;
}
.logo {
font-size: 2.5rem;
font-weight: 700;
margin-bottom: 20px;
color: #fff;
text-decoration: none;
display: inline-block;
}
.logo span {
color: #4cc9f0;
}
h1 {
font-size: 3rem;
margin-bottom: 20px;
background: linear-gradient(to right, #4cc9f0, #f72585);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
.description {
font-size: 1.2rem;
line-height: 1.6;
margin-bottom: 40px;
max-width: 600px;
margin-left: auto;
margin-right: auto;
opacity: 0.9;
}
.countdown {
display: flex;
justify-content: center;
gap: 15px;
margin-bottom: 40px;
flex-wrap: wrap;
}
.countdown-item {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border-radius: 10px;
padding: 20px 15px;
min-width: 100px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.countdown-number {
font-size: 2.5rem;
font-weight: 700;
margin-bottom: 5px;
}
.countdown-label {
font-size: 0.9rem;
opacity: 0.8;
text-transform: uppercase;
letter-spacing: 1px;
}
.subscribe {
max-width: 500px;
margin: 0 auto 40px;
position: relative;
}
.subscribe input {
width: 100%;
padding: 15px 20px;
border: none;
border-radius: 50px;
font-size: 1rem;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(5px);
color: #fff;
outline: none;
transition: all 0.3s ease;
}
.subscribe input::placeholder {
color: rgba(255, 255, 255, 0.7);
}
.subscribe input:focus {
background: rgba(255, 255, 255, 0.2);
}
.subscribe button {
position: absolute;
right: 5px;
top: 5px;
bottom: 5px;
padding: 0 25px;
border: none;
border-radius: 50px;
background: linear-gradient(to right, #4cc9f0, #f72585);
color: #fff;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
}
.subscribe button:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.social-icons {
display: flex;
justify-content: center;
gap: 20px;
}
.social-icons a {
color: #fff;
font-size: 1.5rem;
width: 50px;
height: 50px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(5px);
transition: all 0.3s ease;
text-decoration: none;
}
.social-icons a:hover {
background: linear-gradient(to right, #4cc9f0, #f72585);
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}
/* Responsive adjustments */
@media (max-width: 768px) {
h1 {
font-size: 2.5rem;
}
.description {
font-size: 1rem;
}
.countdown-item {
min-width: 80px;
padding: 15px 10px;
}
.countdown-number {
font-size: 2rem;
}
}
@media (max-width: 480px) {
.logo {
font-size: 2rem;
}
h1 {
font-size: 2rem;
}
.countdown {
gap: 10px;
}
.countdown-item {
min-width: 70px;
padding: 10px 5px;
}
.countdown-number {
font-size: 1.5rem;
}
.countdown-label {
font-size: 0.7rem;
}
.subscribe button {
padding: 0 15px;
font-size: 0.9rem;
}
}
// Set the launch date (YYYY, MM-1, DD, HH, MM, SS)
const launchDate = new Date(2024, 11, 31, 0, 0, 0).getTime();
// Update the countdown every second
const countdown = setInterval(function() {
const now = new Date().getTime();
const distance = launchDate - now;
// Calculate days, hours, minutes, seconds
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);
// Display the result
document.getElementById('days').innerHTML = days.toString().padStart(2, '0');
document.getElementById('hours').innerHTML = hours.toString().padStart(2, '0');
document.getElementById('minutes').innerHTML = minutes.toString().padStart(2, '0');
document.getElementById('seconds').innerHTML = seconds.toString().padStart(2, '0');
// If countdown is finished
if (distance < 0) {
clearInterval(countdown);
document.querySelector('.countdown').innerHTML = 'We\'re Live!';
}
}, 1000);
// Email subscription handling
document.querySelector('.subscribe button').addEventListener('click', function() {
const emailInput = document.querySelector('.subscribe input');
const email = emailInput.value.trim();
if (email && validateEmail(email)) {
alert('Thank you for subscribing! We\'ll notify you when we launch.');
emailInput.value = '';
} else {
alert('Please enter a valid email address.');
}
});
// Email validation function
function validateEmail(email) {
const re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return re.test(email);
}
إرسال تعليق
Thank you
Learning robo team