Spaces:
Running

File size: 18,479 Bytes
cffa820
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Cartographie des Frappes Aériennes</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        #map { 
            height: 70vh;
            z-index: 0;
        }
        .custom-popup .leaflet-popup-content-wrapper {
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }
        .attack-marker {
            filter: hue-rotate(0deg);
            transition: all 0.3s ease;
        }
        .attack-marker:hover {
            filter: hue-rotate(20deg) brightness(1.1);
            transform: scale(1.1);
        }
        .loading-spinner {
            animation: spin 1s linear infinite;
        }
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
    </style>
</head>
<body class="bg-gray-100 font-sans">
    <div class="container mx-auto px-4 py-6">
        <!-- Header -->
        <header class="mb-8">
            <div class="flex flex-col md:flex-row justify-between items-start md:items-center gap-4">
                <div>
                    <h1 class="text-3xl font-bold text-red-800">
                        <i class="fas fa-bomb mr-2"></i> Cartographie des Frappes Aériennes
                    </h1>
                    <p class="text-gray-600 mt-2">Suivi en temps réel des attaques aériennes annoncées</p>
                </div>
                <div class="flex items-center gap-3">
                    <div class="relative">
                        <select id="timeFilter" class="bg-white border border-gray-300 rounded-md px-4 py-2 pr-8 focus:outline-none focus:ring-2 focus:ring-red-500">
                            <option value="all">Toutes les périodes</option>
                            <option value="24h">Dernières 24h</option>
                            <option value="7d">7 derniers jours</option>
                            <option value="30d">30 derniers jours</option>
                        </select>
                    </div>
                    <button id="refreshBtn" class="bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-md flex items-center gap-2 transition-colors">
                        <i class="fas fa-sync-alt"></i> Actualiser
                    </button>
                </div>
            </div>
        </header>

        <!-- Stats Cards -->
        <div class="grid grid-cols-1 md:grid-cols-4 gap-4 mb-6">
            <div class="bg-white rounded-lg shadow p-4 border-l-4 border-red-500">
                <h3 class="text-gray-500 text-sm font-medium">Total des frappes</h3>
                <p id="totalStrikes" class="text-2xl font-bold">--</p>
            </div>
            <div class="bg-white rounded-lg shadow p-4 border-l-4 border-blue-500">
                <h3 class="text-gray-500 text-sm font-medium">Pays concernés</h3>
                <p id="affectedCountries" class="text-2xl font-bold">--</p>
            </div>
            <div class="bg-white rounded-lg shadow p-4 border-l-4 border-yellow-500">
                <h3 class="text-gray-500 text-sm font-medium">Dernière frappe</h3>
                <p id="lastStrike" class="text-2xl font-bold">--</p>
            </div>
            <div class="bg-white rounded-lg shadow p-4 border-l-4 border-green-500">
                <h3 class="text-gray-500 text-sm font-medium">Sources</h3>
                <p id="sourcesCount" class="text-2xl font-bold">--</p>
            </div>
        </div>

        <!-- Main Content -->
        <div class="flex flex-col lg:flex-row gap-6">
            <!-- Map Section -->
            <div class="lg:w-2/3">
                <div class="bg-white rounded-lg shadow-md overflow-hidden">
                    <div id="map" class="w-full"></div>
                </div>
            </div>

            <!-- Sidebar -->
            <div class="lg:w-1/3">
                <div class="bg-white rounded-lg shadow-md overflow-hidden">
                    <div class="p-4 border-b border-gray-200">
                        <h2 class="text-xl font-semibold flex items-center gap-2">
                            <i class="fas fa-list"></i> Dernières alertes
                        </h2>
                    </div>
                    <div id="alertsList" class="divide-y divide-gray-200 overflow-y-auto max-h-96">
                        <div class="p-4 text-center text-gray-500">
                            <div class="flex justify-center mb-2">
                                <i class="fas fa-circle-notch loading-spinner text-red-600 text-2xl"></i>
                            </div>
                            Chargement des données...
                        </div>
                    </div>
                </div>

                <!-- Sources Section -->
                <div class="bg-white rounded-lg shadow-md overflow-hidden mt-6">
                    <div class="p-4 border-b border-gray-200">
                        <h2 class="text-xl font-semibold flex items-center gap-2">
                            <i class="fas fa-newspaper"></i> Sources vérifiées
                        </h2>
                    </div>
                    <div class="p-4">
                        <ul class="space-y-2">
                            <li class="flex items-center gap-2">
                                <i class="fas fa-check-circle text-green-500"></i>
                                <span>Agences de presse internationales (AFP, Reuters, AP)</span>
                            </li>
                            <li class="flex items-center gap-2">
                                <i class="fas fa-check-circle text-green-500"></i>
                                <span>Comptes officiels gouvernementaux</span>
                            </li>
                            <li class="flex items-center gap-2">
                                <i class="fas fa-check-circle text-green-500"></i>
                                <span>Organisations humanitaires (ONU, CICR)</span>
                            </li>
                            <li class="flex items-center gap-2">
                                <i class="fas fa-check-circle text-green-500"></i>
                                <span>Médias vérifiés (BBC, Al Jazeera, France 24)</span>
                            </li>
                            <li class="flex items-center gap-2">
                                <i class="fas fa-check-circle text-green-500"></i>
                                <span>OSINT (Bellingcat, Conflict Intelligence Team)</span>
                            </li>
                            <li class="flex items-center gap-2">
                                <i class="fas fa-check-circle text-green-500"></i>
                                <span>Réseaux sociaux vérifiés (via CrowdTangle)</span>
                            </li>
                        </ul>
                        <p class="text-xs text-gray-500 mt-4">
                            <i class="fas fa-info-circle mr-1"></i>
                            Toutes les sources sont vérifiées par notre équipe avant inclusion.
                        </p>
                    </div>
                </div>
            </div>
        </div>

        <!-- Footer -->
        <footer class="mt-8 pt-6 border-t border-gray-200 text-center text-gray-500 text-sm">
            <p>Données mises à jour en temps réel - Dernière actualisation: <span id="lastUpdate">--</span></p>
            <p class="mt-2">© 2023 Cartographie des Frappes Aériennes - Toutes les données sont vérifiées</p>
        </footer>
    </div>

    <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // Initialize map
            const map = L.map('map').setView([20, 0], 2);
            
            // Add tile layer (OpenStreetMap)
            L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
                attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
            }).addTo(map);

            // Custom bomb icon
            const bombIcon = L.divIcon({
                className: 'attack-marker',
                html: '<i class="fas fa-bomb text-red-600 text-2xl"></i>',
                iconSize: [24, 24],
                iconAnchor: [12, 12]
            });

            // Sample data (in a real app, this would come from an API)
            const sampleStrikes = [
                {
                    id: 1,
                    location: "Kharkiv, Ukraine",
                    coordinates: [49.9935, 36.2304],
                    date: new Date(Date.now() - 3600000 * 3).toISOString(), // 3 hours ago
                    source: "BBC Monitoring",
                    casualties: 0,
                    description: "Frappe de missile sur infrastructure énergétique",
                    type: "Missile de croisière"
                },
                {
                    id: 2,
                    location: "Rafah, Palestine",
                    coordinates: [31.2969, 34.2435],
                    date: new Date(Date.now() - 3600000 * 12).toISOString(), // 12 hours ago
                    source: "Al Jazeera + vérification terrain",
                    casualties: 15,
                    description: "Frappe aérienne sur zone résidentielle",
                    type: "Bombardement"
                },
                {
                    id: 3,
                    location: "Sana'a, Yemen",
                    coordinates: [15.3694, 44.1910],
                    date: new Date(Date.now() - 3600000 * 24).toISOString(), // 24 hours ago
                    source: "AFP + sources locales",
                    casualties: 3,
                    description: "Frappe de drone sur dépôt d'armes",
                    type: "Drone"
                },
                {
                    id: 4,
                    location: "Idlib, Syrie",
                    coordinates: [35.9306, 36.6339],
                    date: new Date(Date.now() - 3600000 * 48).toISOString(), // 48 hours ago
                    source: "Syrian Observatory for Human Rights",
                    casualties: 7,
                    description: "Attaque aérienne contre convoi",
                    type: "Frappe aérienne"
                },
                {
                    id: 5,
                    location: "Bakhmut, Ukraine",
                    coordinates: [48.5956, 38.0778],
                    date: new Date(Date.now() - 3600000 * 72).toISOString(), // 72 hours ago
                    source: "Reuters + images satellites",
                    casualties: 2,
                    description: "Frappe sur position militaire",
                    type: "Artillerie guidée"
                }
            ];

            // Function to update UI with data
            function updateUI(strikes) {
                // Clear existing markers
                map.eachLayer(layer => {
                    if (layer instanceof L.Marker) {
                        map.removeLayer(layer);
                    }
                });

                // Add new markers
                strikes.forEach(strike => {
                    const marker = L.marker(strike.coordinates, { icon: bombIcon }).addTo(map);
                    
                    const popupContent = `
                        <div class="custom-popup">
                            <h3 class="font-bold text-lg mb-1">${strike.location}</h3>
                            <p class="text-sm text-gray-600 mb-2">${new Date(strike.date).toLocaleString()}</p>
                            <div class="mb-2">
                                <span class="inline-block bg-red-100 text-red-800 text-xs px-2 py-1 rounded">${strike.type}</span>
                                ${strike.casualties > 0 ? 
                                    `<span class="inline-block bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded ml-1">
                                        ${strike.casualties} ${strike.casualties > 1 ? 'victimes' : 'victime'}
                                    </span>` : ''
                                }
                            </div>
                            <p class="text-sm">${strike.description}</p>
                            <p class="text-xs text-gray-500 mt-2">Source: ${strike.source}</p>
                        </div>
                    `;
                    
                    marker.bindPopup(popupContent);
                });

                // Update stats
                document.getElementById('totalStrikes').textContent = strikes.length;
                document.getElementById('affectedCountries').textContent = new Set(strikes.map(s => s.location.split(',')[1].trim())).size;
                document.getElementById('lastStrike').textContent = new Date(Math.max(...strikes.map(s => new Date(s.date).getTime()))).toLocaleDateString();
                document.getElementById('sourcesCount').textContent = new Set(strikes.map(s => s.source)).size;
                document.getElementById('lastUpdate').textContent = new Date().toLocaleString();

                // Update alerts list
                const alertsList = document.getElementById('alertsList');
                alertsList.innerHTML = '';
                
                strikes.slice(0, 10).forEach(strike => {
                    const alertItem = document.createElement('div');
                    alertItem.className = 'p-4 hover:bg-gray-50 cursor-pointer transition-colors';
                    alertItem.innerHTML = `
                        <div class="flex justify-between items-start">
                            <div>
                                <h3 class="font-medium">${strike.location}</h3>
                                <p class="text-sm text-gray-600">${strike.description}</p>
                            </div>
                            <span class="text-xs text-gray-500 whitespace-nowrap">${new Date(strike.date).toLocaleDateString()}</span>
                        </div>
                        <div class="flex items-center gap-2 mt-2">
                            <span class="text-xs bg-red-100 text-red-800 px-2 py-1 rounded">${strike.type}</span>
                            <span class="text-xs text-gray-500">${strike.source}</span>
                        </div>
                    `;
                    
                    alertItem.addEventListener('click', () => {
                        map.setView(strike.coordinates, 10);
                        const marker = map.getLayers().find(l => 
                            l instanceof L.Marker && 
                            l.getLatLng().lat === strike.coordinates[0] && 
                            l.getLatLng().lng === strike.coordinates[1]
                        );
                        if (marker) marker.openPopup();
                    });
                    
                    alertsList.appendChild(alertItem);
                });

                if (strikes.length === 0) {
                    alertsList.innerHTML = '<div class="p-4 text-center text-gray-500">Aucune frappe récente</div>';
                }
            }

            // Filter function
            function filterStrikes(timeRange) {
                const now = new Date();
                let filtered = [...sampleStrikes];
                
                if (timeRange === '24h') {
                    const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000);
                    filtered = filtered.filter(s => new Date(s.date) > yesterday);
                } else if (timeRange === '7d') {
                    const lastWeek = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
                    filtered = filtered.filter(s => new Date(s.date) > lastWeek);
                } else if (timeRange === '30d') {
                    const lastMonth = new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000);
                    filtered = filtered.filter(s => new Date(s.date) > lastMonth);
                }
                
                return filtered;
            }

            // Initial load
            updateUI(sampleStrikes);

            // Event listeners
            document.getElementById('timeFilter').addEventListener('change', function() {
                const filtered = filterStrikes(this.value);
                updateUI(filtered);
            });

            document.getElementById('refreshBtn').addEventListener('click', function() {
                const btn = this;
                btn.innerHTML = '<i class="fas fa-circle-notch loading-spinner"></i> Actualisation...';
                btn.disabled = true;
                
                // Simulate API call delay
                setTimeout(() => {
                    const timeRange = document.getElementById('timeFilter').value;
                    const filtered = filterStrikes(timeRange);
                    updateUI(filtered);
                    
                    btn.innerHTML = '<i class="fas fa-sync-alt"></i> Actualiser';
                    btn.disabled = false;
                }, 1000);
            });

            // Responsive adjustments
            function handleResize() {
                setTimeout(() => map.invalidateSize(), 100);
            }
            window.addEventListener('resize', handleResize);
        });
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://deepsite.hf.co/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://deepsite.hf.co" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://deepsite.hf.co?remix=masterseb/frappes" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>