Below is an example of a full HTML code for a calisthenics website that incorporates modern and dynamic elements. This example includes a navigation bar, hero section, about section, exercises section with animations, testimonials section, and a contact form. It utilizes CSS for styling and JavaScript for interactivity. To keep it in a single HTML file, CSS styles and JavaScript code are embedded within <style> and <script> tags, respectively.
html Copy code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calisthenics Hub</title>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Open Sans', sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
line-height: 1.6;
}
.container {
max-width: 1100px;
margin: auto;
overflow: hidden;
padding: 0 20px;
}
header {
background: #333;
color: #fff;
padding: 20px 0;
text-align: center;
}
.nav-bar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 20px;
}
.nav-bar ul {
list-style: none;
padding: 0;
}
.nav-bar ul li {
display: inline;
margin-left: 20px;
}
.nav-bar a {
color: #fff;
text-decoration: none;
}
.hero {
background-image: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('https://source.unsplash.com/1600x900/?calisthenics');
height: 100vh;
background-size: cover;
background-position: center;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
}
.hero h1 {
font-size: 50px;
}
.section {
padding: 20px 0;
}
.exercises-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
}
.exercise-card {
background: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.testimonials {
background: #333;
color: #fff;
padding: 20px;
border-radius: 10px;
}
.testimonial {
margin-bottom: 20px;
}
footer {
background: #333;
color: #fff;
text-align: center;
padding: 10px 0;
margin-top: 20px;
}
.contact-form {
max-width: 600px;
margin: auto;
padding: 20px;
background: #fff;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
input, textarea {
width: 100%;
padding: 10px;
margin-bottom: 20px;
border: 1px solid #ddd;
}
button {
background: #333;
color: #fff;
padding: 10px 20px;
border: none;
cursor: pointer;
}
button:hover {
background: #555;
}
</style>
</head>
<body>
<header>
<div class="nav-bar container">
<h1>Calisthenics Hub</h1>
<nav>
<ul>
<li><a href="#about">About</a></li>
<li><a href="#exercises">Exercises</a></li>
<li><a href="#testimonials">Testimonials</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</div>
</header>
<section class="hero">
<h1>Transform Your Body with Calisthenics</h1>
</section>
<section id="about" class="section container">
<h2>About Calisthenics</h2>
<p>Calisthenics is a form of exercise that uses body weight as resistance to build strength, flexibility, and coordination. It's a great way to improve overall fitness without needing any equipment.</p>
</section>
<section id="exercises" class="section container">
<h2>Exercises</h2>
<div class="exercises-grid">
<div class="exercise-card">
<h3>Push-ups</h3>
<p>A classic upper body exercise that targets the chest, shoulders, and triceps.</p>
</div>
<div class="exercise-card">
<h3>Squats</h3>
<p>A lower body exercise that works the legs and glutes.</p>
</div>
<div class="exercise-card">
<h3>Pull-ups</h3>
<p>An upper body exercise that targets the back, shoulders, and arms.</p>
</div>
</div>
</section>
<section id="testimonials" class="section container">
<h2>Testimonials</h2>
<div class="testimonials">
<div class="testimonial">
<p>"Calisthenics has transformed my body and improved my overall health. I feel stronger and more confident than ever!"</p>
<p>- John Doe</p>
</div>
<div class="testimonial">
<p>"I've tried many forms of exercise, but calisthenics is by far the most effective and enjoyable. Highly recommend!"</p>
<p>- Jane Smith</p>
</div>
</div>
</section>
<section id="contact" class="section container">
<h2>Get in Touch</h2>
<form class="contact-form">
<input type="text" placeholder="Name" required>
<input type="email" placeholder="Email" required>
<textarea placeholder="Message" required></textarea>
<button type="submit">Send</button>
</form>
</section>
<footer>
<p>© 2023 Calisthenics Hub</p>
</footer>
<script>
// Simple form submission handling
document.querySelector('.contact-form').addEventListener('submit', function(e) {
e.preventDefault();
alert('Thank you for your message!');
// Here you can add code to actually submit the form data
});
// Smooth scrolling for navigation links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
</script>
</body>
</html>
This code creates a basic, modern website for a calisthenics hub. It includes a hero section with a background image, sections for about, exercises, testimonials, and a contact form. The JavaScript code handles form submission and smooth scrolling for anchor links. You can customize the content, styles, and scripts as needed to fit your specific requirements.