Danny2014 commited on
Commit
5f961f5
·
verified ·
1 Parent(s): 8c57bb7

you can make it possible to edit player photos - Follow Up Deployment

Browse files
Files changed (1) hide show
  1. index.html +69 -8
index.html CHANGED
@@ -18,6 +18,12 @@
18
  .edit-mode .editable:hover {
19
  background-color: rgba(255, 213, 79, 0.1);
20
  }
 
 
 
 
 
 
21
  .edit-toolbar {
22
  position: fixed;
23
  top: 10px;
@@ -180,7 +186,12 @@
180
  <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8">
181
  <!-- Player 1 -->
182
  <div class="player-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
183
- <img src="https://images.unsplash.com/photo-1570295999919-56ce3295bada?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=880&q=80" alt="Marco Menichelli" class="w-full player-image">
 
 
 
 
 
184
  <div class="p-6">
185
  <h3 class="text-xl font-bold mb-1">Marco Menichelli</h3>
186
  <p class="text-gray-600 mb-3">Midfielder</p>
@@ -193,7 +204,12 @@
193
 
194
  <!-- Player 2 -->
195
  <div class="player-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
196
- <img src="https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=774&q=80" alt="Andrea Ventrice" class="w-full player-image">
 
 
 
 
 
197
  <div class="p-6">
198
  <h3 class="text-xl font-bold mb-1">Andrea Ventrice</h3>
199
  <p class="text-gray-600 mb-3">Forward</p>
@@ -206,7 +222,12 @@
206
 
207
  <!-- Player 3 -->
208
  <div class="player-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
209
- <img src="https://images.unsplash.com/photo-1531123897727-8f129e1688ce?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=774&q=80" alt="Roberto Menichelli" class="w-full player-image">
 
 
 
 
 
210
  <div class="p-6">
211
  <h3 class="text-xl font-bold mb-1">Roberto Menichelli</h3>
212
  <p class="text-gray-600 mb-3">Defender</p>
@@ -219,7 +240,12 @@
219
 
220
  <!-- Player 4 -->
221
  <div class="player-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
222
- <img src="https://images.unsplash.com/photo-1500648767791-00dcc994a43e?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=774&q=80" alt="Alessandro Sabia" class="w-full player-image">
 
 
 
 
 
223
  <div class="p-6">
224
  <h3 class="text-xl font-bold mb-1">Alessandro Sabia</h3>
225
  <p class="text-gray-600 mb-3">Goalkeeper</p>
@@ -232,7 +258,12 @@
232
 
233
  <!-- Player 5 -->
234
  <div class="player-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
235
- <img src="https://images.unsplash.com/photo-1519085360753-af0119f7cbe7?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=774&q=80" alt="Alessandro De Simone" class="w-full player-image">
 
 
 
 
 
236
  <div class="p-6">
237
  <h3 class="text-xl font-bold mb-1">Alessandro De Simone</h3>
238
  <p class="text-gray-600 mb-3">Midfielder</p>
@@ -245,7 +276,12 @@
245
 
246
  <!-- Player 6 -->
247
  <div class="player-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
248
- <img src="https://images.unsplash.com/photo-1568602471122-7832951cc4c5?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1740&q=80" alt="Lorenzo Tomassini" class="w-full player-image">
 
 
 
 
 
249
  <div class="p-6">
250
  <h3 class="text-xl font-bold mb-1">Lorenzo Tomassini</h3>
251
  <p class="text-gray-600 mb-3">Defender</p>
@@ -258,7 +294,12 @@
258
 
259
  <!-- Player 7 -->
260
  <div class="player-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
261
- <img src="https://images.unsplash.com/photo-1564564244660-5d73c057f2d2?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1456&q=80" alt="Daniele Conti" class="w-full player-image">
 
 
 
 
 
262
  <div class="p-6">
263
  <h3 class="text-xl font-bold mb-1">Daniele Conti</h3>
264
  <p class="text-gray-600 mb-3">Forward</p>
@@ -271,7 +312,7 @@
271
 
272
  <!-- Team Staff Card -->
273
  <div class="player-card bg-blue-900 text-white rounded-lg overflow-hidden shadow-md transition duration-300">
274
- <div class="h-64 bg-blue-800 flex items-center justify-center">
275
  <i class="fas fa-users text-6xl"></i>
276
  </div>
277
  <div class="p-6">
@@ -755,6 +796,26 @@
755
 
756
  // Load saved content
757
  loadContent();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
758
  });
759
 
760
  // Mobile menu toggle
 
18
  .edit-mode .editable:hover {
19
  background-color: rgba(255, 213, 79, 0.1);
20
  }
