Spaces:
Running
Running
File size: 6,983 Bytes
0b1db27 |
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 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
class CourseExplorer extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
padding: 5rem 1rem;
background: #0F172A;
}
.container {
max-width: 1200px;
margin: 0 auto;
}
.section-header {
text-align: center;
margin-bottom: 3rem;
}
.section-title {
font-size: 2.5rem;
margin-bottom: 1rem;
color: #F8FAFC;
}
.section-subtitle {
color: #94A3B8;
max-width: 600px;
margin: 0 auto;
line-height: 1.6;
}
.filters {
display: flex;
justify-content: center;
gap: 1rem;
margin-bottom: 2rem;
flex-wrap: wrap;
}
.filter-btn {
background: transparent;
border: 1px solid #334155;
color: #CBD5E1;
padding: 0.5rem 1.5rem;
border-radius: 30px;
cursor: pointer;
transition: all 0.3s ease;
}
.filter-btn.active, .filter-btn:hover {
background: #D4AF37;
color: #0F172A;
border-color: #D4AF37;
}
.courses-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 2rem;
}
.course-card {
background: rgba(30, 41, 59, 0.5);
border: 1px solid #1E293B;
border-radius: 10px;
overflow: hidden;
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.course-card:hover {
transform: translateY(-10px);
box-shadow: 0 20px 25px -5px rgba(212, 175, 55, 0.2), 0 10px 10px -5px rgba(212, 175, 55, 0.1);
border-color: #D4AF37;
}
.course-image {
width: 100%;
height: 200px;
object-fit: cover;
}
.course-content {
padding: 1.5rem;
}
.course-title {
font-size: 1.25rem;
margin-bottom: 0.5rem;
color: #F8FAFC;
}
.course-description {
color: #94A3B8;
margin-bottom: 1rem;
line-height: 1.6;
}
.course-meta {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 1rem;
}
.course-price {
font-weight: 600;
color: #D4AF37;
}
.course-duration {
color: #94A3B8;
font-size: 0.875rem;
}
.course-link {
display: inline-flex;
align-items: center;
gap: 0.5rem;
color: #D4AF37;
text-decoration: none;
font-weight: 500;
margin-top: 1rem;
}
.course-link:hover {
text-decoration: underline;
}
</style>
<div class="container">
<div class="section-header">
<h2 class="section-title">Explore Our Courses</h2>
<p class="section-subtitle">From beginner to expert, we offer comprehensive RYA training programs to master the sea</p>
</div>
<div class="filters">
<button class="filter-btn active" data-filter="all">All Courses</button>
<button class="filter-btn" data-filter="practical">Practical</button>
<button class="filter-btn" data-filter="theory">Theory</button>
<button class="filter-btn" data-filter="powerboat">Powerboat</button>
<button class="filter-btn" data-filter="mile">Mile Builders</button>
</div>
<div class="courses-grid">
<div class="course-card">
<img src="http://static.photos/nature/320x240/1" alt="Day Skipper Course" class="course-image">
<div class="course-content">
<h3 class="course-title">Day Skipper</h3>
<p class="course-description">Perfect for beginners wanting to gain confidence in coastal sailing</p>
<div class="course-meta">
<span class="course-price">£495</span>
<span class="course-duration">5 Days</span>
</div>
<a href="#" class="course-link">
<span>Learn More</span>
<i data-feather="arrow-right"></i>
</a>
</div>
</div>
<div class="course-card">
<img src="http://static.photos/nature/320x240/2" alt="Coastal Skipper Course" class="course-image">
<div class="course-content">
<h3 class="course-title">Coastal Skipper</h3>
<p class="course-description">Advanced navigation and yacht handling in challenging conditions</p>
<div class="course-meta">
<span class="course-price">£695</span>
<span class="course-duration">5 Days</span>
</div>
<a href="#" class="course-link">
<span>Learn More</span>
<i data-feather="arrow-right"></i>
</a>
</div>
</div>
<div class="course-card">
<img src="http://static.photos/nature/320x240/3" alt="Yachtmaster Course" class="course-image">
<div class="course-content">
<h3 class="course-title">Yachtmaster Coastal</h3>
<p class="course-description">Professional qualification for experienced sailors</p>
<div class="course-meta">
<span class="course-price">£895</span>
<span class="course-duration">5 Days</span>
</div>
<a href="#" class="course-link">
<span>Learn More</span>
<i data-feather="arrow-right"></i>
</a>
</div>
</div>
</div>
</div>
`;
// Initialize feather icons
import('https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js').then(() => {
feather.replace({ icons: this.shadowRoot.querySelectorAll('[data-feather]') });
});
// Add filter functionality
this.shadowRoot.querySelectorAll('.filter-btn').forEach(button => {
button.addEventListener('click', () => {
// Remove active class from all buttons
this.shadowRoot.querySelectorAll('.filter-btn').forEach(btn => {
btn.classList.remove('active');
});
// Add active class to clicked button
button.classList.add('active');
// In a real implementation, you would filter courses here
});
});
}
}
customElements.define('course-explorer', CourseExplorer); |