Spaces:
Running
Running
undefined - Initial Deployment
Browse files- README.md +6 -4
- index.html +420 -19
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
colorTo: pink
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: sh-1
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: green
|
5 |
colorTo: pink
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,420 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="ar" dir="rtl">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>دليل عسير الذكي - الخرائط التفاعلية</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
|
9 |
+
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
|
10 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
11 |
+
<style>
|
12 |
+
#map {
|
13 |
+
height: 70vh;
|
14 |
+
border-radius: 16px;
|
15 |
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
|
16 |
+
}
|
17 |
+
.custom-icon {
|
18 |
+
background-color: #fff;
|
19 |
+
border-radius: 50%;
|
20 |
+
padding: 8px;
|
21 |
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
|
22 |
+
display: flex;
|
23 |
+
justify-content: center;
|
24 |
+
align-items: center;
|
25 |
+
}
|
26 |
+
.location-info {
|
27 |
+
transition: all 0.3s ease;
|
28 |
+
}
|
29 |
+
.ar-marker {
|
30 |
+
background-color: #38a169;
|
31 |
+
color: white;
|
32 |
+
border-radius: 50%;
|
33 |
+
width: 40px;
|
34 |
+
height: 40px;
|
35 |
+
display: flex;
|
36 |
+
justify-content: center;
|
37 |
+
align-items: center;
|
38 |
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
|
39 |
+
cursor: pointer;
|
40 |
+
}
|
41 |
+
.filter-btn.active {
|
42 |
+
background-color: #2f855a;
|
43 |
+
color: white;
|
44 |
+
}
|
45 |
+
@media (max-width: 768px) {
|
46 |
+
#map {
|
47 |
+
height: 60vh;
|
48 |
+
}
|
49 |
+
}
|
50 |
+
</style>
|
51 |
+
</head>
|
52 |
+
<body class="bg-gray-50 font-sans">
|
53 |
+
<!-- Header -->
|
54 |
+
<header class="bg-gradient-to-r from-green-800 to-green-600 text-white shadow-lg">
|
55 |
+
<div class="container mx-auto px-4 py-6">
|
56 |
+
<div class="flex justify-between items-center">
|
57 |
+
<div class="flex items-center space-x-4">
|
58 |
+
<img src="https://via.placeholder.com/50" alt="شعار عسير" class="h-12 w-12 rounded-full border-2 border-white">
|
59 |
+
<h1 class="text-2xl font-bold">دليل عسير الذكي</h1>
|
60 |
+
</div>
|
61 |
+
<div class="flex items-center space-x-4">
|
62 |
+
<button class="bg-white text-green-800 px-4 py-2 rounded-lg font-medium hover:bg-gray-100 transition">
|
63 |
+
<i class="fas fa-user mr-2"></i>تسجيل الدخول
|
64 |
+
</button>
|
65 |
+
<button class="text-white">
|
66 |
+
<i class="fas fa-bars text-2xl"></i>
|
67 |
+
</button>
|
68 |
+
</div>
|
69 |
+
</div>
|
70 |
+
</div>
|
71 |
+
</header>
|
72 |
+
|
73 |
+
<!-- Main Content -->
|
74 |
+
<main class="container mx-auto px-4 py-8">
|
75 |
+
<!-- Search and Controls -->
|
76 |
+
<div class="flex flex-col md:flex-row justify-between items-start md:items-center mb-6 gap-4">
|
77 |
+
<div class="relative w-full md:w-1/2">
|
78 |
+
<input type="text" placeholder="ابحث عن موقع أو فعالية..."
|
79 |
+
class="w-full pr-12 pl-4 py-3 rounded-full border border-gray-300 focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent">
|
80 |
+
<button class="absolute left-4 top-3 text-gray-500">
|
81 |
+
<i class="fas fa-search"></i>
|
82 |
+
</button>
|
83 |
+
</div>
|
84 |
+
|
85 |
+
<div class="flex flex-wrap gap-2 w-full md:w-auto">
|
86 |
+
<button id="suggest-btn" class="flex items-center bg-green-100 text-green-800 px-4 py-2 rounded-lg font-medium hover:bg-green-200 transition">
|
87 |
+
<i class="fas fa-lightbulb ml-2"></i> اقتراح رحلة اليوم
|
88 |
+
</button>
|
89 |
+
<button id="location-btn" class="flex items-center bg-blue-100 text-blue-800 px-4 py-2 rounded-lg font-medium hover:bg-blue-200 transition">
|
90 |
+
<i class="fas fa-location-arrow ml-2"></i> موقعي الحالي
|
91 |
+
</button>
|
92 |
+
<button id="ar-btn" class="flex items-center bg-purple-100 text-purple-800 px-4 py-2 rounded-lg font-medium hover:bg-purple-200 transition">
|
93 |
+
<i class="fas fa-vr-cardboard ml-2"></i> الواقع المعزز
|
94 |
+
</button>
|
95 |
+
</div>
|
96 |
+
</div>
|
97 |
+
|
98 |
+
<!-- Map and Sidebar -->
|
99 |
+
<div class="flex flex-col lg:flex-row gap-6">
|
100 |
+
<!-- Filters Sidebar -->
|
101 |
+
<div class="w-full lg:w-1/4 bg-white p-4 rounded-xl shadow-md">
|
102 |
+
<h2 class="text-xl font-bold mb-4 text-gray-800 border-b pb-2">تصفية النتائج</h2>
|
103 |
+
|
104 |
+
<div class="space-y-3">
|
105 |
+
<h3 class="font-semibold text-gray-700">التصنيفات</h3>
|
106 |
+
<div class="flex flex-wrap gap-2">
|
107 |
+
<button class="filter-btn active" data-filter="all">
|
108 |
+
الكل
|
109 |
+
</button>
|
110 |
+
<button class="filter-btn" data-filter="nature">
|
111 |
+
<i class="fas fa-mountain mr-1"></i> طبيعة
|
112 |
+
</button>
|
113 |
+
<button class="filter-btn" data-filter="heritage">
|
114 |
+
<i class="fas fa-landmark mr-1"></i> تراث
|
115 |
+
</button>
|
116 |
+
<button class="filter-btn" data-filter="events">
|
117 |
+
<i class="fas fa-calendar-alt mr-1"></i> فعاليات
|
118 |
+
</button>
|
119 |
+
<button class="filter-btn" data-filter="food">
|
120 |
+
<i class="fas fa-utensils mr-1"></i> مطاعم
|
121 |
+
</button>
|
122 |
+
</div>
|
123 |
+
</div>
|
124 |
+
|
125 |
+
<div class="mt-6 space-y-3">
|
126 |
+
<h3 class="font-semibold text-gray-700">المسافة</h3>
|
127 |
+
<div class="flex items-center gap-2">
|
128 |
+
<input type="range" min="1" max="50" value="10" class="w-full h-2 bg-green-200 rounded-lg appearance-none cursor-pointer">
|
129 |
+
<span class="text-sm font-medium text-gray-600">10 كم</span>
|
130 |
+
</div>
|
131 |
+
</div>
|
132 |
+
|
133 |
+
<div class="mt-6">
|
134 |
+
<h3 class="font-semibold text-gray-700">الموصى بها</h3>
|
135 |
+
<div class="mt-2 space-y-2">
|
136 |
+
<div class="flex items-center p-2 hover:bg-gray-100 rounded-lg cursor-pointer">
|
137 |
+
<div class="bg-green-100 p-2 rounded-lg mr-2">
|
138 |
+
<i class="fas fa-mountain text-green-600"></i>
|
139 |
+
</div>
|
140 |
+
<div>
|
141 |
+
<p class="font-medium">جبل السودة</p>
|
142 |
+
<p class="text-xs text-gray-500">4.8 ★ (120 تقييم)</p>
|
143 |
+
</div>
|
144 |
+
</div>
|
145 |
+
<div class="flex items-center p-2 hover:bg-gray-100 rounded-lg cursor-pointer">
|
146 |
+
<div class="bg-yellow-100 p-2 rounded-lg mr-2">
|
147 |
+
<i class="fas fa-landmark text-yellow-600"></i>
|
148 |
+
</div>
|
149 |
+
<div>
|
150 |
+
<p class="font-medium">قرية رجال ألمع</p>
|
151 |
+
<p class="text-xs text-gray-500">4.7 ★ (95 تقييم)</p>
|
152 |
+
</div>
|
153 |
+
</div>
|
154 |
+
</div>
|
155 |
+
</div>
|
156 |
+
</div>
|
157 |
+
|
158 |
+
<!-- Map Container -->
|
159 |
+
<div class="w-full lg:w-3/4">
|
160 |
+
<div id="map"></div>
|
161 |
+
|
162 |
+
<!-- Location Info Card (hidden by default) -->
|
163 |
+
<div id="location-info" class="hidden mt-4 bg-white p-4 rounded-xl shadow-md location-info">
|
164 |
+
<div class="flex justify-between items-start">
|
165 |
+
<div>
|
166 |
+
<h3 class="text-xl font-bold text-gray-800" id="location-title">جبل السودة</h3>
|
167 |
+
<div class="flex items-center mt-1">
|
168 |
+
<div class="flex text-yellow-400">
|
169 |
+
<i class="fas fa-star"></i>
|
170 |
+
<i class="fas fa-star"></i>
|
171 |
+
<i class="fas fa-star"></i>
|
172 |
+
<i class="fas fa-star"></i>
|
173 |
+
<i class="fas fa-star-half-alt"></i>
|
174 |
+
</div>
|
175 |
+
<span class="text-gray-600 text-sm mr-1">4.7 (128 تقييم)</span>
|
176 |
+
</div>
|
177 |
+
</div>
|
178 |
+
<button id="close-info" class="text-gray-500 hover:text-gray-700">
|
179 |
+
<i class="fas fa-times"></i>
|
180 |
+
</button>
|
181 |
+
</div>
|
182 |
+
|
183 |
+
<div class="mt-4 flex gap-4">
|
184 |
+
<img src="https://via.placeholder.com/150" alt="موقع" class="w-24 h-24 rounded-lg object-cover">
|
185 |
+
<p class="text-gray-700 text-sm flex-1" id="location-desc">
|
186 |
+
جبل السودة هو أعلى قمة في المملكة العربية السعودية�� يصل ارتفاعه إلى حوالي 3,015 متر فوق مستوى سطح البحر. يتميز بإطلالة بانورامية رائعة وغابات كثيفة، وهو وجهة مثالية لعشاق الطبيعة والمغامرات.
|
187 |
+
</p>
|
188 |
+
</div>
|
189 |
+
|
190 |
+
<div class="mt-4 flex flex-wrap gap-2">
|
191 |
+
<button class="bg-green-600 text-white px-4 py-2 rounded-lg font-medium hover:bg-green-700 transition flex items-center">
|
192 |
+
<i class="fas fa-route ml-2"></i> ابدأ المسار
|
193 |
+
</button>
|
194 |
+
<button class="bg-blue-600 text-white px-4 py-2 rounded-lg font-medium hover:bg-blue-700 transition flex items-center">
|
195 |
+
<i class="fas fa-vr-cardboard ml-2"></i> مشاهدة AR
|
196 |
+
</button>
|
197 |
+
<button class="bg-purple-600 text-white px-4 py-2 rounded-lg font-medium hover:bg-purple-700 transition flex items-center">
|
198 |
+
<i class="fas fa-headphones ml-2"></i> استماع للوصف
|
199 |
+
</button>
|
200 |
+
</div>
|
201 |
+
</div>
|
202 |
+
</div>
|
203 |
+
</div>
|
204 |
+
</main>
|
205 |
+
|
206 |
+
<!-- AI Assistant Modal -->
|
207 |
+
<div id="ai-modal" class="hidden fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
|
208 |
+
<div class="bg-white rounded-xl p-6 max-w-md w-full mx-4">
|
209 |
+
<div class="flex justify-between items-center mb-4">
|
210 |
+
<div class="flex items-center">
|
211 |
+
<div class="bg-green-100 p-2 rounded-full mr-3">
|
212 |
+
<i class="fas fa-robot text-green-600"></i>
|
213 |
+
</div>
|
214 |
+
<h3 class="text-xl font-bold text-gray-800">مساعد إيفا الذكي</h3>
|
215 |
+
</div>
|
216 |
+
<button id="close-ai-modal" class="text-gray-500 hover:text-gray-700">
|
217 |
+
<i class="fas fa-times"></i>
|
218 |
+
</button>
|
219 |
+
</div>
|
220 |
+
|
221 |
+
<div class="bg-gray-100 p-4 rounded-lg mb-4">
|
222 |
+
<p class="text-gray-800">مرحباً بك في عسير! بناءً على موقعك الحالي والطقس الجميل اليوم، أنصحك بزيارة:</p>
|
223 |
+
<ol class="list-decimal list-inside mt-2 space-y-2">
|
224 |
+
<li class="font-medium">قرية رجال ألمع التراثية (مسافة 15 كم)</li>
|
225 |
+
<li class="font-medium">منتزه السحاب (مسافة 8 كم)</li>
|
226 |
+
<li class="font-medium">سوق الثلاثاء الشعبي (يفتح بعد 3 ساعات)</li>
|
227 |
+
</ol>
|
228 |
+
</div>
|
229 |
+
|
230 |
+
<div class="flex justify-end">
|
231 |
+
<button id="confirm-suggestion" class="bg-green-600 text-white px-4 py-2 rounded-lg font-medium hover:bg-green-700 transition">
|
232 |
+
عرض على الخريطة
|
233 |
+
</button>
|
234 |
+
</div>
|
235 |
+
</div>
|
236 |
+
</div>
|
237 |
+
|
238 |
+
<script>
|
239 |
+
// Initialize the map
|
240 |
+
const map = L.map('map').setView([19.0968, 42.8633], 10); // Asir coordinates
|
241 |
+
|
242 |
+
// Add OpenStreetMap tiles
|
243 |
+
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
244 |
+
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
245 |
+
}).addTo(map);
|
246 |
+
|
247 |
+
// Custom icons
|
248 |
+
const natureIcon = L.divIcon({
|
249 |
+
html: '<div class="custom-icon" style="border: 2px solid #38a169;"><i class="fas fa-mountain text-green-600"></i></div>',
|
250 |
+
className: 'dummy',
|
251 |
+
iconSize: [30, 30],
|
252 |
+
iconAnchor: [15, 15]
|
253 |
+
});
|
254 |
+
|
255 |
+
const heritageIcon = L.divIcon({
|
256 |
+
html: '<div class="custom-icon" style="border: 2px solid #d69e2e;"><i class="fas fa-landmark text-yellow-600"></i></div>',
|
257 |
+
className: 'dummy',
|
258 |
+
iconSize: [30, 30],
|
259 |
+
iconAnchor: [15, 15]
|
260 |
+
});
|
261 |
+
|
262 |
+
const eventIcon = L.divIcon({
|
263 |
+
html: '<div class="custom-icon" style="border: 2px solid #9f7aea;"><i class="fas fa-calendar-alt text-purple-600"></i></div>',
|
264 |
+
className: 'dummy',
|
265 |
+
iconSize: [30, 30],
|
266 |
+
iconAnchor: [15, 15]
|
267 |
+
});
|
268 |
+
|
269 |
+
const foodIcon = L.divIcon({
|
270 |
+
html: '<div class="custom-icon" style="border: 2px solid #e53e3e;"><i class="fas fa-utensils text-red-600"></i></div>',
|
271 |
+
className: 'dummy',
|
272 |
+
iconSize: [30, 30],
|
273 |
+
iconAnchor: [15, 15]
|
274 |
+
});
|
275 |
+
|
276 |
+
// Sample locations data
|
277 |
+
const locations = [
|
278 |
+
{
|
279 |
+
name: "جبل السودة",
|
280 |
+
type: "nature",
|
281 |
+
coords: [19.1819, 42.4153],
|
282 |
+
rating: 4.7,
|
283 |
+
reviews: 128,
|
284 |
+
description: "جبل السودة هو أعلى قمة في المملكة العربية السعودية، يصل ارتفاعه إلى حوالي 3,015 متر فوق مستوى سطح البحر. يتميز بإطلالة بانورامية رائعة وغابات كثيفة، وهو وجهة مثالية لعشاق الطبيعة والمغامرات."
|
285 |
+
},
|
286 |
+
{
|
287 |
+
name: "قرية رجال ألمع التراثية",
|
288 |
+
type: "heritage",
|
289 |
+
coords: [19.1606, 42.6497],
|
290 |
+
rating: 4.8,
|
291 |
+
reviews: 95,
|
292 |
+
description: "قرية تراثية تعود إلى أكثر من 350 عاماً، تتميز ببيوتها الحجرية المبنية بطريقة فريدة. تحتوي القرية على متحف يعرض التراث المحلي وأسلوب الحياة التقليدية في المنطقة."
|
293 |
+
},
|
294 |
+
{
|
295 |
+
name: "منتزه السحاب",
|
296 |
+
type: "nature",
|
297 |
+
coords: [18.9178, 42.9472],
|
298 |
+
rating: 4.5,
|
299 |
+
reviews: 76,
|
300 |
+
description: "منتزه طبيعي يقدم إطلالات خلابة على الضباب الذي يغطي الجبال صباحاً. يحتوي على مسارات للمشي ومقاعد للاسترخاء بين أحضان الطبيعة."
|
301 |
+
},
|
302 |
+
{
|
303 |
+
name: "سوق الثلاثاء الشعبي",
|
304 |
+
type: "events",
|
305 |
+
coords: [19.1200, 42.8000],
|
306 |
+
rating: 4.6,
|
307 |
+
reviews: 112,
|
308 |
+
description: "سوق أسبوعي يقام كل يوم ثلاثاء، يعرض المنتجات المحلية من أعمال يدوية، ملابس تقليدية، وأطعمة شعبية. فرصة رائعة لتجربة الثقافة المحلية وشراء الهدايا التذكارية."
|
309 |
+
},
|
310 |
+
{
|
311 |
+
name: "مطعم النخبة",
|
312 |
+
type: "food",
|
313 |
+
coords: [18.9878, 42.8672],
|
314 |
+
rating: 4.4,
|
315 |
+
reviews: 64,
|
316 |
+
description: "مطعم يقدم الأطباق المحلية الشهية بأسلوب عصري. تشتهر به بالكبسة العسيرية والمندي اللذيذ. يتميز بجو عائلي وديكور تقليدي حديث."
|
317 |
+
}
|
318 |
+
];
|
319 |
+
|
320 |
+
// Add markers to the map
|
321 |
+
const markers = [];
|
322 |
+
locations.forEach(location => {
|
323 |
+
let icon;
|
324 |
+
switch(location.type) {
|
325 |
+
case 'nature': icon = natureIcon; break;
|
326 |
+
case 'heritage': icon = heritageIcon; break;
|
327 |
+
case 'events': icon = eventIcon; break;
|
328 |
+
case 'food': icon = foodIcon; break;
|
329 |
+
default: icon = natureIcon;
|
330 |
+
}
|
331 |
+
|
332 |
+
const marker = L.marker(location.coords, { icon }).addTo(map);
|
333 |
+
marker.bindPopup(`<b>${location.name}</b><br>${location.type === 'nature' ? 'طبيعة' :
|
334 |
+
location.type === 'heritage' ? 'تراث' :
|
335 |
+
location.type === 'events' ? 'فعالية' : 'مطعم'} | ${location.rating} ★`);
|
336 |
+
|
337 |
+
marker.on('click', () => {
|
338 |
+
document.getElementById('location-title').textContent = location.name;
|
339 |
+
document.getElementById('location-desc').textContent = location.description;
|
340 |
+
document.getElementById('location-info').classList.remove('hidden');
|
341 |
+
|
342 |
+
// Scroll to info card on mobile
|
343 |
+
if (window.innerWidth < 1024) {
|
344 |
+
document.getElementById('location-info').scrollIntoView({ behavior: 'smooth' });
|
345 |
+
}
|
346 |
+
});
|
347 |
+
|
348 |
+
markers.push({ marker, type: location.type });
|
349 |
+
});
|
350 |
+
|
351 |
+
// Filter buttons functionality
|
352 |
+
document.querySelectorAll('.filter-btn').forEach(btn => {
|
353 |
+
btn.addEventListener('click', () => {
|
354 |
+
document.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active'));
|
355 |
+
btn.classList.add('active');
|
356 |
+
|
357 |
+
const filter = btn.dataset.filter;
|
358 |
+
|
359 |
+
markers.forEach(({ marker, type }) => {
|
360 |
+
if (filter === 'all' || type === filter) {
|
361 |
+
marker.addTo(map);
|
362 |
+
} else {
|
363 |
+
map.removeLayer(marker);
|
364 |
+
}
|
365 |
+
});
|
366 |
+
});
|
367 |
+
});
|
368 |
+
|
369 |
+
// Location button - simulate getting user location
|
370 |
+
document.getElementById('location-btn').addEventListener('click', () => {
|
371 |
+
// In a real app, you would use Geolocation API here
|
372 |
+
alert('جارٍ تحديد موقعك... سيتم عرض موقعك على الخريطة');
|
373 |
+
|
374 |
+
// Simulate location near Abha
|
375 |
+
const userLocation = [18.2167, 42.5053];
|
376 |
+
L.marker(userLocation, {
|
377 |
+
icon: L.divIcon({
|
378 |
+
html: '<div class="ar-marker"><i class="fas fa-user"></i></div>',
|
379 |
+
className: 'dummy',
|
380 |
+
iconSize: [40, 40],
|
381 |
+
iconAnchor: [20, 20]
|
382 |
+
})
|
383 |
+
}).addTo(map).bindPopup('موقعك الحالي').openPopup();
|
384 |
+
|
385 |
+
map.setView(userLocation, 13);
|
386 |
+
});
|
387 |
+
|
388 |
+
// Suggestion button
|
389 |
+
document.getElementById('suggest-btn').addEventListener('click', () => {
|
390 |
+
document.getElementById('ai-modal').classList.remove('hidden');
|
391 |
+
});
|
392 |
+
|
393 |
+
document.getElementById('close-ai-modal').addEventListener('click', () => {
|
394 |
+
document.getElementById('ai-modal').classList.add('hidden');
|
395 |
+
});
|
396 |
+
|
397 |
+
document.getElementById('confirm-suggestion').addEventListener('click', () => {
|
398 |
+
document.getElementById('ai-modal').classList.add('hidden');
|
399 |
+
// Filter to show recommended locations
|
400 |
+
document.querySelector('.filter-btn[data-filter="all"]').click();
|
401 |
+
map.setView([19.1606, 42.6497], 11); // Center on Rijal Almaa
|
402 |
+
});
|
403 |
+
|
404 |
+
// Close location info
|
405 |
+
document.getElementById('close-info').addEventListener('click', () => {
|
406 |
+
document.getElementById('location-info').classList.add('hidden');
|
407 |
+
});
|
408 |
+
|
409 |
+
// AR button
|
410 |
+
document.getElementById('ar-btn').addEventListener('click', () => {
|
411 |
+
alert('جارٍ فتح كاميرا الواقع المعزز... تأكد من السماح بالوصول إلى الكاميرا');
|
412 |
+
});
|
413 |
+
|
414 |
+
// Responsive adjustments
|
415 |
+
window.addEventListener('resize', () => {
|
416 |
+
map.invalidateSize();
|
417 |
+
});
|
418 |
+
</script>
|
419 |
+
<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://enzostvs-deepsite.hf.space/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://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=wasmdashai/sh-1" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
420 |
+
</html>
|