Sure! Below is the code for a gym business card website in one HTML file. It includes HTML, CSS, and JavaScript all in a single file, utilizes modern styles and animations, and contains over 600 lines of code. Save this code as an .html file and open it in your browser to view the site.
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta Data -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ultimate Fitness Gym</title>
<!-- Styles -->
<style>
/* Reset Styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* Base Styles */
body {
font-family: 'Arial', sans-serif;
line-height: 1.6;
color: #333;
background-color: #fff;
}
a {
color: inherit;
text-decoration: none;
}
img {
max-width: 100%;
height: auto;
}
/* Header Styles */
header {
position: fixed;
width: 100%;
top: 0;
left: 0;
background: rgba(0,0,0,0.7);
z-index: 1000;
transition: background 0.3s ease-in-out;
}
header.scrolled {
background: #000;
}
.container {
width: 90%;
margin: auto;
overflow: hidden;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
height: 60px;
}
.logo {
font-size: 1.5em;
color: #fff;
font-weight: bold;
text-transform: uppercase;
}
.menu {
list-style: none;
display: flex;
}
.menu li {
margin-left: 30px;
}
.menu a {
color: #fff;
text-transform: uppercase;
font-weight: bold;
transition: color 0.3s ease-in-out;
}
.menu a:hover {
color: #f4c10f;
}
.menu-btn {
display: none;
font-size: 1.5em;
color: #fff;
cursor: pointer;
}
/* Hero Section Styles */
.hero {
background: url('https://images.unsplash.com/photo-1571019613475-1b61b06dc4d6?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80') no-repeat center center/cover;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.hero-content {
text-align: center;
color: #fff;
animation: fadeInDown 2s;
}
.hero-content h1 {
font-size: 4em;
margin-bottom: 20px;
}
.hero-content p {
font-size: 1.5em;
margin-bottom: 40px;
}
.btn {
display: inline-block;
padding: 15px 30px;
background: #f4c10f;
color: #000;
text-transform: uppercase;
font-weight: bold;
border-radius: 5px;
transition: background 0.3s ease-in-out;
}
.btn:hover {
background: #d4a10b;
}
/* Keyframe Animations */
@keyframes fadeInDown {
from {
opacity: 0;
transform: translateY(-50px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* About Section Styles */
#about {
padding: 100px 0;
background: #f9f9f9;
}
#about .content {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
}
#about .content .about-image {
flex: 1;
min-width: 300px;
margin-right: 20px;
animation: fadeInLeft 1.5s;
}
#about .content .about-text {
flex: 2;
min-width: 300px;
animation: fadeInRight 1.5s;
}
#about .content .about-text h2 {
font-size: 2.5em;
margin-bottom: 20px;
}
#about .content .about-text p {
font-size: 1.1em;
line-height: 1.8;
margin-bottom: 20px;
}
/* Keyframe Animations */
@keyframes fadeInLeft {
from {
opacity: 0;
transform: translateX(-50px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
@keyframes fadeInRight {
from {
opacity: 0;
transform: translateX(50px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
/* Services Section Styles */
#services {
padding: 100px 0;
}
#services h2 {
text-align: center;
font-size: 2.5em;
margin-bottom: 50px;
}
.services-container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.service {
flex: 1;
min-width: 250px;
margin: 20px;
text-align: center;
padding: 20px;
background: #fff;
border-radius: 10px;
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
transition: transform 0.3s ease-in-out;
}
.service:hover {
transform: translateY(-10px);
}
.service i {
font-size: 3em;
margin-bottom: 20px;
color: #f4c10f;
}
.service h3 {
font-size: 1.5em;
margin-bottom: 15px;
}
.service p {
font-size: 1em;
line-height: 1.6;
}
/* Trainers Section Styles */
#trainers {
padding: 100px 0;
background: #f9f9f9;
}
#trainers h2 {
text-align: center;
font-size: 2.5em;
margin-bottom: 50px;
}
.trainers-container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.trainer {
flex: 1;
min-width: 250px;
margin: 20px;
text-align: center;
padding: 20px;
background: #fff;
border-radius: 10px;
transition: transform 0.3s ease-in-out;
}
.trainer img {
width: 100%;
border-radius: 50%;
margin-bottom: 20px;
}
.trainer h3 {
font-size: 1.5em;
margin-bottom: 10px;
}
.trainer p {
font-size: 1em;
line-height: 1.6;
}
.trainer:hover {
transform: translateY(-10px);
}
/* Testimonials Section Styles */
#testimonials {
padding: 100px 0;
}
#testimonials h2 {
text-align: center;
font-size: 2.5em;
margin-bottom: 50px;
}
.testimonials-container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.testimonial {
flex: 1;
min-width: 300px;
margin: 20px;
padding: 30px;
background: #fff;
border-radius: 10px;
position: relative;
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
overflow: hidden;
}
.testimonial:before {
content: "\201C";
font-size: 5em;
color: #f4c10f;
position: absolute;
top: -20px;
left: -10px;
}
.testimonial p {
font-size: 1em;
line-height: 1.6;
margin-bottom: 20px;
}
.testimonial h3 {
font-size: 1.2em;
text-align: right;
color: #f4c10f;
}
/* Contact Section Styles */
#contact {
padding: 100px 0;
background: #222;
color: #fff;
}
#contact h2 {
text-align: center;
font-size: 2.5em;
margin-bottom: 50px;
color: #f4c10f;
}
.contact-form {
max-width: 600px;
margin: auto;
}
.contact-form input,
.contact-form textarea {
width: 100%;
padding: 15px;
margin-bottom: 20px;
border: none;
border-radius: 5px;
}
.contact-form button {
display: inline-block;
padding: 15px 30px;
background: #f4c10f;
color: #000;
text-transform: uppercase;
font-weight: bold;
border-radius: 5px;
cursor: pointer;
transition: background 0.3s ease-in-out;
}
.contact-form button:hover {
background: #d4a10b;
}
/* Footer Styles */
footer {
background: #000;
color: #fff;
padding: 20px 0;
text-align: center;
}
footer p {
margin: 0;
}
/* Responsive Styles */
@media (max-width: 768px) {
nav .menu {
display: none;
flex-direction: column;
background: #000;
position: absolute;
top: 60px;
right: 0;
width: 200px;
}
nav .menu li {
margin: 0;
}
nav .menu a {
padding: 15px;
display: block;
}
nav .menu-btn {
display: block;
}
#about .content {
flex-direction: column;
}
}
@media (min-width: 769px) {
nav .menu {
display: flex;
}
nav .menu-btn {
display: none;
}
}
/* Smooth Scroll */
html {
scroll-behavior: smooth;
}
</style>
</head>
<body>
<!-- Header Section -->
<header id="header">
<div class="container">
<nav>
<div class="logo">Ultimate Fitness</div>
<ul class="menu">
<li><a href="#header">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#services">Services</a></li>
<li><a href="#trainers">Trainers</a></li>
<li><a href="#testimonials">Testimonials</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
<div class="menu-btn">
<span>☰</span>
</div>
</nav>
</div>
</header>
<!-- Hero Section -->
<section class="hero">
<div class="hero-content">
<h1>Push Your Limits</h1>
<p>Join Ultimate Fitness Gym Today</p>
<a href="#contact" class="btn">Get Started</a>
</div>
</section>
<!-- About Section -->
<section id="about">
<div class="container">
<div class="content">
<div class="about-image">
<img src="https://images.unsplash.com/photo-1594737625785-73f5e1e757ce?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80" alt="About Us">
</div>
<div class="about-text">
<h2>About Us</h2>
<p>At Ultimate Fitness, we are dedicated to helping you achieve your health and fitness goals. Our state-of-the-art facilities and top-notch trainers provide an unparalleled fitness experience.</p>
<p>Whether you're a beginner or a seasoned athlete, we have something for you. Come discover what makes us the best gym in town.</p>
<a href="#services" class="btn">Our Services</a>
</div>
</div>
</div>
</section>
<!-- Services Section -->
<section id="services">
<div class="container">
<h2>Our Services</h2>
<div class="services-container">
<div class="service">
<i class="fas fa-dumbbell"></i>
<h3>Strength Training</h3>
<p>Build muscle and increase strength with our modern equipment.</p>
</div>
<div class="service">
<i class="fas fa-running"></i>
<h3>Cardio Workouts</h3>
<p>Improve your endurance with our range of cardio machines.</p>
</div>
<div class="service">
<i class="fas fa-spa"></i>
<h3>Wellness Programs</h3>
<p>Take care of your mind and body with our holistic wellness services.</p>
</div>
</div>
</div>
</section>
<!-- Trainers Section -->
<section id="trainers">
<div class="container">
<h2>Meet Our Trainers</h2>
<div class="trainers-container">
<div class="trainer">
<img src="https://randomuser.me/api/portraits/men/32.jpg" alt="Trainer 1">
<h3>John Doe</h3>
<p>Certified Personal Trainer</p>
</div>
<div class="trainer">
<img src="https://randomuser.me/api/portraits/women/44.jpg" alt="Trainer 2">
<h3>Jane Smith</h3>
<p>Yoga & Pilates Instructor</p>
</div>
<div class="trainer">
<img src="https://randomuser.me/api/portraits/men/65.jpg" alt="Trainer 3">
<h3>Mike Johnson</h3>
<p>HIIT Specialist</p>
</div>
</div>
</div>
</section>
<!-- Testimonials Section -->
<section id="testimonials">
<div class="container">
<h2>What Our Members Say</h2>
<div class="testimonials-container">
<div class="testimonial">
<p>"Joining Ultimate Fitness was the best decision I ever made. The trainers are amazing and the community is so supportive."</p>
<h3>- Emily R.</h3>
</div>
<div class="testimonial">
<p>"The facilities are top-notch and always clean. I love the variety of equipment and classes available."</p>
<h3>- David K.</h3>
</div>
<div class="testimonial">
<p>"I've achieved fitness goals I never thought possible thanks to the personalized attention from the trainers."</p>
<h3>- Sarah L.</h3>
</div>
</div>
</div>
</section>
<!-- Contact Section -->
<section id="contact">
<div class="container">
<h2>Contact Us</h2>
<div class="contact-form">
<form id="contactForm">
<input type="text" name="name" placeholder="Your Name" required="">
<input type="email" name="email" placeholder="Your Email" required="">
<textarea name="message" rows="5" placeholder="Your Message" required=""></textarea>
<button type="submit">Send Message</button>
</form>
</div>
</div>
</section>
<!-- Footer -->
<footer>
<p>© 2023 Ultimate Fitness Gym. All rights reserved.</p>
</footer>
<!-- Scripts -->
<script>
// Responsive Navigation Menu
const menuBtn = document.querySelector('.menu-btn');
const menu = document.querySelector('.menu');
menuBtn.addEventListener('click', () => {
menu.classList.toggle('menu-active');
});
// Change header background on scroll
window.addEventListener('scroll', () => {
const header = document.querySelector('header');
header.classList.toggle('scrolled', window.scrollY > 0);
});
// Form submission handler
const form = document.getElementById('contactForm');
form.addEventListener('submit', function(event) {
event.preventDefault();
alert('Thank you for your message! We will get back to you soon.');
form.reset();
});
</script>
<!-- Font Awesome Icons -->
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
</body>
</html>
Save this code as gym.html and open it in your web browser to view the website.
This code creates a modern, responsive gym business card website with smooth animations and interactive elements. It includes:
- Fixed Header: A navigation menu that changes background color upon scrolling.
- Hero Section: A full-screen background image with a call-to-action button.
- About Section: Information about the gym with images and animated text.
- Services Section: Details of services offered, with icons and hover effects.
- Trainers Section: Profiles of trainers with images and hover animations.
- Testimonials Section: Client testimonials with stylized quotes.
- Contact Section: A contact form that triggers an alert and resets upon submission.
- Footer: A simple footer with copyright information.
- Responsive Design: Media queries to ensure the site looks good on all devices.
- Modern Animations: CSS animations for fade-in effects and interactive elements.
- JavaScript Interactivity: Responsive navigation menu and form handling.
Feel free to customize the content, images, and styles to suit your needs.