Download index.html from javier070/easyapps: direct link, hf CLI and curl.
- Browser
- Download file 27.7 kB
-
https://huggingface.co/spaces/javier070/easyapps/resolve/main/index.html
- Command line
-
hf download hf://spaces/javier070/easyapps/index.html
-
curl -L -o index.html https://huggingface.co/spaces/javier070/easyapps/resolve/main/index.html
27.7 kB
| <html lang="fr"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>USTHB Navigator</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet"> | |
| <script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script> | |
| <script src="https://unpkg.com/feather-icons"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> | |
| <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" /> | |
| <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script> | |
| <style> | |
| #map { height: 400px; } | |
| .building-card:hover { | |
| transform: translateY(-5px); | |
| box-shadow: 0 10px 20px rgba(0,0,0,0.1); | |
| } | |
| .pulse { | |
| animation: pulse 2s infinite; | |
| } | |
| @keyframes pulse { | |
| 0% { transform: scale(0.95); } | |
| 50% { transform: scale(1.05); } | |
| 100% { transform: scale(0.95); } | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50"> | |
| <!-- Navigation --> | |
| <nav class="bg-blue-800 text-white shadow-lg"> | |
| <div class="container mx-auto px-4 py-3 flex justify-between items-center"> | |
| <div class="flex items-center space-x-2"> | |
| <i data-feather="map" class="w-8 h-8"></i> | |
| <span class="text-xl font-bold">USTHB Navigator</span> | |
| </div> | |
| <div class="hidden md:flex space-x-6"> | |
| <a href="#" class="hover:text-blue-200" data-i18n="home">Accueil</a> | |
| <a href="#map" class="hover:text-blue-200" data-i18n="map">Carte</a> | |
| <a href="#buildings" class="hover:text-blue-200" data-i18n="buildings">Bâtiments</a> | |
| <a href="#about" class="hover:text-blue-200" data-i18n="about">À propos</a> | |
| </div> | |
| <div class="flex items-center space-x-4"> | |
| <select id="language-selector" class="bg-blue-700 text-white px-2 py-1 rounded"> | |
| <option value="fr">FR</option> | |
| <option value="en">EN</option> | |
| <option value="ar">AR</option> | |
| </select> | |
| <button class="md:hidden" id="menu-toggle"> | |
| <i data-feather="menu" class="w-6 h-6"></i> | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Mobile menu --> | |
| <div class="md:hidden hidden py-2 px-4 bg-blue-900" id="mobile-menu"> | |
| <a href="#" class="block py-2 hover:text-blue-200" data-i18n="home">Accueil</a> | |
| <a href="#map" class="block py-2 hover:text-blue-200" data-i18n="map">Carte</a> | |
| <a href="#buildings" class="block py-2 hover:text-blue-200" data-i18n="buildings">Bâtiments</a> | |
| <a href="#about" class="block py-2 hover:text-blue-200" data-i18n="about">À propos</a> | |
| </div> | |
| </nav> | |
| <!-- Hero Section --> | |
| <section class="bg-gradient-to-r from-blue-700 to-blue-900 text-white py-16"> | |
| <div class="container mx-auto px-4 text-center" data-aos="fade-up"> | |
| <h1 class="text-4xl md:text-5xl font-bold mb-4" data-i18n="welcome">Bienvenue à l'USTHB</h1> | |
| <p class="text-xl md:text-2xl mb-8" data-i18n="find-buildings">Trouvez facilement tous les bâtiments et services de l'université</p> | |
| <button id="locate-me" class="bg-white text-blue-800 font-bold py-3 px-6 rounded-full hover:bg-blue-100 transition flex items-center mx-auto pulse"> | |
| <i data-feather="navigation" class="mr-2"></i> <span data-i18n="locate-me">Me localiser</span> | |
| </button> | |
| </div> | |
| </section> | |
| <!-- Map Section --> | |
| <section id="map" class="py-12 bg-white"> | |
| <div class="container mx-auto px-4"> | |
| <h2 class="text-3xl font-bold text-center mb-8 text-gray-800" data-i18n="campus-map">Carte du campus</h2> | |
| <div class="rounded-xl overflow-hidden shadow-xl" id="map-container"> | |
| <div id="map"></div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Buildings Section --> | |
| <section id="buildings" class="py-12 bg-gray-100"> | |
| <div class="container mx-auto px-4"> | |
| <h2 class="text-3xl font-bold text-center mb-8 text-gray-800" data-i18n="main-buildings">Bâtiments principaux</h2> | |
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"> | |
| <!-- Building Card 1 --> | |
| <div class="bg-white rounded-xl shadow-md overflow-hidden building-card transition duration-300" data-aos="fade-up"> | |
| <img src="http://static.photos/education/640x360/1" alt="Bâtiment des Facultés" class="w-full h-48 object-cover"> | |
| <div class="p-6"> | |
| <h3 class="text-xl font-bold mb-2 text-blue-800" data-i18n="faculty-building">Bâtiment des Facultés</h3> | |
| <p class="text-gray-600 mb-4" data-i18n="faculty-building-desc">Facultés des Mathématiques, Physique, Chimie, Biologie et Géologie</p> | |
| <div class="flex items-center text-gray-500 mb-2"> | |
| <i data-feather="map-pin" class="w-4 h-4 mr-2"></i> | |
| <span data-i18n="faculty-building-location">Zone Nord, près de l'entrée principale</span> | |
| </div> | |
| <button class="text-blue-600 hover:text-blue-800 font-medium flex items-center"> | |
| <i data-feather="arrow-right" class="w-4 h-4 mr-1"></i> <span data-i18n="view-on-map">Voir sur la carte</span> | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Building Card 2 --> | |
| <div class="bg-white rounded-xl shadow-md overflow-hidden building-card transition duration-300" data-aos="fade-up" data-aos-delay="100"> | |
| <img src="http://static.photos/education/640x360/2" alt="Bâtiment Informatique" class="w-full h-48 object-cover"> | |
| <div class="p-6"> | |
| <h3 class="text-xl font-bold mb-2 text-blue-800" data-i18n="informatics-building">Bâtiment Informatique</h3> | |
| <p class="text-gray-600 mb-4" data-i18n="informatics-building-desc">Faculté d'Informatique et Institut des Sciences Biologiques Appliquées</p> | |
| <div class="flex items-center text-gray-500 mb-2"> | |
| <i data-feather="map-pin" class="w-4 h-4 mr-2"></i> | |
| <span data-i18n="informatics-building-location">Zone Centrale, à côté de la bibliothèque</span> | |
| </div> | |
| <button class="text-blue-600 hover:text-blue-800 font-medium flex items-center"> | |
| <i data-feather="arrow-right" class="w-4 h-4 mr-1"></i> <span data-i18n="view-on-map">Voir sur la carte</span> | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Building Card 3 --> | |
| <div class="bg-white rounded-xl shadow-md overflow-hidden building-card transition duration-300" data-aos="fade-up" data-aos-delay="200"> | |
| <img src="http://static.photos/education/640x360/3" alt="Bâtiment Administration" class="w-full h-48 object-cover"> | |
| <div class="p-6"> | |
| <h3 class="text-xl font-bold mb-2 text-blue-800" data-i18n="administration-building">Bâtiment Administration</h3> | |
| <p class="text-gray-600 mb-4" data-i18n="administration-building-desc">Services administratifs et direction générale</p> | |
| <div class="flex items-center text-gray-500 mb-2"> | |
| <i data-feather="map-pin" class="w-4 h-4 mr-2"></i> | |
| <span data-i18n="administration-building-location">Zone Centrale, près de la bibliothèque</span> | |
| </div> | |
| <button class="text-blue-600 hover:text-blue-800 font-medium flex items-center"> | |
| <i data-feather="arrow-right" class="w-4 h-4 mr-1"></i> <span data-i18n="view-on-map">Voir sur la carte</span> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Services Section --> | |
| <section class="py-12 bg-white"> | |
| <div class="container mx-auto px-4"> | |
| <h2 class="text-3xl font-bold text-center mb-8 text-gray-800">Services universitaires</h2> | |
| <div class="grid grid-cols-1 md:grid-cols-3 gap-8"> | |
| <div class="text-center p-6 rounded-lg bg-gray-50" data-aos="zoom-in"> | |
| <div class="bg-blue-100 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4"> | |
| <i data-feather="book" class="w-8 h-8 text-blue-800"></i> | |
| </div> | |
| <h3 class="text-xl font-bold mb-2 text-blue-800">Inscription</h3> | |
| <p class="text-gray-600">Procédures et documents nécessaires pour l'inscription administrative</p> | |
| </div> | |
| <div class="text-center p-6 rounded-lg bg-gray-50" data-aos="zoom-in" data-aos-delay="100"> | |
| <div class="bg-blue-100 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4"> | |
| <i data-feather="credit-card" class="w-8 h-8 text-blue-800"></i> | |
| </div> | |
| <h3 class="text-xl font-bold mb-2 text-blue-800">Cantine</h3> | |
| <p class="text-gray-600">Horaires, menus et localisation des restaurants universitaires</p> | |
| </div> | |
| <div class="text-center p-6 rounded-lg bg-gray-50" data-aos="zoom-in" data-aos-delay="200"> | |
| <div class="bg-blue-100 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4"> | |
| <i data-feather="shield" class="w-8 h-8 text-blue-800"></i> | |
| </div> | |
| <h3 class="text-xl font-bold mb-2 text-blue-800">Sécurité</h3> | |
| <p class="text-gray-600">Points de sécurité et numéros d'urgence sur le campus</p> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- About Section --> | |
| <section id="about" class="py-12 bg-gray-100"> | |
| <div class="container mx-auto px-4"> | |
| <div class="flex flex-col md:flex-row items-center"> | |
| <div class="md:w-1/2 mb-8 md:mb-0 md:pr-8" data-aos="fade-right"> | |
| <h2 class="text-3xl font-bold mb-4 text-gray-800" data-i18n="about-usthb">À propos de l'USTHB</h2> | |
| <p class="text-gray-600 mb-4" data-i18n="usthb-desc1"> | |
| L'Université des Sciences et de la Technologie Houari Boumediene (USTHB) est une institution d'enseignement supérieur et de recherche scientifique située à Alger. | |
| </p> | |
| <p class="text-gray-600 mb-4" data-i18n="usthb-desc2"> | |
| Fondée en 1974, elle compte aujourd'hui plusieurs facultés et instituts couvrant divers domaines scientifiques et technologiques. | |
| </p> | |
| <div class="flex space-x-4"> | |
| <a href="#" class="text-blue-600 hover:text-blue-800"> | |
| <i data-feather="globe" class="w-5 h-5"></i> | |
| </a> | |
| <a href="#" class="text-blue-600 hover:text-blue-800"> | |
| <i data-feather="facebook" class="w-5 h-5"></i> | |
| </a> | |
| <a href="#" class="text-blue-600 hover:text-blue-800"> | |
| <i data-feather="twitter" class="w-5 h-5"></i> | |
| </a> | |
| </div> | |
| </div> | |
| <div class="md:w-1/2" data-aos="fade-left"> | |
| <img src="http://static.photos/education/640x360/4" alt="USTHB" class="rounded-lg shadow-xl w-full"> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Footer --> | |
| <footer class="bg-gray-900 text-white py-8"> | |
| <div class="container mx-auto px-4"> | |
| <div class="flex flex-col md:flex-row justify-between items-center"> | |
| <div class="mb-4 md:mb-0"> | |
| <div class="flex items-center space-x-2"> | |
| <i data-feather="map" class="w-6 h-6 text-blue-400"></i> | |
| <span class="text-xl font-bold">USTHB Navigator</span> | |
| </div> | |
| <p class="text-gray-400 mt-2" data-i18n="app-description">Application d'orientation pour les nouveaux étudiants</p> | |
| </div> | |
| <div class="flex space-x-6"> | |
| <a href="#" class="text-gray-400 hover:text-white"> | |
| <i data-feather="mail" class="w-5 h-5"></i> | |
| </a> | |
| <a href="#" class="text-gray-400 hover:text-white"> | |
| <i data-feather="github" class="w-5 h-5"></i> | |
| </a> | |
| <a href="#" class="text-gray-400 hover:text-white"> | |
| <i data-feather="linkedin" class="w-5 h-5"></i> | |
| </a> | |
| </div> | |
| </div> | |
| <div class="border-t border-gray-800 mt-6 pt-6 text-center text-gray-400"> | |
| <p>© 2023 USTHB Navigator. <span data-i18n="all-rights">Tous droits réservés.</span></p> | |
| </div> | |
| </div> | |
| </footer> | |
| <script> | |
| // Initialize AOS | |
| AOS.init({ | |
| duration: 800, | |
| easing: 'ease-in-out', | |
| once: true | |
| }); | |
| // Initialize Feather Icons | |
| feather.replace(); | |
| // Mobile menu toggle | |
| document.getElementById('menu-toggle').addEventListener('click', function() { | |
| const menu = document.getElementById('mobile-menu'); | |
| menu.classList.toggle('hidden'); | |
| }); | |
| // Language translations | |
| const translations = { | |
| fr: { | |
| "home": "Accueil", | |
| "map": "Carte", | |
| "buildings": "Bâtiments", | |
| "about": "À propos", | |
| "welcome": "Bienvenue à l'USTHB", | |
| "find-buildings": "Trouvez facilement tous les bâtiments et services de l'université", | |
| "locate-me": "Me localiser", | |
| "campus-map": "Carte du campus", | |
| "main-buildings": "Bâtiments principaux", | |
| "faculty-building": "Bâtiment des Facultés", | |
| "faculty-building-desc": "Facultés des Mathématiques, Physique, Chimie, Biologie et Géologie", | |
| "faculty-building-location": "Zone Nord, près de l'entrée principale", | |
| "informatics-building": "Bâtiment Informatique", | |
| "informatics-building-desc": "Faculté d'Informatique et Institut des Sciences Biologiques Appliquées", | |
| "informatics-building-location": "Zone Centrale, à côté de la bibliothèque", | |
| "administration-building": "Bâtiment Administration", | |
| "administration-building-desc": "Services administratifs et direction générale", | |
| "administration-building-location": "Zone Centrale, près de la bibliothèque", | |
| "view-on-map": "Voir sur la carte", | |
| "university-services": "Services universitaires", | |
| "registration": "Inscription", | |
| "registration-desc": "Procédures et documents nécessaires pour l'inscription administrative", | |
| "canteen": "Cantine", | |
| "canteen-desc": "Horaires, menus et localisation des restaurants universitaires", | |
| "security": "Sécurité", | |
| "security-desc": "Points de sécurité et numéros d'urgence sur le campus", | |
| "about-usthb": "À propos de l'USTHB", | |
| "usthb-desc1": "L'Université des Sciences et de la Technologie Houari Boumediene (USTHB) est une institution d'enseignement supérieur et de recherche scientifique située à Alger.", | |
| "usthb-desc2": "Fondée en 1974, elle compte aujourd'hui plusieurs facultés et instituts couvrant divers domaines scientifiques et technologiques.", | |
| "app-description": "Application d'orientation pour les nouveaux étudiants", | |
| "all-rights": "Tous droits réservés." | |
| }, | |
| en: { | |
| "home": "Home", | |
| "map": "Map", | |
| "buildings": "Buildings", | |
| "about": "About", | |
| "welcome": "Welcome to USTHB", | |
| "find-buildings": "Easily find all university buildings and services", | |
| "locate-me": "Locate Me", | |
| "campus-map": "Campus Map", | |
| "main-buildings": "Main Buildings", | |
| "faculty-building": "Faculty Building", | |
| "faculty-building-desc": "Faculties of Mathematics, Physics, Chemistry, Biology and Geology", | |
| "faculty-building-location": "North Zone, near the main entrance", | |
| "informatics-building": "Informatics Building", | |
| "informatics-building-desc": "Faculty of Computer Science and Institute of Applied Biological Sciences", | |
| "informatics-building-location": "Central Zone, next to the library", | |
| "administration-building": "Administration Building", | |
| "administration-building-desc": "Administrative services and general management", | |
| "administration-building-location": "Central Zone, near the library", | |
| "view-on-map": "View on map", | |
| "university-services": "University Services", | |
| "registration": "Registration", | |
| "registration-desc": "Procedures and documents required for administrative registration", | |
| "canteen": "Canteen", | |
| "canteen-desc": "Hours, menus and location of university restaurants", | |
| "security": "Security", | |
| "security-desc": "Security points and emergency numbers on campus", | |
| "about-usthb": "About USTHB", | |
| "usthb-desc1": "The University of Sciences and Technology Houari Boumediene (USTHB) is a higher education and scientific research institution located in Algiers.", | |
| "usthb-desc2": "Founded in 1974, it now has several faculties and institutes covering various scientific and technological fields.", | |
| "app-description": "Orientation app for new students", | |
| "all-rights": "All rights reserved." | |
| }, | |
| ar: { | |
| "home": "الرئيسية", | |
| "map": "الخريطة", | |
| "buildings": "المباني", | |
| "about": "عن الجامعة", | |
| "welcome": "مرحبا بكم في جامعة العلوم والتكنولوجيا هواري بومدين", | |
| "find-buildings": "ابحثوا بسهولة عن جميع مباني وخدمات الجامعة", | |
| "locate-me": "تحديد موقعي", | |
| "campus-map": "خريطة الحرم الجامعي", | |
| "main-buildings": "المباني الرئيسية", | |
| "faculty-building": "مبنى الكليات", | |
| "faculty-building-desc": "كليات الرياضيات والفيزياء والكيمياء والأحياء وعلم الأرض", | |
| "faculty-building-location": "المنطقة الشمالية، بالقرب من المدخل الرئيسي", | |
| "informatics-building": "مبنى المعلوماتية", | |
| "informatics-building-desc": "كلية المعلوماتية ومعهد العلوم البيولوجية التطبيقية", | |
| "informatics-building-location": "المنطقة المركزية، بجانب المكتبة", | |
| "administration-building": "مبنى الإدارة", | |
| "administration-building-desc": "الخدمات الإدارية والإدارة العامة", | |
| "administration-building-location": "المنطقة المركزية، بالقرب من المكتبة", | |
| "view-on-map": "عرض على الخريطة", | |
| "university-services": "خدمات الجامعة", | |
| "registration": "التسجيل", | |
| "registration-desc": "الإجراءات والوثائق اللازمة للتسجيل الإداري", | |
| "canteen": "المقهى", | |
| "canteen-desc": "الساعات، القوائم وموقع مطاعم الجامعة", | |
| "security": "الأمن", | |
| "security-desc": "نقاط الأمن وأرقام الطوارئ في الحرم الجامعي", | |
| "about-usthb": "عن جامعة العلوم والتكنولوجيا هواري بومدين", | |
| "usthb-desc1": "جامعة العلوم والتكنولوجيا هواري بومدين هي مؤسسة للتعليم العالي والبحث العلمي تقع في الجزائر العاصمة.", | |
| "usthb-desc2": "تأسست عام 1974، وتضم اليوم عدة كليات ومعاهد تغطي مختلف المجالات العلمية والتكنولوجية.", | |
| "app-description": "تطبيق توجيه للطلاب الجدد", | |
| "all-rights": "جميع الحقوق محفوظة." | |
| } | |
| }; | |
| // Set language function | |
| function setLanguage(lang) { | |
| document.documentElement.lang = lang; | |
| const elements = document.querySelectorAll('[data-i18n]'); | |
| elements.forEach(element => { | |
| const key = element.getAttribute('data-i18n'); | |
| if (translations[lang] && translations[lang][key]) { | |
| if (element.tagName === 'INPUT' || element.tagName === 'TEXTAREA') { | |
| element.placeholder = translations[lang][key]; | |
| } else { | |
| element.textContent = translations[lang][key]; | |
| } | |
| } | |
| }); | |
| } | |
| // Language selector | |
| document.getElementById('language-selector').addEventListener('change', function() { | |
| setLanguage(this.value); | |
| }); | |
| // Initialize with French | |
| setLanguage('fr'); | |
| // Initialize map | |
| document.addEventListener('DOMContentLoaded', function() { | |
| const map = L.map('map').setView([36.7128, 3.1726], 15); // Approximate USTHB coordinates | |
| L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { | |
| attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' | |
| }).addTo(map); | |
| // Add some sample markers (would be replaced with real USTHB building coordinates) | |
| const buildings = [ | |
| { | |
| name: "Bâtiment des Facultés", | |
| description: "Facultés des Mathématiques, Physique, Chimie, Biologie et Géologie", | |
| coords: [36.7135, 3.1718] | |
| }, | |
| { | |
| name: "Bâtiment Informatique", | |
| description: "Faculté d'Informatique et Institut des Sciences Biologiques Appliquées", | |
| coords: [36.7122, 3.1722] | |
| }, | |
| { | |
| name: "Bâtiment Administration", | |
| description: "Services administratifs et direction générale", | |
| coords: [36.7128, 3.1726] | |
| } | |
| ]; | |
| buildings.forEach(building => { | |
| const marker = L.marker(building.coords).addTo(map) | |
| .bindPopup(`<b>${building.name}</b><br>${building.description}`); | |
| }); | |
| // Locate me button | |
| document.getElementById('locate-me').addEventListener('click', function() { | |
| if (navigator.geolocation) { | |
| navigator.geolocation.getCurrentPosition(function(position) { | |
| const userLocation = [position.coords.latitude, position.coords.longitude]; | |
| map.setView(userLocation, 18); | |
| // Add user marker | |
| L.marker(userLocation, { | |
| icon: L.divIcon({ | |
| className: 'pulse-icon', | |
| html: '<div style="background-color: #3b82f6; width: 20px; height: 20px; border-radius: 50%;"></div>', | |
| iconSize: [20, 20] | |
| }) | |
| }).addTo(map) | |
| .bindPopup("Votre position").openPopup(); | |
| // Add line to nearest building (example) | |
| const nearest = findNearestBuilding(userLocation, buildings); | |
| if (nearest) { | |
| const line = L.polyline([userLocation, nearest.coords], { | |
| color: '#3b82f6', | |
| weight: 3, | |
| dashArray: '5, 5' | |
| }).addTo(map); | |
| // Calculate distance | |
| const distance = calculateDistance(userLocation, nearest.coords); | |
| line.bindPopup(`Distance jusqu'à ${nearest.name}: ${distance.toFixed(2)} km`); | |
| } | |
| }, function(error) { | |
| alert("Impossible d'obtenir votre position : " + error.message); | |
| }); | |
| } else { | |
| alert("La géolocalisation n'est pas supportée par votre navigateur."); | |
| } | |
| }); | |
| // Find nearest building function | |
| function findNearestBuilding(userLocation, buildings) { | |
| let nearest = null; | |
| let minDistance = Infinity; | |
| buildings.forEach(building => { | |
| const distance = calculateDistance(userLocation, building.coords); | |
| if (distance < minDistance) { | |
| minDistance = distance; | |
| nearest = building; | |
| } | |
| }); | |
| return nearest; | |
| } | |
| // Calculate distance between two coordinates (Haversine formula) | |
| function calculateDistance(coord1, coord2) { | |
| const [lat1, lon1] = coord1; | |
| const [lat2, lon2] = coord2; | |
| const R = 6371; // Earth radius in km | |
| const dLat = (lat2 - lat1) * Math.PI / 180; | |
| const dLon = (lon2 - lon1) * Math.PI / 180; | |
| const a = | |
| Math.sin(dLat/2) * Math.sin(dLat/2) + | |
| Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) * | |
| Math.sin(dLon/2) * Math.sin(dLon/2); | |
| const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); | |
| return R * c; | |
| } | |
| }); | |
| </script> | |
| </body> | |
| </html> | |