Spaces:
Running
Running
Add 3 files
Browse files- README.md +7 -5
- index.html +448 -19
- prompts.txt +1 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 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: condor
|
| 3 |
+
emoji: ⚛️
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: red
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- QwenSite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,448 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="it">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8" />
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
| 6 |
+
<title>Navigatore Italia</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
| 9 |
+
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"/>
|
| 10 |
+
<script src="https://unpkg.com/@babylonjs/core@latest"></script>
|
| 11 |
+
<script src="https://unpkg.com/@babylonjs/loaders@latest"></script>
|
| 12 |
+
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" rel="stylesheet"/>
|
| 13 |
+
<style>
|
| 14 |
+
#map-2d {
|
| 15 |
+
height: 100vh;
|
| 16 |
+
width: 100%;
|
| 17 |
+
position: absolute;
|
| 18 |
+
top: 0;
|
| 19 |
+
left: 0;
|
| 20 |
+
z-index: 1;
|
| 21 |
+
}
|
| 22 |
+
#map-3d {
|
| 23 |
+
height: 100vh;
|
| 24 |
+
width: 100%;
|
| 25 |
+
position: absolute;
|
| 26 |
+
top: 0;
|
| 27 |
+
left: 0;
|
| 28 |
+
z-index: 0;
|
| 29 |
+
visibility: hidden;
|
| 30 |
+
}
|
| 31 |
+
.search-suggestion {
|
| 32 |
+
@apply p-2 hover:bg-gray-100 cursor-pointer text-sm border-b border-gray-200 last:border-b-0;
|
| 33 |
+
}
|
| 34 |
+
.voice-bubble {
|
| 35 |
+
@apply bg-blue-600 text-white px-3 py-1 rounded-full text-xs animate-pulse;
|
| 36 |
+
}
|
| 37 |
+
.route-step {
|
| 38 |
+
@apply p-2 border-b border-gray-100 text-sm;
|
| 39 |
+
}
|
| 40 |
+
.route-step:last-child {
|
| 41 |
+
@apply border-b-0;
|
| 42 |
+
}
|
| 43 |
+
</style>
|
| 44 |
+
</head>
|
| 45 |
+
<body class="font-sans bg-gray-50 relative overflow-hidden">
|
| 46 |
+
|
| 47 |
+
<!-- 3D Map Container (Babylon.js) -->
|
| 48 |
+
<div id="map-3d"></div>
|
| 49 |
+
|
| 50 |
+
<!-- 2D Map Container (Leaflet) -->
|
| 51 |
+
<div id="map-2d"></div>
|
| 52 |
+
|
| 53 |
+
<!-- Top Navigation Bar -->
|
| 54 |
+
<div class="absolute top-0 left-0 w-full z-50 p-4 flex justify-between items-center bg-gradient-to-b from-black/70 to-transparent text-white">
|
| 55 |
+
<div class="flex items-center space-x-2">
|
| 56 |
+
<div class="bg-blue-500 p-2 rounded-full">
|
| 57 |
+
<i class="fas fa-map-marked-alt text-white"></i>
|
| 58 |
+
</div>
|
| 59 |
+
<h1 class="text-lg font-bold">Navigatore Italia</h1>
|
| 60 |
+
</div>
|
| 61 |
+
<button id="view-toggle" class="bg-white/20 backdrop-blur-sm p-2 rounded-full">
|
| 62 |
+
<i class="fas fa-cube text-white"></i>
|
| 63 |
+
</button>
|
| 64 |
+
</div>
|
| 65 |
+
|
| 66 |
+
<!-- Search Bar -->
|
| 67 |
+
<div class="absolute top-20 left-1/2 transform -translate-x-1/2 w-11/12 z-50 bg-white rounded-full shadow-lg overflow-hidden">
|
| 68 |
+
<div class="flex items-center p-2">
|
| 69 |
+
<i class="fas fa-search text-gray-400 ml-3"></i>
|
| 70 |
+
<input
|
| 71 |
+
type="text"
|
| 72 |
+
id="search-input"
|
| 73 |
+
placeholder="Cerca città, indirizzo..."
|
| 74 |
+
class="flex-grow p-2 outline-none text-sm"
|
| 75 |
+
/>
|
| 76 |
+
</div>
|
| 77 |
+
<!-- Search Suggestions -->
|
| 78 |
+
<div id="search-suggestions" class="hidden bg-white rounded-b-full shadow-lg max-h-60 overflow-y-auto">
|
| 79 |
+
<!-- Dynamically populated -->
|
| 80 |
+
</div>
|
| 81 |
+
</div>
|
| 82 |
+
|
| 83 |
+
<!-- Bottom Panel -->
|
| 84 |
+
<div id="bottom-panel" class="absolute bottom-0 left-0 w-full bg-white rounded-t-2xl shadow-lg p-4 transform translate-y-full transition-transform duration-300 z-50">
|
| 85 |
+
<div class="w-12 h-1 bg-gray-300 rounded-full mx-auto mb-4"></div>
|
| 86 |
+
|
| 87 |
+
<!-- Current Location -->
|
| 88 |
+
<div class="flex items-center mb-4">
|
| 89 |
+
<div class="bg-green-500 p-2 rounded-full mr-3">
|
| 90 |
+
<i class="fas fa-location-arrow text-white transform rotate-45"></i>
|
| 91 |
+
</div>
|
| 92 |
+
<div>
|
| 93 |
+
<p class="text-xs text-gray-500">Posizione attuale</p>
|
| 94 |
+
<p id="current-location" class="font-medium">Rilevamento posizione...</p>
|
| 95 |
+
</div>
|
| 96 |
+
</div>
|
| 97 |
+
|
| 98 |
+
<!-- Route Instructions -->
|
| 99 |
+
<div id="route-instructions" class="hidden">
|
| 100 |
+
<h3 class="font-bold mb-2">Istruzioni</h3>
|
| 101 |
+
<div id="route-steps" class="space-y-1">
|
| 102 |
+
<!-- Dynamically added -->
|
| 103 |
+
</div>
|
| 104 |
+
</div>
|
| 105 |
+
|
| 106 |
+
<!-- Start Navigation Button -->
|
| 107 |
+
<button id="start-navigation" class="hidden mt-4 bg-blue-600 text-white w-full py-3 rounded-xl font-bold shadow-lg hover:bg-blue-700 transition">
|
| 108 |
+
<i class="fas fa-car mr-2"></i> Inizia Navigazione
|
| 109 |
+
</button>
|
| 110 |
+
</div>
|
| 111 |
+
|
| 112 |
+
<!-- Voice Guidance Bubble -->
|
| 113 |
+
<div class="absolute top-32 right-5 z-50 hidden" id="voice-bubble">
|
| 114 |
+
<div class="voice-bubble px-4 py-2 rounded-full max-w-xs">
|
| 115 |
+
<i class="fas fa-volume-up mr-1"></i> <span id="voice-text">Preparati a girare</span>
|
| 116 |
+
</div>
|
| 117 |
+
</div>
|
| 118 |
+
|
| 119 |
+
<!-- Compass & Speed -->
|
| 120 |
+
<div class="absolute top-16 left-5 z-50 bg-white/90 backdrop-blur-sm p-2 rounded-full shadow hidden" id="compass-speed">
|
| 121 |
+
<div class="text-center">
|
| 122 |
+
<div class="text-xs font-bold" id="speed-value">0</div>
|
| 123 |
+
<div class="text-xs text-gray-600">km/h</div>
|
| 124 |
+
</div>
|
| 125 |
+
</div>
|
| 126 |
+
|
| 127 |
+
<script>
|
| 128 |
+
// Simulated Italian locations for search
|
| 129 |
+
const italianLocations = [
|
| 130 |
+
"Roma, Italia",
|
| 131 |
+
"Milano, Italia",
|
| 132 |
+
"Napoli, Italia",
|
| 133 |
+
"Torino, Italia",
|
| 134 |
+
"Palermo, Italia",
|
| 135 |
+
"Genova, Italia",
|
| 136 |
+
"Bologna, Italia",
|
| 137 |
+
"Firenze, Italia",
|
| 138 |
+
"Bari, Italia",
|
| 139 |
+
"Catania, Italia",
|
| 140 |
+
"Venezia, Italia",
|
| 141 |
+
"Verona, Italia",
|
| 142 |
+
"Messina, Italia",
|
| 143 |
+
"Padova, Italia",
|
| 144 |
+
"Trieste, Italia",
|
| 145 |
+
"Brescia, Italia",
|
| 146 |
+
"Taranto, Italia",
|
| 147 |
+
"Prato, Italia",
|
| 148 |
+
"Reggio Calabria, Italia",
|
| 149 |
+
"Modena, Italia",
|
| 150 |
+
"Via Garibaldi, Roma",
|
| 151 |
+
"Piazza del Duomo, Milano",
|
| 152 |
+
"Costiera Amalfitana, Salerno",
|
| 153 |
+
"Lago di Garda, Lombardia",
|
| 154 |
+
"Cinque Terre, La Spezia",
|
| 155 |
+
"Valle d'Aosta",
|
| 156 |
+
"Dolomiti, Trentino",
|
| 157 |
+
"Sicilia, Catania",
|
| 158 |
+
"Sardegna, Cagliari",
|
| 159 |
+
"Toscana, Siena"
|
| 160 |
+
];
|
| 161 |
+
|
| 162 |
+
// Initialize Leaflet Map (2D)
|
| 163 |
+
const map2d = L.map('map-2d').setView([41.9028, 12.4964], 6); // Center on Italy
|
| 164 |
+
|
| 165 |
+
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
| 166 |
+
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
| 167 |
+
}).addTo(map2d);
|
| 168 |
+
|
| 169 |
+
// Initialize Babylon.js (3D)
|
| 170 |
+
const canvas = document.getElementById("map-3d");
|
| 171 |
+
const engine = new BABYLON.Engine(canvas, true);
|
| 172 |
+
const createScene = function () {
|
| 173 |
+
const scene = new BABYLON.Scene(engine);
|
| 174 |
+
scene.clearColor = new BABYLON.Color3(0.8, 0.9, 1);
|
| 175 |
+
|
| 176 |
+
const camera = new BABYLON.ArcRotateCamera("camera", -Math.PI / 2, Math.PI / 2.5, 20, new BABYLON.Vector3(0, 0, 0), scene);
|
| 177 |
+
camera.useAutoRotationBehavior = true;
|
| 178 |
+
camera.autoRotationBehavior.idleRotationSpeed = 0.01;
|
| 179 |
+
camera.autoRotationBehavior.zoomStopsAnimation = false;
|
| 180 |
+
camera.panningSensibility = 0;
|
| 181 |
+
camera.lowerRadiusLimit = 5;
|
| 182 |
+
camera.upperRadiusLimit = 50;
|
| 183 |
+
camera.attachControl(canvas, true);
|
| 184 |
+
|
| 185 |
+
const light = new BABYLON.HemisphericLight("light", new BABYLON.Vector3(0, 1, 0), scene);
|
| 186 |
+
light.intensity = 0.7;
|
| 187 |
+
|
| 188 |
+
// Create Italy-like 3D terrain
|
| 189 |
+
const ground = BABYLON.MeshBuilder.CreateGroundFromHeightMap(
|
| 190 |
+
"gdHM",
|
| 191 |
+
"https://www.babylonjs-playground.com/textures/heightMap.png",
|
| 192 |
+
{width: 20, height: 20, subdivisions: 100, minHeight: 0, maxHeight: 10, onReady: function(mesh) {
|
| 193 |
+
mesh.position.y = -5;
|
| 194 |
+
const material = new BABYLON.StandardMaterial("mat", scene);
|
| 195 |
+
material.diffuseTexture = new BABYLON.Texture("https://www.babylonjs-playground.com/textures/italy-map.jpg", scene);
|
| 196 |
+
mesh.material = material;
|
| 197 |
+
}},
|
| 198 |
+
scene
|
| 199 |
+
);
|
| 200 |
+
|
| 201 |
+
// Create some random 3D buildings to represent cities
|
| 202 |
+
const colors = [new BABYLON.Color3(0.8, 0.4, 0.4), new BABYLON.Color3(0.6, 0.6, 0.8), new BABYLON.Color3(0.9, 0.7, 0.5)];
|
| 203 |
+
const cities = [
|
| 204 |
+
{ name: "Roma", x: 0, z: 0, height: 2 },
|
| 205 |
+
{ name: "Milano", x: 3, z: -2, height: 1.8 },
|
| 206 |
+
{ name: "Napoli", x: -2, z: 3, height: 1.6 },
|
| 207 |
+
{ name: "Torino", x: 4, z: -4, height: 1.4 },
|
| 208 |
+
{ name: "Palermo", x: -6, z: 6, height: 1.2 }
|
| 209 |
+
];
|
| 210 |
+
|
| 211 |
+
cities.forEach(city => {
|
| 212 |
+
const box = BABYLON.MeshBuilder.CreateBox("city", {width: 0.5, depth: 0.5, height: city.height}, scene);
|
| 213 |
+
box.position = new BABYLON.Vector3(city.x, city.height/2, city.z);
|
| 214 |
+
const mat = new BABYLON.StandardMaterial("mat", scene);
|
| 215 |
+
mat.diffuseColor = colors[Math.floor(Math.random() * colors.length)];
|
| 216 |
+
box.material = mat;
|
| 217 |
+
});
|
| 218 |
+
|
| 219 |
+
return scene;
|
| 220 |
+
};
|
| 221 |
+
|
| 222 |
+
const scene = createScene();
|
| 223 |
+
|
| 224 |
+
engine.runRenderLoop(function () {
|
| 225 |
+
scene.render();
|
| 226 |
+
});
|
| 227 |
+
|
| 228 |
+
window.addEventListener("resize", function () {
|
| 229 |
+
engine.resize();
|
| 230 |
+
});
|
| 231 |
+
|
| 232 |
+
// UI Interactions
|
| 233 |
+
const searchInput = document.getElementById('search-input');
|
| 234 |
+
const searchSuggestions = document.getElementById('search-suggestions');
|
| 235 |
+
const bottomPanel = document.getElementById('bottom-panel');
|
| 236 |
+
const startNavigationBtn = document.getElementById('start-navigation');
|
| 237 |
+
const routeInstructions = document.getElementById('route-instructions');
|
| 238 |
+
const routeSteps = document.getElementById('route-steps');
|
| 239 |
+
const currentLocation = document.getElementById('current-location');
|
| 240 |
+
const viewToggle = document.getElementById('view-toggle');
|
| 241 |
+
const map3d = document.getElementById('map-3d');
|
| 242 |
+
const voiceBubble = document.getElementById('voice-bubble');
|
| 243 |
+
const voiceText = document.getElementById('voice-text');
|
| 244 |
+
const compassSpeed = document.getElementById('compass-speed');
|
| 245 |
+
const speedValue = document.getElementById('speed-value');
|
| 246 |
+
|
| 247 |
+
// Toggle between 2D and 3D views
|
| 248 |
+
viewToggle.addEventListener('click', () => {
|
| 249 |
+
if (map3d.style.visibility === 'visible') {
|
| 250 |
+
map3d.style.visibility = 'hidden';
|
| 251 |
+
document.getElementById('map-2d').style.zIndex = '1';
|
| 252 |
+
viewToggle.innerHTML = '<i class="fas fa-cube text-white"></i>';
|
| 253 |
+
} else {
|
| 254 |
+
map3d.style.visibility = 'visible';
|
| 255 |
+
document.getElementById('map-2d').style.zIndex = '0';
|
| 256 |
+
viewToggle.innerHTML = '<i class="fas fa-map text-white"></i>';
|
| 257 |
+
}
|
| 258 |
+
});
|
| 259 |
+
|
| 260 |
+
// Search input handling
|
| 261 |
+
searchInput.addEventListener('input', () => {
|
| 262 |
+
const query = searchInput.value.toLowerCase();
|
| 263 |
+
if (query.length > 2) {
|
| 264 |
+
const matches = italianLocations.filter(loc => loc.toLowerCase().includes(query));
|
| 265 |
+
if (matches.length > 0) {
|
| 266 |
+
searchSuggestions.innerHTML = '';
|
| 267 |
+
matches.forEach(match => {
|
| 268 |
+
const div = document.createElement('div');
|
| 269 |
+
div.className = 'search-suggestion';
|
| 270 |
+
div.textContent = match;
|
| 271 |
+
div.addEventListener('click', () => {
|
| 272 |
+
searchInput.value = match;
|
| 273 |
+
searchSuggestions.classList.add('hidden');
|
| 274 |
+
// Simulate setting destination
|
| 275 |
+
setDestination(match);
|
| 276 |
+
});
|
| 277 |
+
searchSuggestions.appendChild(div);
|
| 278 |
+
});
|
| 279 |
+
searchSuggestions.classList.remove('hidden');
|
| 280 |
+
} else {
|
| 281 |
+
searchSuggestions.classList.add('hidden');
|
| 282 |
+
}
|
| 283 |
+
} else {
|
| 284 |
+
searchSuggestions.classList.add('hidden');
|
| 285 |
+
}
|
| 286 |
+
});
|
| 287 |
+
|
| 288 |
+
// Close suggestions when clicking outside
|
| 289 |
+
document.addEventListener('click', (e) => {
|
| 290 |
+
if (!e.target.closest('.search-suggestion') && e.target !== searchInput) {
|
| 291 |
+
searchSuggestions.classList.add('hidden');
|
| 292 |
+
}
|
| 293 |
+
});
|
| 294 |
+
|
| 295 |
+
// Set destination and show route
|
| 296 |
+
function setDestination(destination) {
|
| 297 |
+
// Animate up the bottom panel
|
| 298 |
+
bottomPanel.classList.remove('translate-y-full');
|
| 299 |
+
|
| 300 |
+
// Simulate current position
|
| 301 |
+
currentLocation.textContent = "Roma, Via Nazionale";
|
| 302 |
+
|
| 303 |
+
// Show start navigation button and simulate route
|
| 304 |
+
startNavigationBtn.classList.remove('hidden');
|
| 305 |
+
|
| 306 |
+
// Simulate some route steps
|
| 307 |
+
const steps = [
|
| 308 |
+
"Parti da Via Nazionale verso ovest",
|
| 309 |
+
"Svolta a sinistra su Via Cavour",
|
| 310 |
+
"Continua su Via Nazionale per 500m",
|
| 311 |
+
"Svolta a destra su Via XX Settembre",
|
| 312 |
+
"Continua dritto per 1.2 km",
|
| 313 |
+
"Destinazione raggiunta"
|
| 314 |
+
];
|
| 315 |
+
|
| 316 |
+
routeSteps.innerHTML = '';
|
| 317 |
+
steps.forEach(step => {
|
| 318 |
+
const stepDiv = document.createElement('div');
|
| 319 |
+
stepDiv.className = 'route-step';
|
| 320 |
+
stepDiv.textContent = step;
|
| 321 |
+
routeSteps.appendChild(stepDiv);
|
| 322 |
+
});
|
| 323 |
+
|
| 324 |
+
routeInstructions.classList.remove('hidden');
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
// Start navigation simulation
|
| 328 |
+
startNavigationBtn.addEventListener('click', () => {
|
| 329 |
+
routeInstructions.classList.add('hidden');
|
| 330 |
+
startNavigationBtn.classList.add('hidden');
|
| 331 |
+
|
| 332 |
+
// Show voice bubble and speed
|
| 333 |
+
voiceBubble.classList.remove('hidden');
|
| 334 |
+
compassSpeed.classList.remove('hidden');
|
| 335 |
+
|
| 336 |
+
// Simulate voice guidance
|
| 337 |
+
const voiceMessages = [
|
| 338 |
+
"Preparati a girare a sinistra su Via Cavour",
|
| 339 |
+
"Continua dritto per 500 metri",
|
| 340 |
+
"Tra 300 metri, svolta a destra",
|
| 341 |
+
"Destinazione sulla destra",
|
| 342 |
+
"Hai raggiunto la destinazione"
|
| 343 |
+
];
|
| 344 |
+
|
| 345 |
+
let messageIndex = 0;
|
| 346 |
+
const voiceInterval = setInterval(() => {
|
| 347 |
+
if (messageIndex < voiceMessages.length) {
|
| 348 |
+
voiceText.textContent = voiceMessages[messageIndex];
|
| 349 |
+
messageIndex++;
|
| 350 |
+
} else {
|
| 351 |
+
clearInterval(voiceInterval);
|
| 352 |
+
setTimeout(() => {
|
| 353 |
+
alert("Hai raggiunto la destinazione!");
|
| 354 |
+
// Reset
|
| 355 |
+
voiceBubble.classList.add('hidden');
|
| 356 |
+
compassSpeed.classList.add('hidden');
|
| 357 |
+
bottomPanel.classList.add('translate-y-full');
|
| 358 |
+
searchInput.value = '';
|
| 359 |
+
}, 2000);
|
| 360 |
+
}
|
| 361 |
+
}, 8000);
|
| 362 |
+
|
| 363 |
+
// Simulate speed changes
|
| 364 |
+
let currentSpeed = 0;
|
| 365 |
+
const speedInterval = setInterval(() => {
|
| 366 |
+
if (messageIndex < 4) {
|
| 367 |
+
currentSpeed = Math.floor(Math.random() * 60) + 30; // 30-90 km/h
|
| 368 |
+
} else {
|
| 369 |
+
currentSpeed = Math.max(0, currentSpeed - 10);
|
| 370 |
+
}
|
| 371 |
+
speedValue.textContent = currentSpeed;
|
| 372 |
+
}, 1000);
|
| 373 |
+
|
| 374 |
+
// Stop speed simulation when done
|
| 375 |
+
setTimeout(() => {
|
| 376 |
+
clearInterval(speedInterval);
|
| 377 |
+
}, 30000);
|
| 378 |
+
});
|
| 379 |
+
|
| 380 |
+
// Simulate location updates
|
| 381 |
+
let userMarker;
|
| 382 |
+
let userPosition = [41.9028, 12.4964]; // Start in Rome
|
| 383 |
+
|
| 384 |
+
function updateLocation() {
|
| 385 |
+
// Simulate small movements
|
| 386 |
+
userPosition[0] += (Math.random() - 0.5) * 0.001;
|
| 387 |
+
userPosition[1] += (Math.random() - 0.5) * 0.001;
|
| 388 |
+
|
| 389 |
+
if (userMarker) {
|
| 390 |
+
userMarker.setLatLng(userPosition);
|
| 391 |
+
} else {
|
| 392 |
+
userMarker = L.marker(userPosition, {
|
| 393 |
+
icon: L.divIcon({
|
| 394 |
+
className: 'user-location',
|
| 395 |
+
html: '<div style="background-color: #4285F4; width: 12px; height: 12px; border-radius: 50%; border: 2px solid white; box-shadow: 0 0 5px rgba(0,0,0,0.5);"></div>',
|
| 396 |
+
iconSize: [16, 16],
|
| 397 |
+
iconAnchor: [8, 8]
|
| 398 |
+
})
|
| 399 |
+
}).addTo(map2d);
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
// Pan map to user if navigation is active
|
| 403 |
+
if (!startNavigationBtn.classList.contains('hidden') && !startNavigationBtn.classList.contains('hidden')) {
|
| 404 |
+
map2d.panTo(userPosition);
|
| 405 |
+
}
|
| 406 |
+
}
|
| 407 |
+
|
| 408 |
+
// Update location every 3 seconds
|
| 409 |
+
setInterval(updateLocation, 3000);
|
| 410 |
+
updateLocation(); // Initial location
|
| 411 |
+
|
| 412 |
+
// Try to get real user location
|
| 413 |
+
if (navigator.geolocation) {
|
| 414 |
+
navigator.geolocation.getCurrentPosition(position => {
|
| 415 |
+
userPosition = [position.coords.latitude, position.coords.longitude];
|
| 416 |
+
updateLocation();
|
| 417 |
+
currentLocation.textContent = `Lat: ${position.coords.latitude.toFixed(4)}, Lng: ${position.coords.longitude.toFixed(4)}`;
|
| 418 |
+
}, error => {
|
| 419 |
+
console.log("Unable to get location: ", error);
|
| 420 |
+
}, { enableHighAccuracy: true });
|
| 421 |
+
}
|
| 422 |
+
|
| 423 |
+
// Double-tap to expand bottom panel
|
| 424 |
+
let lastTap = 0;
|
| 425 |
+
bottomPanel.addEventListener('touchend', (e) => {
|
| 426 |
+
const currentTime = new Date().getTime();
|
| 427 |
+
const tapLength = currentTime - lastTap;
|
| 428 |
+
if (tapLength < 300 && tapLength > 0) {
|
| 429 |
+
// Double tap detected
|
| 430 |
+
if (bottomPanel.classList.contains('translate-y-full')) {
|
| 431 |
+
bottomPanel.classList.remove('translate-y-full');
|
| 432 |
+
} else {
|
| 433 |
+
bottomPanel.classList.add('translate-y-full');
|
| 434 |
+
}
|
| 435 |
+
}
|
| 436 |
+
lastTap = currentTime;
|
| 437 |
+
});
|
| 438 |
+
|
| 439 |
+
// Initial voice guidance
|
| 440 |
+
setTimeout(() => {
|
| 441 |
+
if (voiceBubble.classList.contains('hidden')) {
|
| 442 |
+
voiceBubble.classList.remove('hidden');
|
| 443 |
+
voiceText.textContent = "Benvenuto nel navigatore Italia";
|
| 444 |
+
}
|
| 445 |
+
}, 2000);
|
| 446 |
+
</script>
|
| 447 |
+
<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-qwensite.hf.space/logo.svg" alt="qwensite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-qwensite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >QwenSite</a> - 🧬 <a href="https://enzostvs-qwensite.hf.space?remix=condorhacker/condor" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 448 |
+
</html>
|
prompts.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
riesci a crearmi una app android tipo un navigatore satellitare con mappe italia e in versione 2D 3D
|