21
+ .edit-mode .editable-image:hover .edit-image-overlay {
22
+ opacity: 1;
23
+ }
24
+ .edit-image-overlay {
25
+ cursor: pointer;
26
+ }
27
  .edit-toolbar {
28
  position: fixed;
29
  top: 10px;
 
186
  <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8">
187
  <!-- Player 1 -->
188
  <div class="player-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
189
+ <div class="editable-image relative">
190
+ <img src="https://images.unsplash.com/photo-1570295999919-56ce3295bada?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=880&q=80" alt="Marco Menichelli" class="w-full player-image">
191
+ <div class="edit-image-overlay absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center opacity-0 transition duration-300">
192
+ <span class="text-white font-bold">Click to Change</span>
193
+ </div>
194
+ </div>
195
  <div class="p-6">
196
  <h3 class="text-xl font-bold mb-1">Marco Menichelli</h3>
197
  <p class="text-gray-600 mb-3">Midfielder</p>
 
204
 
205
  <!-- Player 2 -->
206
  <div class="player-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
207
+ <div class="editable-image relative">
208
+ <img src="https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=774&q=80" alt="Andrea Ventrice" class="w-full player-image">
209
+ <div class="edit-image-overlay absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center opacity-0 transition duration-300">
210
+ <span class="text-white font-bold">Click to Change</span>
211
+ </div>
212
+ </div>
213
  <div class="p-6">
214
  <h3 class="text-xl font-bold mb-1">Andrea Ventrice</h3>
215
  <p class="text-gray-600 mb-3">Forward</p>
 
222
 
223
  <!-- Player 3 -->
224
  <div class="player-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
225
+ <div class="editable-image relative">
226
+ <img src="https://images.unsplash.com/photo-1531123897727-8f129e1688ce?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=774&q=80" alt="Roberto Menichelli" class="w-full player-image">
227
+ <div class="edit-image-overlay absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center opacity-0 transition duration-300">
228
+ <span class="text-white font-bold">Click to Change</span>
229
+ </div>
230
+ </div>
231
  <div class="p-6">
232
  <h3 class="text-xl font-bold mb-1">Roberto Menichelli</h3>
233
  <p class="text-gray-600 mb-3">Defender</p>
 
240
 
241
  <!-- Player 4 -->
242
  <div class="player-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
243
+ <div class="editable-image relative">
244
+ <img src="https://images.unsplash.com/photo-1500648767791-00dcc994a43e?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=774&q=80" alt="Alessandro Sabia" class="w-full player-image">
245
+ <div class="edit-image-overlay absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center opacity-0 transition duration-300">
246
+ <span class="text-white font-bold">Click to Change</span>
247
+ </div>
248
+ </div>
249
  <div class="p-6">
250
  <h3 class="text-xl font-bold mb-1">Alessandro Sabia</h3>
251
  <p class="text-gray-600 mb-3">Goalkeeper</p>
 
258
 
259
  <!-- Player 5 -->
260
  <div class="player-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
261
+ <div class="editable-image relative">
262
+ <img src="https://images.unsplash.com/photo-1519085360753-af0119f7cbe7?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=774&q=80" alt="Alessandro De Simone" class="w-full player-image">
263
+ <div class="edit-image-overlay absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center opacity-0 transition duration-300">
264
+ <span class="text-white font-bold">Click to Change</span>
265
+ </div>
266
+ </div>
267
  <div class="p-6">
268
  <h3 class="text-xl font-bold mb-1">Alessandro De Simone</h3>
269
  <p class="text-gray-600 mb-3">Midfielder</p>
 
276
 
277
  <!-- Player 6 -->
278
  <div class="player-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
279
+ <div class="editable-image relative">
280
+ <img src="https://images.unsplash.com/photo-1568602471122-7832951cc4c5?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1740&q=80" alt="Lorenzo Tomassini" class="w-full player-image">
281
+ <div class="edit-image-overlay absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center opacity-0 transition duration-300">
282
+ <span class="text-white font-bold">Click to Change</span>
283
+ </div>
284
+ </div>
285
  <div class="p-6">
286
  <h3 class="text-xl font-bold mb-1">Lorenzo Tomassini</h3>
287
  <p class="text-gray-600 mb-3">Defender</p>
 
294
 
295
  <!-- Player 7 -->
296
  <div class="player-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
297
+ <div class="editable-image relative">
298
+ <img src="https://images.unsplash.com/photo-1564564244660-5d73c057f2d2?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1456&q=80" alt="Daniele Conti" class="w-full player-image">
299
+ <div class="edit-image-overlay absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center opacity-0 transition duration-300">
300
+ <span class="text-white font-bold">Click to Change</span>
301
+ </div>
302
+ </div>
303
  <div class="p-6">
304
  <h3 class="text-xl font-bold mb-1">Daniele Conti</h3>
305
  <p class="text-gray-600 mb-3">Forward</p>
 
312
 
313
  <!-- Team Staff Card -->
314
  <div class="player-card bg-blue-900 text-white rounded-lg overflow-hidden shadow-md transition duration-300">
315
+ <div class="editable-image h-64 bg-blue-800 flex items-center justify-center relative">
316
  <i class="fas fa-users text-6xl"></i>
317
  </div>
318
  <div class="p-6">
 
796
 
797
  // Load saved content
798
  loadContent();
799
+
800
+ // Image change functionality
801
+ document.querySelectorAll('.editable-image').forEach(container => {
802
+ container.addEventListener('click', function(e) {
803
+ if (!document.body.classList.contains('edit-mode')) return;
804
+
805
+ const img = this.querySelector('img') || this;
806
+ const newSrc = prompt('Enter new image URL:', img.src);
807
+
808
+ if (newSrc && newSrc !== img.src) {
809
+ if (img.tagName === 'IMG') {
810
+ img.src = newSrc;
811
+ } else {
812
+ // For the team staff card that uses a div
813
+ this.innerHTML = `<img src="${newSrc}" class="w-full h-full object-cover">`;
814
+ }
815
+ saveContent();
816
+ }
817
+ });
818
+ });
819
  });
820
 
821
  // Mobile menu toggle