Below you will find a complete, self-contained, responsive website for the fictional startup “EcoSavvy.”
Everything is pure front-end (HTML5, CSS3, vanilla JS) and can be dropped into any static host (GitHub Pages, Netlify, Vercel, etc.).
────────────────────────────────────────
FILE STRUCTURE
.
├── index.html (Homepage)
├── about.html (About Us)
├── products.html (Product Listing)
├── contact.html (Contact Form)
├── css/
│ └── style.css (All styles – mobile-first, flex/grid)
├── js/
│ └── main.js (Form validation + small UX helpers)
└── img/
├── hero.jpg
├── about.jpg
├── product1.jpg
├── product2.jpg
└── product3.jpg
(Place any royalty-free images you like in /img; names must match.)
────────────────────────────────────────
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="EcoSavvy – sustainable products for a greener planet.">
<title>EcoSavvy | Home</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!-- Skip-link for keyboard users -->
<a class="skip-link" href="#main">Skip to content</a>
<header>
<div class="container header-flex">
<a href="index.html" class="logo">Eco<span>Savvy</span></a>
<nav aria-label="Primary">
<button class="hamburger" aria-controls="nav-menu" aria-expanded="false">
<span class="sr-only">Menu</span>
<span></span><span></span><span></span>
</button>
<ul id="nav-menu">
<li><a href="index.html" aria-current="page">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="products.html">Products</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
</div>
</header>
<main id="main">
<!-- Hero -->
<section class="hero">
<div class="container hero-content">
<h1>Sustainable Living, Simplified.</h1>
<p>Eco-friendly products that don’t cost the earth.</p>
<a href="products.html" class="btn-primary">Shop Now</a>
</div>
</section>
<!-- Features -->
<section class="features">
<div class="container grid-3">
<article>
<h2>Zero-Waste</h2>
<p>All packaging is compostable or reusable.</p>
</article>
<article>
<h2>Carbon-Neutral</h2>
<p>We offset every gram of CO₂ we produce.</p>
</article>
<article>
<h2>Ethically Sourced</h2>
<p>Fair-trade materials and transparent supply chains.</p>
</article>
</div>
</section>
</main>
<footer>
<div class="container footer-flex">
<small>© <span id="year"></span> EcoSavvy. All rights reserved.</small>
<ul class="social">
<li><a href="#" aria-label="Instagram"><span class="icon ig"></span></a></li>
<li><a href="#" aria-label="Twitter"><span class="icon tw"></span></a></li>
</ul>
</div>
</footer>
<script src="js/main.js" defer></script>
</body>
</html>
────────────────────────────────────────
about.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Learn about EcoSavvy’s mission, values, and team.">
<title>About | EcoSavvy</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<a class="skip-link" href="#main">Skip to content</a>
<header>
<div class="container header-flex">
<a href="index.html" class="logo">Eco<span>Savvy</span></a>
<nav aria-label="Primary">
<button class="hamburger" aria-controls="nav-menu" aria-expanded="false">
<span class="sr-only">Menu</span>
<span></span><span></span><span></span>
</button>
<ul id="nav-menu">
<li><a href="index.html">Home</a></li>
<li><a href="about.html" aria-current="page">About</a></li>
<li><a href="products.html">Products</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
</div>
</header>
<main id="main">
<section class="about-hero">
<div class="container">
<h1>About EcoSavvy</h1>
<p>We believe small choices make a big impact.</p>
</div>
</section>
<section class="about-content">
<div class="container grid-2">
<div>
<h2>Our Mission</h2>
<p>EcoSavvy was founded to make sustainable living accessible, affordable, and attractive. We curate everyday products that are kind to the planet and beautiful in your home.</p>
<h2>Our Values</h2>
<ul>
<li>Transparency</li>
<li>Circularity</li>
<li>Community</li>
</ul>
</div>
<img src="img/about.jpg" alt="Team planting trees" loading="lazy">
</div>
</section>
</main>
<footer>
<div class="container footer-flex">
<small>© <span id="year"></span> EcoSavvy. All rights reserved.</small>
<ul class="social">
<li><a href="#" aria-label="Instagram"><span class="icon ig"></span></a></li>
<li><a href="#" aria-label="Twitter"><span class="icon tw"></span></a></li>
</ul>
</div>
</footer>
<script src="js/main.js" defer></script>
</body>
</html>
────────────────────────────────────────
products.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Browse EcoSavvy’s sustainable product catalog.">
<title>Products | EcoSavvy</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<a class="skip-link" href="#main">Skip to content</a>
<header>
<div class="container header-flex">
<a href="index.html" class="logo">Eco<span>Savvy</span></a>
<nav aria-label="Primary">
<button class="hamburger" aria-controls="nav-menu" aria-expanded="false">
<span class="sr-only">Menu</span>
<span></span><span></span><span></span>
</button>
<ul id="nav-menu">
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="products.html" aria-current="page">Products</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
</div>
</header>
<main id="main">
<section class="page-title">
<div class="container">
<h1>Our Products</h1>
<p>Every item is vetted for sustainability, durability, and design.</p>
</div>
</section>
<section class="product-grid">
<div class="container grid-3">
<article class="card">
<img src="img/product1.jpg" alt="Bamboo toothbrush pack" loading="lazy">
<h2>Bamboo Toothbrush Set</h2>
<p>Biodegradable, BPA-free bristles. Pack of 4.</p>
<span class="price">$12</span>
<button class="btn-secondary">Add to Cart</button>
</article>
<article class="card">
<img src="img/product2.jpg" alt="Reusable beeswax wraps" loading="lazy">
<h2>Beeswax Food Wraps</h2>
<p>Replace single-use plastic wrap. Set of 3 sizes.</p>
<span class="price">$15</span>
<button class="btn-secondary">Add to Cart</button>
</article>
<article class="card">
<img src="img/product3.jpg" alt="Stainless steel water bottle" loading="lazy">
<h2>Insulated Steel Bottle</h2>
<p>24h cold / 12h hot. Lifetime warranty.</p>
<span class="price">$25</span>
<button class="btn-secondary">Add to Cart</button>
</article>
</div>
</section>
</main>
<footer>
<div class="container footer-flex">
<small>© <span id="year"></span> EcoSavvy. All rights reserved.</small>
<ul class="social">
<li><a href="#" aria-label="Instagram"><span class="icon ig"></span></a></li>
<li><a href="#" aria-label="Twitter"><span class="icon tw"></span></a></li>
</ul>
</div>
</footer>
<script src="js/main.js" defer></script>
</body>
</html>
────────────────────────────────────────
contact.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Contact EcoSavvy for questions, partnerships, or feedback.">
<title>Contact | EcoSavvy</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<a class="skip-link" href="#main">Skip to content</a>
<header>
<div class="container header-flex">
<a href="index.html" class="logo">Eco<span>Savvy</span></a>
<nav aria-label="Primary">
<button class="hamburger" aria-controls="nav-menu" aria-expanded="false">
<span class="sr-only">Menu</span>
<span></span><span></span><span></span>
</button>
<ul id="nav-menu">
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="products.html">Products</a></li>
<li><a href="contact.html" aria-current="page">Contact</a></li>
</ul>
</nav>
</div>
</header>
<main id="main">
<section class="page-title">
<div class="container">
<h1>Get in Touch</h1>
<p>We’d love to hear from you!</p>
</div>
</section>
<section class="contact-form">
<div class="container">
<form id="contactForm" novalidate>
<div class="form-group">
<label for="name">Name *</label>
<input type="text" id="name" name="name" required>
<small class="error" aria-live="polite"></small>
</div>
<div class="form-group">
<label for="email">Email *</label>
<input type="email" id="email" name="email" required>
<small class="error" aria-live="polite"></small>
</div>
<div class="form-group">
<label for="subject">Subject</label>
<input type="text" id="subject" name="subject">
</div>
<div class="form-group">
<label for="message">Message *</label>
<textarea id="message" name="message" rows="5" required></textarea>
<small class="error" aria-live="polite"></small>
</div>
<button type="submit" class="btn-primary">Send Message</button>
<p id="form-status" role="status" aria-live="polite"></p>
</form>
</div>
</section>
</main>
<footer>
<div class="container footer-flex">
<small>© <span id="year"></span> EcoSavvy. All rights reserved.</small>
<ul class="social">
<li><a href="#" aria-label="Instagram"><span class="icon ig"></span></a></li>
<li><a href="#" aria-label="Twitter"><span class="icon tw"></span></a></li>
</ul>
</div>
</footer>
<script src="js/main.js" defer></script>
</body>
</html>
────────────────────────────────────────
css/style.css
/* ========== CSS RESET & ROOT VARIABLES ========== */
:root {
--clr-primary: #2e7d32; /* deep green */
--clr-primary-light: #4caf50;
--clr-secondary: #ffab00; /* warm accent */
--clr-bg: #f6f9f6;
--clr-text: #1b1b1b;
--clr-muted: #555;
--ff-base: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
--max-width: 1100px;
--radius: 6px;
--transition: 0.3s ease;
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: var(--ff-base);
color: var(--clr-text);
background: var(--clr-bg);
line-height: 1.6;
}
img {
max-width: 100%;
display: block;
}
/* ========== GLOBAL UTILITIES ========== */
.container {
width: 90%;
max-width: var(--max-width);
margin: 0 auto;
}
.grid-2,
.grid-3 {
display: grid;
gap: 2rem;
}
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 600px) {
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.btn-primary,
.btn-secondary {
display: inline-block;
padding: 0.75rem 1.5rem;
border: none;
border-radius: var(--radius);
cursor: pointer;
transition: var(--transition);
font-weight: 600;
text-decoration: none;
}
.btn-primary {
background: var(--clr-primary);
color: #fff;
}
.btn-primary:hover { background: var(--clr-primary-light); }
.btn-secondary {
background: transparent;
color: var(--clr-primary);
border: 2px solid var(--clr-primary);
}
.btn-secondary:hover {
background: var(--clr-primary);
color: #fff;
}
/* ========== HEADER & NAV ========== */
header {
background: #fff;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
position: sticky;
top: 0;
z-index: 1000;
}
.header-flex {
display: flex;
align-items: center;
justify-content: space-between;
padding: 1rem 0;
}
.logo {
font-size: 1.5rem;
font-weight: 700;
color: var(--clr-primary);
text-decoration: none;
}
.logo span { color: var(--clr-secondary); }
nav ul {
list-style: none;
display: flex;
gap: 1.5rem;
}
nav a {
color: var(--clr-text);
text-decoration: none;
font-weight: 500;
}
nav a[aria-current="page"] {
color: var(--clr-primary);
border-bottom: 2px solid var(--clr-primary);
}
/* Hamburger (mobile) */
.hamburger {
display: none;
flex-direction: column;
gap: 4px;
background: none;
border: none;
cursor: pointer;
}
.hamburger span {
width: 24px;
height: 3px;
background: var(--clr-primary);
transition: var(--transition);
}
@media (max-width: 700px) {
.hamburger { display: flex; }
nav ul {
position: absolute;
top: 100%;
right: 0;
background: #fff;
flex-direction: column;
width: 200px;
padding: 1rem;
transform: translateX(100%);
transition: var(--transition);
}
nav ul.open { transform: translateX(0); }
}
/* ========== HERO ========== */
.hero {
background: url('../img/hero.jpg') center/cover no-repeat;
color: #fff;
text-align: center;
padding: 6rem 0;
}
.hero-content h1 {
font-size: clamp(2rem, 5vw, 3rem);
margin-bottom: 1rem;
}
.hero-content p {
font-size: 1.25rem;
margin-bottom: 2rem;
}
/* ========== FEATURES / CARDS ========== */
.features,
.product-grid {
padding: 4rem 0;
}
.card {
background: #fff;
border-radius: var(--radius);
overflow: hidden;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
display: flex;
flex-direction: column;
}
.card img { aspect-ratio: 4/3; object-fit: cover; }
.card h2 { padding: 1rem 1rem 0.5rem; font-size: 1.25rem; }
.card p { padding: 0 1rem; flex: 1; color: var(--clr-muted); }
.price { padding: 0.5rem 1rem; font-weight: 700; color: var(--clr-primary); }
.card button { margin: 0 1rem 1rem; }
/* ========== PAGE TITLE ========== */
.page-title,
.about-hero {
background: var(--clr-primary);
color: #fff;
padding: 3rem 0;
text-align: center;
}
/* ========== CONTACT FORM ========== */
.contact-form {
padding: 4rem 0;
}
form {
max-width: 600px;
margin: 0 auto;
background: #fff;
padding: 2rem;
border-radius: var(--radius);
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.form-group {
margin-bottom: 1.5rem;
display: flex;
flex-direction: column;
}
label { margin-bottom: 0.25rem; font-weight: 600; }
input, textarea {
padding: 0.75rem;
border: 1px solid #ccc;
border-radius: var(--radius);
font-family: inherit;
}
input:focus, textarea:focus {
outline: none;
border-color: var(--clr-primary);
}
.error {
color: #d32f2f;
font-size: 0.875rem;
margin-top: 0.25rem;
display: none;
}
.error.show { display: block; }
/* ========== FOOTER ========== */
footer {
background: #fff;
padding: 2rem 0;
margin-top: auto;
}
.footer-flex {
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
}
.social {
list-style: none;
display: flex;
gap: 1rem;
}
.icon {
width: 24px;
height: 24px;
display: block;
background-size: cover;
}
.ig { background-image: url('data:image/svg+xml;utf8,<svg ...'); } /* inline SVG omitted for brevity */
.tw { background-image: url('data:image/svg+xml;utf8,<svg ...'); }
/* ========== ACCESSIBILITY ========== */
.skip-link {
position: absolute;
left: -999px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
}
.skip-link:focus {
position: static;
width: auto;
height: auto;
padding: 0.5rem;
background: var(--clr-primary);
color: #fff;
}
────────────────────────────────────────
js/main.js
/* ========== MOBILE NAV TOGGLE ========== */
const hamburger = document.querySelector('.hamburger');
const navMenu = document.getElementById('nav-menu');
if (hamburger) {
hamburger.addEventListener('click', () => {
const expanded = hamburger.getAttribute('aria-expanded') === 'true';
hamburger.setAttribute('aria-expanded', !expanded);
navMenu.classList.toggle('open');
});
}
/* ========== DYNAMIC YEAR ========== */
document.getElementById('year').textContent = new Date().getFullYear();
/* ========== CONTACT FORM VALIDATION ========== */
const form = document.getElementById('contactForm');
if (form) {
form.addEventListener('submit', e => {
e.preventDefault();
clearErrors();
let valid = true;
// Name
const name = form.name;
if (name.value.trim() === '') {
showError(name, 'Name is required.');
valid = false;
}
// Email
const email = form.email;
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailRegex.test(email.value)) {
showError(email, 'Please enter a valid email.');
valid = false;
}
// Message
const message = form.message;
if (message.value.trim().length < 10) {
showError(message, 'Message must be at least 10 characters.');
valid = false;
}
if (valid) {
// Simulate success
const status = document.getElementById('form-status');
status.textContent = 'Thank you! Your message has been sent.';
form.reset();
}
});
function showError(input, msg) {
const small = input.nextElementSibling;
small.textContent = msg;
small.classList.add('show');
input.setAttribute('aria-invalid', 'true');
}
function clearErrors() {
form.querySelectorAll('.error').forEach(err => err.classList.remove('show'));
form.querySelectorAll('[aria-invalid]').forEach(el => el.removeAttribute('aria-invalid'));
document.getElementById('form-status').textContent = '';
}
}
────────────────────────────────────────
SUMMARY REPORT
-
Responsive & Mobile-First
• CSS uses a mobile-first approach with min-width media queries.
• Flexbox (header, footer) and CSS Grid (features, product grid) adapt fluidly.
-
Semantic & Accessible
• <header>, <nav>, <main>, <section>, <article>, <footer> used throughout.
• Alt text on all images, skip-link for keyboard navigation, aria-label, aria-current, aria-live regions for form feedback.
-
Green Theme & Design
• Color palette rooted in greens and warm accents.
• Rounded corners, subtle shadows, and generous whitespace for a modern eco-aesthetic.
-
Contact Form Validation
• Vanilla JS validates required fields, email format, and message length.
• Errors announced to screen readers via aria-live.
-
SEO Basics
• Unique <title> and <meta name="description"> on every page.
• Proper heading hierarchy (h1 → h2 → h3).
• Images include descriptive alt attributes and loading="lazy" for speed.
-
Performance & Limitations
• All assets are static; no build step.
• Images should be optimized (WebP, compressed) before production.
• No service-worker/offline caching yet.
-
Future Improvements
• Add service worker for PWA capabilities.
• Implement real cart/checkout (headless e-commerce).
• Add dark-mode toggle respecting prefers-color-scheme.
• Replace placeholder SVG icons with optimized sprite.