GregorSaalste commited on
Commit
fbe0bbb
·
verified ·
1 Parent(s): 93a4fea

Make the hero background image a slideshow that changes automatically

Browse files
Files changed (3) hide show
  1. departments.html +45 -4
  2. index.html +46 -5
  3. swat.html +47 -4
departments.html CHANGED
@@ -64,10 +64,15 @@
64
  </button>
65
  </div>
66
  </header>
67
-
68
  <!-- Hero Section -->
69
- <section class="hero-section py-32">
70
- <div class="container mx-auto px-4 text-center">
 
 
 
 
 
 
71
  <h1 class="text-4xl md:text-6xl font-bold mb-6 text-gray-100">
72
  Key West Departments
73
  </h1>
@@ -77,7 +82,43 @@
77
  </div>
78
  </section>
79
 
80
- <!-- Departments Grid -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  <section class="py-20 bg-gray-900">
82
  <div class="container mx-auto px-4">
83
  <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
 
64
  </button>
65
  </div>
66
  </header>
 
67
  <!-- Hero Section -->
68
+ <section class="hero-section py-32 relative overflow-hidden">
69
+ <div class="slideshow-container absolute inset-0 w-full h-full">
70
+ <div class="slide fade" style="background-image: url('http://static.photos/government/1200x630/45')"></div>
71
+ <div class="slide fade" style="background-image: url('http://static.photos/government/1200x630/46')"></div>
72
+ <div class="slide fade" style="background-image: url('http://static.photos/government/1200x630/47')"></div>
73
+ <div class="slide fade" style="background-image: url('http://static.photos/government/1200x630/48')"></div>
74
+ </div>
75
+ <div class="container mx-auto px-4 text-center relative z-10">
76
  <h1 class="text-4xl md:text-6xl font-bold mb-6 text-gray-100">
77
  Key West Departments
78
  </h1>
 
82
  </div>
83
  </section>
84
 
85
+ <style>
86
+ .slideshow-container {
87
+ position: relative;
88
+ background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7));
89
+ }
90
+ .slide {
91
+ position: absolute;
92
+ width: 100%;
93
+ height: 100%;
94
+ background-size: cover;
95
+ background-position: center;
96
+ opacity: 0;
97
+ transition: opacity 1s ease-in-out;
98
+ }
99
+ .slide.fade {
100
+ opacity: 1;
101
+ }
102
+ </style>
103
+
104
+ <script>
105
+ let currentSlide = 0;
106
+ const slides = document.querySelectorAll('.slide');
107
+
108
+ function showSlides() {
109
+ for (let i = 0; i < slides.length; i++) {
110
+ slides[i].style.opacity = 0;
111
+ }
112
+ currentSlide = (currentSlide + 1) % slides.length;
113
+ slides[currentSlide].style.opacity = 1;
114
+ setTimeout(showSlides, 5000); // Change image every 5 seconds
115
+ }
116
+
117
+ // Initialize first slide
118
+ slides[0].style.opacity = 1;
119
+ setTimeout(showSlides, 5000);
120
+ </script>
121
+ <!-- Departments Grid -->
122
  <section class="py-20 bg-gray-900">
123
  <div class="container mx-auto px-4">
124
  <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
index.html CHANGED
@@ -139,11 +139,16 @@
139
  </button>
140
  </div>
141
  </header>
142
-
143
  <!-- Hero Section -->
144
- <section class="swat-hero py-32">
145
- <div class="container mx-auto px-4 text-center">
146
- <h1 class="text-4xl md:text-6xl font-bold mb-6 bg-gradient-to-r from-[#e4355b] to-[#e38c26] bg-clip-text text-transparent">
 
 
 
 
 
 
147
  Special Weapons And Tactics
148
  </h1>
149
  <p class="text-xl md:text-2xl max-w-3xl mx-auto text-gray-300 mb-8">
@@ -160,7 +165,43 @@
160
  </div>
161
  </section>
162
 
163
- <!-- About SWAT Section -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  <section class="py-20 bg-gradient-to-b from-gray-950 to-black">
165
  <div class="container mx-auto px-4">
166
  <div class="text-center mb-16">
 
139
  </button>
140
  </div>
141
  </header>
 
142
  <!-- Hero Section -->
143
+ <section class="swat-hero py-32 relative overflow-hidden">
144
+ <div class="slideshow-container absolute inset-0 w-full h-full">
145
+ <div class="slide fade" style="background-image: url('http://static.photos/government/1200x630/45')"></div>
146
+ <div class="slide fade" style="background-image: url('http://static.photos/government/1200x630/46')"></div>
147
+ <div class="slide fade" style="background-image: url('http://static.photos/government/1200x630/47')"></div>
148
+ <div class="slide fade" style="background-image: url('http://static.photos/government/1200x630/48')"></div>
149
+ </div>
150
+ <div class="container mx-auto px-4 text-center relative z-10">
151
+ <h1 class="text-4xl md:text-6xl font-bold mb-6 bg-gradient-to-r from-[#e4355b] to-[#e38c26] bg-clip-text text-transparent">
152
  Special Weapons And Tactics
