dodey917's picture
Create a travel blog with full-width destination photos, travel stories grid, interactive world map showing visited places, travel tips section, gear recommendations, and subscription form.
8ed236b verified
class CustomFooter extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
* {
font-family: 'Inter', sans-serif;
}
footer {
background: linear-gradient(135deg, #115e59 0%, #134e4a 100%);
color: white;
padding: 4rem 2rem 2rem;
margin-top: 4rem;
}
.footer-container {
max-width: 1280px;
margin: 0 auto;
}
.footer-content {
display: grid;
grid-template-columns: 2fr 1fr 1fr 1fr;
gap: 3rem;
margin-bottom: 3rem;
}
.footer-brand {
display: flex;
flex-direction: column;
gap: 1rem;
}
.footer-logo {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 1.75rem;
font-weight: 700;
color: white;
text-decoration: none;
}
.footer-description {
color: #94a3b8;
line-height: 1.6;
max-width: 300px;
}
.social-links {
display: flex;
gap: 1rem;
margin-top: 1rem;
}
.social-link {
width: 40px;
height: 40px;
background: rgba(255, 255, 255, 0.1);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: white;
text-decoration: none;
transition: all 0.3s ease;
}
.social-link:hover {
background: #14b8a6;
transform: translateY(-3px);
}
.footer-column h3 {
font-size: 1.125rem;
font-weight: 600;
margin-bottom: 1rem;
color: white;
}
.footer-links {
list-style: none;
padding: 0;
margin: 0;
}
.footer-links li {
margin-bottom: 0.75rem;
}
.footer-links a {
color: #94a3b8;
text-decoration: none;
transition: color 0.3s ease;
display: inline-flex;
align-items: center;
gap: 0.5rem;
}
.footer-links a:hover {
color: #14b8a6;
}
.footer-links a svg {
width: 16px;
height: 16px;
opacity: 0;
transition: opacity 0.3s ease;
}
.footer-links a:hover svg {
opacity: 1;
}
.newsletter-form {
display: flex;
flex-direction: column;
gap: 1rem;
}
.newsletter-input {
padding: 0.75rem 1rem;
border-radius: 0.5rem;
border: 1px solid rgba(255, 255, 255, 0.2);
background: rgba(255, 255, 255, 0.1);
color: white;
font-size: 0.875rem;
}
.newsletter-input::placeholder {
color: #94a3b8;
}
.newsletter-input:focus {
outline: none;
border-color: #14b8a6;
background: rgba(255, 255, 255, 0.15);
}
.newsletter-btn {
background: #f97316;
color: white;
padding: 0.75rem 1.5rem;
border-radius: 0.5rem;
border: none;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
}
.newsletter-btn:hover {
background: #ea580c;
transform: translateY(-2px);
}
.footer-bottom {
border-top: 1px solid rgba(255, 255, 255, 0.1);
padding-top: 2rem;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 1rem;
}
.footer-bottom-text {
color: #94a3b8;
font-size: 0.875rem;
}
.footer-bottom-links {
display: flex;
gap: 2rem;
list-style: none;
padding: 0;
margin: 0;
}
.footer-bottom-links a {
color: #94a3b8;
text-decoration: none;
font-size: 0.875rem;
transition: color 0.3s ease;
}
.footer-bottom-links a:hover {
color: #14b8a6;
}
@media (max-width: 768px) {
.footer-content {
grid-template-columns: 1fr;
gap: 2rem;
}
.footer-bottom {
flex-direction: column;
text-align: center;
}
.footer-bottom-links {
justify-content: center;
}
}
</style>
<footer>
<div class="footer-container">
<div class="footer-content">
<div class="footer-brand">
<a href="#home" class="footer-logo">
<svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"/>
<path d="M2 12h20"/>
<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>
</svg>
Wanderlust Chronicles
</a>
<p class="footer-description">
Sharing our adventures around the globe, inspiring others to explore the beauty and diversity of our world.
</p>
<div class="social-links">
<a href="#" class="social-link" aria-label="Facebook">
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor">
<path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/>
</svg>
</a>
<a href="#" class="social-link" aria-label="Instagram">
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor">
<path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zM5.838 12a6.162 6.162 0 1 1 12.324 0 6.162 6.162 0 0 1-12.324 0zM12 16a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm4.965-10.405a1.44 1.44 0 1 1 2.881.001 1.44 1.44 0 0 1-2.881-.001z"/>
</svg>
</a>
<a href="#" class="social-link" aria-label="Twitter">
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor">
<path d="M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085 4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z"/>
</svg>
</a>
<a href="#" class="social-link" aria-label="YouTube">
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor">
<path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/>
</svg>
</a>
</div>
</div>
<div class="footer-column">
<h3>Explore</h3>
<ul class="footer-links">
<li>
<a href="#stories">
Travel Stories
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
</svg>
</a>
</li>
<li>
<a href="#destinations">
Destinations
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
</svg>
</a>
</li>
<li>
<a href="#map">
Travel Map
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
</svg>
</a>
</li>
<li>
<a href="#gallery">
Photo Gallery
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
</svg>
</a>
</li>
</ul>
</div>
<div class="footer-column">
<h3>Resources</h3>
<ul class="footer-links">
<li>
<a href="#tips">
Travel Tips
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
</svg>
</a>
</li>
<li>
<a href="#gear">
Gear Reviews
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
</svg>
</a>
</li>
<li>
<a href="#guides">
Travel Guides
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
</svg>
</a>
</li>
<li>
<a href="#faq">
FAQ
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
</svg>
</a>
</li>
</ul>
</div>
<div class="footer-column">
<h3>Stay Connected</h3>
<form class="newsletter-form" onsubmit="handleNewsletterSubmit(event)">
<input type="email" placeholder="Your email" class="newsletter-input" required>
<button type="submit" class="newsletter-btn">Subscribe</button>
</form>
<p style="color: #94a3b8; font-size: 0.875rem; margin-top: 0.5rem;">
Get weekly travel inspiration
</p>
</div>
</div>
<div class="footer-bottom">
<p class="footer-bottom-text">
© <span class="current-year">2024</span> Wanderlust Chronicles. All rights reserved.
</p>
<ul class="footer-bottom-links">
<li><a href="#privacy">Privacy Policy</a></li>
<li><a href="#terms">Terms of Service</a></li>
<li><a href="#cookies">Cookie Policy</a></li>
</ul>
</div>
</div>
</footer>
`;
}
}
customElements.define('custom-footer', CustomFooter);
function handleNewsletterSubmit(event) {
event.preventDefault();
const input = event.target.querySelector('.newsletter-input');
const button = event.target.querySelector('.newsletter-btn');
button.textContent = 'Subscribing...';
button.disabled = true;
setTimeout(() => {
button.textContent = '✓ Subscribed!';
input.value = '';
setTimeout(() => {
button.textContent = 'Subscribe';
button.disabled = false;
}, 2000);
}, 1000);
}