Okay, let's add a dragon and some cool animations to give your homepage even more impact!
We'll modify the index.html to include the dragon image and update the style.css to add the animations and style the dragon.
1. index.html (Updated)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Football MVP - The Dragon Slayer!</title>
<link rel="stylesheet" href="style.css">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Oswald:wght@700&display=swap" rel="stylesheet">
</head>
<body>
<div class="hero-section">
<div class="field-lines"></div>
<!-- Dragon Graphic Added Here -->
<!-- IMPORTANT: Replace 'images/dragon.png' with the actual path to your dragon image -->
<!-- You can find free dragon images online or create your own silhouette -->
<img src="images/dragon.png" alt="Mighty Dragon" class="dragon-graphic">
<div class="container">
<h1 class="main-title">I'm the Best</h1>
<p class="tagline">Touchdown! Game Winner! Undisputed MVP!</p>
<a href="#stats" class="cta-button">View My Stats</a>
</div>
</div>
<section id="stats" class="stats-section">
<h2>Player Stats</h2>
<div class="stats-grid">
<div class="stat-item">
<h3>Touchdowns</h3>
<p>100+</p>
</div>
<div class="stat-item">
<h3>Yards</h3>
<p>10,000+</p>
</div>
<div class="stat-item">
<h3>Interceptions</h3>
<p>0</p>
</div>
<div class="stat-item">
<h3>Wins</h3>
<p>Championship Level</p>
</div>
</div>
</section>
<footer class="footer">
<p>© 2023 The Undefeated | Certified GOAT</p>
</footer>
</body>
</html>
Key Changes in HTML:
- Added an
<img> tag with the class dragon-graphic. Crucially, you need to add a dragon image file (e.g., dragon.png) into an images folder in the same directory as your index.html and style.css files, or change the src path to where your image is located. A transparent PNG often works best.
2. style.css (Updated)
/* Import Google Fonts for a sporty feel */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Oswald:wght@700&display=swap');
/* Basic Reset & Body Styling */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: 'Oswald', sans-serif; /* Oswald for main text */
line-height: 1.6;
background-color: #f4f4f4; /* Light background for contrast */
color: #333;
display: flex;
flex-direction: column;
min-height: 100vh;
overflow-x: hidden; /* Prevent horizontal scroll caused by animations */
}
/* Hero Section - The main focus */
.hero-section {
background: linear-gradient(rgba(0, 100, 0, 0.8), rgba(0, 80, 0, 0.6)), url('https://www.transparenttextures.com/patterns/asfalt.png'); /* Green gradient + subtle texture */
background-blend-mode: multiply;
color: #fff;
height: 90vh; /* Slightly taller */
position: relative; /* Needed for field lines and dragon */
display: flex;
justify-content: center;
align-items: center;
text-align: center;
overflow: hidden; /* Hide anything that goes outside */
border-bottom: 10px solid #ffd700; /* Gold border like a trophy */
}
/* Simulate field lines */
.field-lines::before,
.field-lines::after {
content: '';
position: absolute;
left: 0;
width: 100%;
height: 4px; /* Thickness of the line */
background-color: white;
z-index: 1; /* Behind text */
}
/* Sideline Top */
.field-lines::before {
top: 20px; /* Position near the top */
box-shadow: 0 0 0 2px white, /* Create dashed effect */
0 0 0 4px rgba(0, 80, 0, 0.6); /* Offset color */
}
/* Center Line */
.field-lines::after {
top: 50%;
transform: translateY(-50%); /* Center it vertically */
height: 2px; /* Thinner center line */
box-shadow: 0 0 0 1px white, /* Dashed effect */
0 0 0 2px rgba(0, 80, 0, 0.6);
}
/* Dragon Styling and Animation */
.dragon-graphic {
position: absolute;
bottom: 5%; /* Position near the bottom */
left: 5%; /* Position on the left */
width: 180px; /* Adjust size as needed */
height: auto;
opacity: 0.8;
transform: scale(0.7) rotate(-15deg); /* Initial scale and rotation */
z-index: 1; /* Behind the main content */
animation: floatDragon 4s infinite ease-in-out alternate,
shadowPulse 3s infinite ease-in-out alternate; /* Float and pulse shadow */
}
/* Keyframe Animations */
@keyframes floatDragon {
0% {
transform: translateY(0px) scale(0.7) rotate(-15deg);
}
100% {
transform: translateY(-25px) scale(0.7) rotate(-15deg); /* Bob up slightly */
}
}
@keyframes shadowPulse {
0% {
filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.5));
}
50% {
filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.8));
}
100% {
filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.5));
}
}
@keyframes pulseTitle {
0%, 100% {
transform: scale(1);
text-shadow: 3px 3px 8px rgba(0,0,0,0.7);
}
50% {
transform: scale(1.05); /* Slightly larger */
text-shadow: 5px 5px 15px rgba(0,0,0,0.9); /* Stronger shadow */
}
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Container for content */
.container {
z-index: 2; /* Ensure content is above lines and dragon */
max-width: 960px;
margin: 0 auto;
padding: 0 20px;
}
.main-title {
font-family: 'Bebas Neue', cursive; /* Bebas Neue for the big title */
font-size: 6rem; /* Very large */
line-height: 1.2;
margin-bottom: 1rem;
letter-spacing: 2px;
border-bottom: 3px solid #ffd700; /* Yellow highlight */
display: inline-block; /* Make border fit content */
padding-bottom: 5px;
animation: pulseTitle 3s infinite ease-in-out; /* Title pulsation */
}
.tagline {
font-size: 2rem;
font-weight: bold;
text-transform: uppercase;
margin-bottom: 2rem;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}
/* CTA Button */
.cta-button {
display: inline-block;
background-color: #ffd700; /* Gold */
color: #000;
padding: 15px 30px;
text-decoration: none;
font-size: 1.4rem;
font-weight: bold;
border: 3px solid #fff;
border-radius: 5px;
transition: background-color 0.3s ease, transform 0.2s ease;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
position: relative; /* For potential future effects */
z-index: 3; /* Ensure button is clickable */
}
.cta-button:hover {
background-color: #e6c000; /* Darker gold */
transform: translateY(-2px); /* Lift effect */
color: #000;
}
/* Stats Section */
.stats-section {
padding: 60px 20px 40px; /* More padding */
text-align: center;
background-color: #388e3c; /* Darker green */
color: #fff;
position: relative; /* Needed for animation delays */
}
.stats-section h2 {
font-size: 2.5rem;
margin-bottom: 30px;
text-transform: uppercase;
letter-spacing: 1px;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Responsive grid */
gap: 30px;
max-width: 960px;
margin: 0 auto;
}
.stat-item {
background-color: rgba(255, 255, 255, 0.15);
padding: 20px;
border-radius: 8px;
border: 1px solid rgba(255, 255, 255, 0.3);
opacity: 0; /* Initially hidden for animation */
animation: fadeIn 0.8s ease-out forwards; /* Fade in animation */
}
/* Stagger animation delays for stats */
.stat-item:nth-child(1) { animation-delay: 0.2s; }
.stat-item:nth-child(2) { animation-delay: 0.4s; }
.stat-item:nth-child(3) { animation-delay: 0.6s; }
.stat-item:nth-child(4) { animation-delay: 0.8s; }
.stat-item h3 {
font-size: 1.5rem;
margin-bottom: 10px;
color: #fff; /* White */
text-transform: uppercase;
}
.stat-item p {
font-size: 2.5rem; /* Large numbers */
font-weight: bold;
color: #ffd700; /* Gold numbers */
}
/* Footer */
.footer {
margin-top: auto; /* Pushes footer to the bottom */
background-color: #222; /* Dark footer */
color: #aaa;
text-align: center;
padding: 20px 0;
font-size: 0.9rem;
}
/* Responsive Adjustments */
@media (max-width: 768px) {
.main-title {
font-size: 4rem;
}
.tagline {
font-size: 1.5rem;
}
.cta-button {
font-size: 1.2rem;
padding: 10px 20px;
}
.stats-section h2 {
font-size: 2rem;
}
.stat-item p {
font-size: 2rem;
}
.stats-grid {
grid-template-columns: 1fr; /* Stack stats on smaller screens */
}
.dragon-graphic {
width: 120px; /* Smaller dragon on mobile */
left: 2%;
bottom: 2%;
transform: scale(0.5) rotate(-15deg); /* Adjust scale and rotation for mobile */
}
/* Adjust animation for smaller screens if needed */
@keyframes floatDragon {
0% { transform: translateY(0px) scale(0.5) rotate(-15deg); }
100% { transform: translateY(-15px) scale(0.5) rotate(-15deg); }
}
.main-title {
animation: none; /* Optionally disable title animation on small screens */
}
}
@media (max-width: 480px) {
.main-title {
font-size: 3rem;
}
.dragon-graphic {
width: 80px; /* Even smaller dragon */
transform: scale(0.4) rotate(-15deg);
}
@keyframes floatDragon {
0% { transform: translateY(0px) scale(0.4) rotate(-15deg); }
100% { transform: translateY(-10px) scale(0.4) rotate(-15deg); }
}
}