153
  </h1>
154
  <p class="text-xl md:text-2xl max-w-3xl mx-auto text-gray-300 mb-8">
 
165
  </div>
166
  </section>
167
 
168
+ <style>
169
+ .slideshow-container {
170
+ position: relative;
171
+ background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7));
172
+ }
173
+ .slide {
174
+ position: absolute;
175
+ width: 100%;
176
+ height: 100%;
177
+ background-size: cover;
178
+ background-position: center;
179
+ opacity: 0;
180
+ transition: opacity 1s ease-in-out;
181
+ }
182
+ .slide.fade {
183
+ opacity: 1;
184
+ }
185
+ </style>
186
+
187
+ <script>
188
+ let currentSlide = 0;
189
+ const slides = document.querySelectorAll('.slide');
190
+
191
+ function showSlides() {
192
+ for (let i = 0; i < slides.length; i++) {
193
+ slides[i].style.opacity = 0;
194
+ }
195
+ currentSlide = (currentSlide + 1) % slides.length;
196
+ slides[currentSlide].style.opacity = 1;
197
+ setTimeout(showSlides, 5000); // Change image every 5 seconds
198
+ }
199
+
200
+ // Initialize first slide
201
+ slides[0].style.opacity = 1;
202
+ setTimeout(showSlides, 5000);
203
+ </script>
204
+ <!-- About SWAT Section -->
205
  <section class="py-20 bg-gradient-to-b from-gray-950 to-black">
206
  <div class="container mx-auto px-4">
207
  <div class="text-center mb-16">
swat.html CHANGED
@@ -158,9 +158,15 @@
158
  </div>
159
  </header>
160
  <!-- Hero Section -->
161
- <section class="swat-hero py-20">
162
- <div class="container mx-auto px-4 text-center">
163
- <h1 class="text-3xl md:text-4xl font-bold mb-6 gradient-text">
 
 
 
 
 
 
164
  SPECIAL WEAPONS AND TACTICS UNIT
165
  </h1>
166
  <p class="text-lg md:text-xl max-w-3xl mx-auto text-gray-400 mb-8">
@@ -176,7 +182,44 @@ Official tactical response division serving Key West, Florida
176
  </div>
177
  </div>
178
  </section>
179
- <!-- About SWAT Section -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  <section class="bg-gradient-to-b bg-white">
181
  <div class="container mx-auto px-4">
182
  <div class="text-center mb-16">
 
158
  </div>
159
  </header>
160
  <!-- Hero Section -->
161
+ <section class="swat-hero py-20 relative overflow-hidden">
162
+ <div class="slideshow-container absolute inset-0 w-full h-full">
163
+ <div class="slide fade" style="background-image: url('http://static.photos/government/1200x630/45')"></div>
164
+ <div class="slide fade" style="background-image: url('http://static.photos/government/1200x630/46')"></div>
165
+ <div class="slide fade" style="background-image: url('http://static.photos/government/1200x630/47')"></div>
166
+ <div class="slide fade" style="background-image: url('http://static.photos/government/1200x630/48')"></div>
167
+ </div>
168
+ <div class="container mx-auto px-4 text-center relative z-10">
169
+ <h1 class="text-3xl md:text-4xl font-bold mb-6 gradient-text">
170
  SPECIAL WEAPONS AND TACTICS UNIT
171
  </h1>
172
  <p class="text-lg md:text-xl max-w-3xl mx-auto text-gray-400 mb-8">
 
182
  </div>
183
  </div>
184
  </section>
185
+
186
+ <style>
187
+ .slideshow-container {
188
+ position: relative;
189
+ background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7));
190
+ }
191
+ .slide {
192
+ position: absolute;
193
+ width: 100%;
194
+ height: 100%;
195
+ background-size: cover;
196
+ background-position: center;
197
+ opacity: 0;
198
+ transition: opacity 1s ease-in-out;
199
+ }
200
+ .slide.fade {
201
+ opacity: 1;
202
+ }
203
+ </style>
204
+
205
+ <script>
206
+ let currentSlide = 0;
207
+ const slides = document.querySelectorAll('.slide');
208
+
209
+ function showSlides() {
210
+ for (let i = 0; i < slides.length; i++) {
211
+ slides[i].style.opacity = 0;
212
+ }
213
+ currentSlide = (currentSlide + 1) % slides.length;
214
+ slides[currentSlide].style.opacity = 1;
215
+ setTimeout(showSlides, 5000); // Change image every 5 seconds
216
+ }
217
+
218
+ // Initialize first slide
219
+ slides[0].style.opacity = 1;
220
+ setTimeout(showSlides, 5000);
221
+ </script>
222
+ <!-- About SWAT Section -->
223
  <section class="bg-gradient-to-b bg-white">
224
  <div class="container mx-auto px-4">
225
  <div class="text-center mb-16">