-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
624 lines (548 loc) · 24.5 KB
/
index.html
File metadata and controls
624 lines (548 loc) · 24.5 KB
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>5s9 Lost</title>
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<!-- Leaflet CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.3/leaflet.css">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/css/bootstrap.min.css">
<style>
:root {
--primary-color: #3498db;
--secondary-color: #2ecc71;
--dark-color: #2c3e50;
--light-color: #ecf0f1;
--danger-color: #e74c3c;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
color: #333;
background-color: var(--light-color);
min-height: 100vh;
display: flex;
flex-direction: column;
/* Added padding-top to account for fixed navbar */
padding-top: 56px;
}
/* Fixed navbar styling */
.navbar {
background-color: var(--primary-color);
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1030;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.navbar-brand, .nav-link {
color: white !important;
}
.navbar-brand i {
margin-right: 8px;
}
.nav-link i {
margin-right: 5px;
}
.nav-link.active {
font-weight: bold;
background-color: rgba(255, 255, 255, 0.1);
border-radius: 4px;
}
/* Overlay for when navbar is expanded on mobile */
.navbar-collapse-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 1020;
}
.navbar-collapse.show + .navbar-collapse-overlay {
display: block;
}
.container {
flex: 1;
padding: 20px;
}
h1, h2, h3 {
color: var(--dark-color);
}
.text-primary {
color: var(--primary-color) !important;
}
.text-secondary {
color: var(--secondary-color) !important;
}
.btn-primary {
background-color: var(--primary-color);
border-color: var(--primary-color);
}
.btn-secondary {
background-color: var(--secondary-color);
border-color: var(--secondary-color);
}
footer {
background-color: var(--dark-color);
color: white;
text-align: center;
padding: 1rem;
margin-top: auto;
}
.page {
display: none;
}
.page.active {
display: block;
}
#map {
height: 400px;
width: 100%;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.map-controls {
margin: 20px 0;
}
.coordinates {
font-size: 0.9rem;
margin-top: 10px;
font-family: monospace;
}
.card {
transition: transform 0.3s, box-shadow 0.3s;
margin-bottom: 20px;
}
.card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.form-container {
height: 900px;
width: 100%;
border: none;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.google-sheet-container {
height: 600px;
width: 100%;
border: none;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.card-img-top {
height: 140px;
object-fit: cover;
}
.match-alert {
margin-bottom: 15px;
animation: fadeIn 1s;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(-20px); }
to { opacity: 1; transform: translateY(0); }
}
.report-toggle-btns {
margin-bottom: 20px;
}
.notification-badge {
position: relative;
top: -10px;
right: 5px;
font-size: 0.7rem;
}
@media (max-width: 768px) {
.report-toggle-btns .btn {
width: 100%;
margin-bottom: 10px;
}
#map {
height: 300px;
}
/* Additional styling for mobile nav menu */
.navbar-collapse {
position: fixed;
top: 56px;
left: 0;
padding-left: 15px;
padding-right: 15px;
padding-bottom: 15px;
width: 75%;
height: 100%;
background-color: var(--primary-color);
transform: translateX(-100%);
transition: transform 0.3s ease;
z-index: 1025;
}
.navbar-collapse.show {
transform: translateX(0);
box-shadow: 3px 0 10px rgba(0, 0, 0, 0.2);
}
.navbar-nav {
margin-top: 15px;
}
.nav-item {
margin-bottom: 10px;
}
}
</style>
</head>
<body>
<!-- Navigation Bar -->
<nav class="navbar navbar-expand-lg navbar-dark">
<div class="container-fluid">
<a class="navbar-brand" href="#"><i class="fas fa-search"></i> 5s9 Lost</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link active" data-page="home" href="#"><i class="fas fa-home"></i> Accueil</a>
</li>
<li class="nav-item">
<a class="nav-link" data-page="map" href="#"><i class="fas fa-map-marker-alt"></i> Carte</a>
</li>
<li class="nav-item">
<a class="nav-link" data-page="notifications" href="#">
<i class="fas fa-bell"></i> Notifications
<span class="badge bg-danger notification-badge" id="notificationBadge">0</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Home Page -->
<div id="homePage" class="page active">
<div class="container">
<div class="row mb-4">
<div class="col-md-8 mx-auto text-center">
<h1 class="display-4 mb-4"><i class="fas fa-search text-primary"></i> 5s9 Lost</h1>
<p class="lead">Une plateforme communautaire pour aider à reconnecter les personnes avec leurs objets perdus.</p>
<hr class="my-4">
<p>Que vous ayez perdu quelque chose de valeur ou trouvé un objet qui appartient à quelqu'un d'autre, cette plateforme aide à connecter les objets perdus avec leurs propriétaires grâce à la correspondance géographique et aux notifications automatisées.</p>
</div>
</div>
<div class="row mb-4">
<div class="col-md-4">
<div class="card h-100">
<div class="card-body text-center">
<i class="fas fa-map-marked-alt fa-3x text-primary mb-3"></i>
<h3>Basé sur la Localisation</h3>
<p>Utilisez notre carte interactive pour indiquer précisément où vous avez perdu ou trouvé un objet afin d'augmenter les chances de correspondance.</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card h-100">
<div class="card-body text-center">
<i class="fas fa-bell fa-3x text-primary mb-3"></i>
<h3>Notifications Automatiques</h3>
<p>Notre système associe automatiquement les objets perdus et trouvés et envoie des notifications lorsque des correspondances potentielles sont détectées.</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card h-100">
<div class="card-body text-center">
<i class="fas fa-handshake fa-3x text-primary mb-3"></i>
<h3>Effort Communautaire</h3>
<p>Rejoignez notre effort communautaire pour aider à réunir les personnes avec leurs objets perdus et créer des connexions positives.</p>
</div>
</div>
</div>
</div>
<div class="row mt-4 mb-4">
<div class="col-md-12 text-center">
<div class="report-toggle-btns">
<button class="btn btn-primary btn-lg me-2" id="lostItemBtn">
<i class="fas fa-question-circle"></i> Signaler un Objet Perdu
</button>
<button class="btn btn-secondary btn-lg" id="foundItemBtn">
<i class="fas fa-hand-holding"></i> Signaler un Objet Trouvé
</button>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div id="lostItemForm" class="form-section">
<h2 class="text-center mb-4"><i class="fas fa-question-circle text-primary"></i> Signaler un Objet Perdu</h2>
<!-- Replaced this iframe src with your actual Google Form for lost items -->
<iframe src="https://docs.google.com/forms/d/e/1FAIpQLSd2yM7h5sYpaBXBuP3MkzbekSvTCovwNhFYnzt0qAmbwnvEew/viewform?embedded=true" width="100%" height="520" frameborder="0" marginheight="0" marginwidth="0">Chargement…</iframe>
</div>
<div id="foundItemForm" class="form-section" style="display: none;">
<h2 class="text-center mb-4"><i class="fas fa-hand-holding text-secondary"></i> Signaler un Objet Trouvé</h2>
<!-- Replaced this iframe src with your actual Google Form for found items -->
<iframe src="https://docs.google.com/forms/d/e/1FAIpQLSfS_0yjKyy8feIRG7UwQ3ohXhQkfvQlONtK1S70B4QkOjp8ZQ/viewform?embedded=true" width="100%" height="1940" frameborder="0" marginheight="0" marginwidth="0">Chargement...</iframe>
</div>
</div>
</div>
</div>
</div>
<!-- Map Page -->
<div id="mapPage" class="page">
<div class="container">
<div class="row mb-4">
<div class="col-md-8 mx-auto text-center">
<h1 class="display-5"><i class="fas fa-map-marker-alt text-primary"></i> Carte de Localisation</h1>
<p class="lead">Indiquez précisément où vous avez perdu ou trouvé un objet pour augmenter les chances de correspondance.</p>
</div>
</div>
<div class="row">
<div class="col-md-8">
<div id="map"></div>
<div class="coordinates mt-2">
<strong>Emplacement sélectionné:</strong> <span id="selectedLocation">Aucun emplacement sélectionné</span>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-header bg-primary text-white">
<h5 class="mb-0"><i class="fas fa-info-circle"></i> Comment Utiliser la Carte</h5>
</div>
<div class="card-body">
<ol>
<li>Cliquez sur "Autoriser" lorsque vous êtes invité à accéder à votre localisation</li>
<li>La carte se centrera sur votre position actuelle</li>
<li>Cliquez sur la carte pour placer une épingle où vous avez perdu/trouvé l'objet</li>
<li>Cliquez sur "Copier les Coordonnées" pour les utiliser dans votre formulaire de signalement</li>
<li>Retournez à la page d'Accueil pour compléter votre signalement</li>
</ol>
<div class="d-grid gap-2 mt-3">
<button class="btn btn-primary" id="getCurrentLocationBtn">
<i class="fas fa-location-arrow"></i> Obtenir Ma Position Actuelle
</button>
<button class="btn btn-secondary" id="copyCoordinatesBtn" disabled>
<i class="fas fa-copy"></i> Copier les Coordonnées
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Notifications Page -->
<div id="notificationsPage" class="page">
<div class="container">
<div class="row mb-4">
<div class="col-md-8 mx-auto text-center">
<h1 class="display-5"><i class="fas fa-bell text-primary"></i> Notifications</h1>
<p class="lead">Consultez les mises à jour sur les objets perdus et trouvés.</p>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card mb-4">
<div class="card-header bg-danger text-white">
<h5 class="mb-0"><i class="fas fa-question-circle"></i> Objets Perdus</h5>
</div>
<div class="card-body">
<div class="google-sheet-container">
<iframe src="https://docs.google.com/spreadsheets/d/e/2PACX-1vRoxPIo6ZFTm2nr0sdpKrUy2_v1SmENECrTzgxbvwspdYKQmOYQsoEH9tcjrYXw2DHu2hKvbrG04bRf/pubhtml?widget=true&headers=false" width="100%" height="600" frameborder="0" marginheight="0" marginwidth="0"></iframe>
</div>
</div>
</div>
<div class="card">
<div class="card-header bg-success text-white">
<h5 class="mb-0"><i class="fas fa-hand-holding"></i> Objets Trouvés</h5>
</div>
<div class="card-body">
<div class="google-sheet-container">
<iframe src="https://docs.google.com/spreadsheets/d/e/2PACX-1vRJ8yId1ZcB_TPve35M2DNrwFUZWK7w-pR6yj7Ig71wODMLfZzB2h0XfmKzw8E5lOaO7BsX-svWsGuK/pubhtml?widget=true&headers=false" width="100%" height="600" frameborder="0" marginheight="0" marginwidth="0"></iframe>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer>
<div class="container">
<p><i class="fas fa-search"></i> Objets Perdus & Trouvés | Un Service Web Statique | <span id="currentYear"></span></p>
<p><small>Propulsé par 5s9 Horizons</small></p>
</div>
</footer>
<!-- Bootstrap JS Bundle -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
<!-- Leaflet JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.3/leaflet.js"></script>
<script>
// Set current year in footer
document.getElementById('currentYear').textContent = new Date().getFullYear();
// Navigation functionality
document.querySelectorAll('.nav-link').forEach(link => {
link.addEventListener('click', function(e) {
e.preventDefault();
const pageName = this.getAttribute('data-page');
// Update active nav link
document.querySelectorAll('.nav-link').forEach(item => {
item.classList.remove('active');
});
this.classList.add('active');
// Show selected page
document.querySelectorAll('.page').forEach(page => {
page.classList.remove('active');
});
document.getElementById(pageName + 'Page').classList.add('active');
// Initialize map if map page is selected
if (pageName === 'map' && !mapInitialized) {
initMap();
mapInitialized = true;
}
// Load notifications if notifications page is selected
if (pageName === 'notifications') {
// Reset notification badge
document.getElementById('notificationBadge').textContent = '0';
}
});
});
// Toggle between lost and found item forms
document.getElementById('lostItemBtn').addEventListener('click', function() {
document.getElementById('lostItemForm').style.display = 'block';
document.getElementById('foundItemForm').style.display = 'none';
this.classList.add('btn-primary');
this.classList.remove('btn-outline-primary');
document.getElementById('foundItemBtn').classList.add('btn-outline-secondary');
document.getElementById('foundItemBtn').classList.remove('btn-secondary');
});
document.getElementById('foundItemBtn').addEventListener('click', function() {
document.getElementById('foundItemForm').style.display = 'block';
document.getElementById('lostItemForm').style.display = 'none';
this.classList.add('btn-secondary');
this.classList.remove('btn-outline-secondary');
document.getElementById('lostItemBtn').classList.add('btn-outline-primary');
document.getElementById('lostItemBtn').classList.remove('btn-primary');
});
// Map functionality
let map, marker, mapInitialized = false;
let selectedLat, selectedLng;
function initMap() {
// Initialize map centered at a default location (will be updated with user's location)
map = L.map('map').setView([40.7128, -74.0060], 13);
// Add OpenStreetMap tiles
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
// Get user's current location
document.getElementById('getCurrentLocationBtn').addEventListener('click', function() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(
function(position) {
const lat = position.coords.latitude;
const lng = position.coords.longitude;
// Center map on user's location
map.setView([lat, lng], 16);
// Add marker at user's location
if (marker) {
marker.setLatLng([lat, lng]);
} else {
marker = L.marker([lat, lng]).addTo(map);
}
selectedLat = lat;
selectedLng = lng;
updateSelectedLocation();
document.getElementById('copyCoordinatesBtn').disabled = false;
},
function(error) {
alert('Erreur lors de l\'obtention de votre position: ' + error.message);
}
);
} else {
alert('La géolocalisation n\'est pas prise en charge par votre navigateur');
}
});
// Handle map clicks to place marker
map.on('click', function(e) {
const lat = e.latlng.lat;
const lng = e.latlng.lng;
// Add or move marker
if (marker) {
marker.setLatLng([lat, lng]);
} else {
marker = L.marker([lat, lng]).addTo(map);
}
selectedLat = lat;
selectedLng = lng;
updateSelectedLocation();
document.getElementById('copyCoordinatesBtn').disabled = false;
});
// Copy coordinates to clipboard
document.getElementById('copyCoordinatesBtn').addEventListener('click', function() {
const coordsText = `${selectedLat.toFixed(6)}, ${selectedLng.toFixed(6)}`;
navigator.clipboard.writeText(coordsText).then(
function() {
alert('Coordonnées copiées dans le presse-papiers: ' + coordsText);
},
function(err) {
alert('Impossible de copier les coordonnées: ' + err);
}
);
});
}
function updateSelectedLocation() {
document.getElementById('selectedLocation').textContent =
`${selectedLat.toFixed(6)}, ${selectedLng.toFixed(6)}`;
}
// Simulate notifications
let notificationCount = 0;
function simulateNewNotification() {
notificationCount++;
document.getElementById('notificationBadge').textContent = notificationCount;
}
// Simulate notifications periodically for demo purposes
setTimeout(simulateNewNotification, 30000);
setTimeout(simulateNewNotification, 90000);
// Create an overlay element for the navbar
const navbarOverlay = document.createElement('div');
navbarOverlay.className = 'navbar-collapse-overlay';
document.body.appendChild(navbarOverlay);
// Get references to navbar elements
const navbarToggler = document.querySelector('.navbar-toggler');
const navbarCollapse = document.querySelector('.navbar-collapse');
// Toggle collapse when clicking the hamburger button
navbarToggler.addEventListener('click', function() {
// The Bootstrap toggle will handle showing/hiding the menu
});
// Close menu when clicking outside on the overlay
navbarOverlay.addEventListener('click', function() {
// Use Bootstrap's collapse API to close the menu
const bsCollapse = new bootstrap.Collapse(navbarCollapse);
bsCollapse.hide();
});
// Handle menu state changes with Bootstrap events
navbarCollapse.addEventListener('show.bs.collapse', function() {
// Show overlay when menu is opened
navbarOverlay.style.display = 'block';
});
navbarCollapse.addEventListener('hidden.bs.collapse', function() {
// Hide overlay when menu is closed
navbarOverlay.style.display = 'none';
});
// Close mobile menu when clicking nav links
document.querySelectorAll('.navbar-nav .nav-link').forEach(link => {
link.addEventListener('click', function() {
if (navbarCollapse.classList.contains('show')) {
const bsCollapse = new bootstrap.Collapse(navbarCollapse);
bsCollapse.hide();
}
});
});
</script>
<script type="text/javascript">window.DocsBotAI=window.DocsBotAI||{},DocsBotAI.init=function(e){return new Promise((t,r)=>{var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://widget.docsbot.ai/chat.js";let o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(n,o),n.addEventListener("load",()=>{let n;Promise.all([new Promise((t,r)=>{window.DocsBotAI.mount(Object.assign({}, e)).then(t).catch(r)}),(n=function e(t){return new Promise(e=>{if(document.querySelector(t))return e(document.querySelector(t));let r=new MutationObserver(n=>{if(document.querySelector(t))return e(document.querySelector(t)),r.disconnect()});r.observe(document.body,{childList:!0,subtree:!0})})})("#docsbotai-root"),]).then(()=>t()).catch(r)}),n.addEventListener("error",e=>{r(e.message)})})};</script>
<script type="text/javascript">
DocsBotAI.init({id: "qsFo5iMownAUb9PIc0Z7/sVgYU68cSQbthAsTsE7h"});
</script>
<script src="chatbot.js"></script>
</body>
</html>