Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions car-site/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Garage Passionné</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header class="hero">
<h1>Bienvenue dans le garage des passionnés de voitures</h1>
</header>
<nav class="main-nav">
<ul>
<li><a href="#galerie">Galerie</a></li>
<li><a href="#a-propos">À propos</a></li>
</ul>
</nav>
<section id="galerie" class="gallery">
<h2>Quelques modèles impressionnants</h2>
<div class="gallery-grid">
<img src="https://images.unsplash.com/photo-1502877338535-766e1452684a?w=600" alt="Supercar 1">
<img src="https://images.unsplash.com/photo-1492144534655-ae79c964c9d7?w=600" alt="Supercar 2">
<img src="https://images.unsplash.com/photo-1511919884226-fd3cad34687c?w=600" alt="Supercar 3">
<img src="https://images.unsplash.com/photo-1503736334956-4c8f8e92946d?w=600" alt="Supercar 4">
</div>
</section>
<section id="a-propos" class="about">
<h2>À propos</h2>
<p>Ce site est dédié aux passionnés de voitures. Explorez des images de supercars,
partagez vos modèles préférés et restez connectés avec la communauté.</p>
</section>
<footer>
<p>&copy; 2024 Garage Passionné</p>
</footer>
<script src="script.js"></script>
</body>
</html>
8 changes: 8 additions & 0 deletions car-site/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
window.addEventListener('scroll', () => {
const nav = document.querySelector('.main-nav');
if (window.scrollY > 50) {
nav.classList.add('scrolled');
} else {
nav.classList.remove('scrolled');
}
});
90 changes: 90 additions & 0 deletions car-site/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
background-color: #111;
color: #eee;
}

.hero {
background-image: url('https://images.unsplash.com/photo-1471478331149-c72f17fb1cfc?w=1600');
background-size: cover;
background-position: center;
height: 60vh;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
color: white;
text-shadow: 0 2px 4px rgba(0,0,0,0.7);
}

.hero h1 {
font-size: 3rem;
}

.main-nav {
background: #222;
padding: 1rem;
position: sticky;
top: 0;
z-index: 1000;
}

.main-nav ul {
list-style: none;
display: flex;
justify-content: center;
margin: 0;
padding: 0;
}

.main-nav li {
margin: 0 1rem;
}

.main-nav a {
color: #fff;
text-decoration: none;
font-size: 1.1rem;
transition: color 0.3s ease;
}

.main-nav a:hover {
color: #f00;
}

.gallery {
padding: 2rem;
}

.gallery-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1rem;
}

.gallery-grid img {
width: 100%;
border-radius: 8px;
transition: transform 0.3s ease;
}

.gallery-grid img:hover {
transform: scale(1.05);
}

.about {
background: #222;
padding: 2rem;
}

footer {
background: #000;
color: #888;
text-align: center;
padding: 1rem;
}
.main-nav.scrolled {
background: #000;
box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}