File size: 8,756 Bytes
b9e5343 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | class CustomFooter extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
width: 100%;
}
footer {
background: linear-gradient(135deg, #1e293b, #0f172a);
color: white;
}
.footer-link {
transition: all 0.3s ease;
position: relative;
}
.footer-link::before {
content: '';
position: absolute;
bottom: -2px;
left: 0;
width: 0;
height: 2px;
background: #60a5fa;
transition: width 0.3s ease;
}
.footer-link:hover::before {
width: 100%;
}
.social-icon {
transition: all 0.3s ease;
}
.social-icon:hover {
transform: translateY(-3px);
}
.back-to-top {
animation: float 3s ease-in-out infinite;
}
@keyframes float {
0%, 100% {
transform: translateY(0);
}
50% {
transform: translateY(-5px);
}
}
</style>
<footer class="mt-16">
<div class="container mx-auto px-4 py-12">
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
<!-- Brand Section -->
<div class="space-y-4">
<div class="flex items-center space-x-2">
<i data-feather="map-pin" class="w-8 h-8 text-blue-400"></i>
<span class="text-2xl font-bold bg-gradient-to-r from-blue-400 to-purple-400 bg-clip-text text-transparent">WanderPin</span>
</div>
<p class="text-gray-400 text-sm">
Visualize your travel memories. Pin your journey. Share your story.
</p>
<div class="flex space-x-4">
<a href="#" class="social-icon">
<i data-feather="instagram" class="w-5 h-5 text-gray-400 hover:text-pink-400"></i>
</a>
<a href="#" class="social-icon">
<i data-feather="twitter" class="w-5 h-5 text-gray-400 hover:text-blue-400"></i>
</a>
<a href="#" class="social-icon">
<i data-feather="facebook" class="w-5 h-5 text-gray-400 hover:text-blue-600"></i>
</a>
<a href="#" class="social-icon">
<i data-feather="github" class="w-5 h-5 text-gray-400 hover:text-gray-200"></i>
</a>
</div>
</div>
<!-- Quick Links -->
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Quick Links</h3>
<ul class="space-y-2">
<li><a href="index.html" class="footer-link text-gray-400 hover:text-white">Home</a></li>
<li><a href="timeline.html" class="footer-link text-gray-400 hover:text-white">Timeline</a></li>
<li><a href="gallery.html" class="footer-link text-gray-400 hover:text-white">Gallery</a></li>
<li><a href="stats.html" class="footer-link text-gray-400 hover:text-white">Statistics</a></li>
<li><a href="about.html" class="footer-link text-gray-400 hover:text-white">About</a></li>
</ul>
</div>
<!-- Destinations -->
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Destinations</h3>
<ul class="space-y-2">
<li><a href="#" class="footer-link text-gray-400 hover:text-white">Bangkok</a></li>
<li><a href="#" class="footer-link text-gray-400 hover:text-white">Phuket</a></li>
<li><a href="#" class="footer-link text-gray-400 hover:text-white">Hong Kong</a></li>
<li><a href="#" class="footer-link text-gray-400 hover:text-white">China</a></li>
<li><a href="#" class="footer-link text-gray-400 hover:text-white">Singapore</a></li>
</ul>
</div>
<!-- Newsletter -->
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Stay Updated</h3>
<p class="text-gray-400 text-sm mb-4">
Subscribe to get travel tips and updates
</p>
<div class="flex">
<input type="email" placeholder="Your email"
class="flex-grow px-4 py-2 rounded-l-lg bg-gray-800 text-white border border-gray-700 focus:outline-none focus:border-blue-500">
<button class="px-4 py-2 bg-blue-500 hover:bg-blue-600 text-white rounded-r-lg transition-colors">
<i data-feather="send" class="w-4 h-4"></i>
</button>
</div>
</div>
</div>
<!-- Divider -->
<div class="border-t border-gray-800 my-8"></div>
<!-- Bottom Bar -->
<div class="flex flex-col md:flex-row justify-between items-center">
<p class="text-gray-500 text-sm">
© 2024 WanderPin. All rights reserved. Made with <i data-feather="heart" class="w-4 h-4 inline text-red-400"></i> for travelers.
</p>
<div class="flex items-center space-x-6 mt-4 md:mt-0">
<a href="#" class="footer-link text-gray-500 hover:text-white text-sm">Privacy Policy</a>
<a href="#" class="footer-link text-gray-500 hover:text-white text-sm">Terms of Service</a>
<a href="#" class="footer-link text-gray-500 hover:text-white text-sm">Cookie Policy</a>
</div>
</div>
<!-- Back to Top -->
<button id="backToTop" class="back-to-top fixed bottom-8 right-8 p-3 bg-blue-500 hover:bg-blue-600 text-white rounded-full shadow-lg transition-all duration-300 opacity-0">
<i data-feather="arrow-up" class="w-5 h-5"></i>
</button>
</div>
</footer>
`;
this.initEventListeners();
}
initEventListeners() {
// Back to top button
const backToTop = this.shadowRoot.getElementById('backToTop');
window.addEventListener('scroll', () => {
if (window.scrollY > 300) {
backToTop.style.opacity = '1';
backToTop.style.transform = 'translateY(0)';
} else {
backToTop.style.opacity = '0';
backToTop.style.transform = 'translateY(20px)';
}
});
backToTop.addEventListener('click', () => {
window.scrollTo({
top: 0,
behavior: 'smooth'
});
});
// Update feather icons
setTimeout(() => {
feather.replace();
}, 100);
}
}
customElements.define('custom-footer', CustomFooter); |