Amélioration de la précision de weatherRequest
This commit is contained in:
		| @@ -11,7 +11,7 @@ function weatherRequest() { | ||||
|                     let city = json.name; | ||||
|                     let showDateTimeValue = timeZone(json); | ||||
|                  | ||||
|                     $('.results').html(`🌎 Position : <a href='https://www.google.com/maps/place/${city}/' class="yellow-color" target="_blank">${city}, ${json.sys.country}</a><br>⏰ Date et heure : ${showDateTimeValue}<br>☁️ Météo : ${capitalize(json.weather[0].description)}<br> 🌡️ Température : ${json.main.temp} °C<br> 💧 Humidité : ${json.main.humidity}% <br> <img src="https://openweathermap.org/img/wn/${json.weather[0].icon}@2x.png"/>`);  | ||||
|                     $('.results').html(`🌎 Position : <a href='https://www.google.com/maps/search/?api=1&query=${json.coord.lat},${json.coord.lon}' class="yellow-color" target="_blank">${city}, ${json.sys.country}</a><br>⏰ Date et heure : ${showDateTimeValue}<br>☁️ Météo : ${capitalize(json.weather[0].description)}<br> 🌡️ Température : ${json.main.temp} °C<br> 💧 Humidité : ${json.main.humidity}% <br> <img src="https://openweathermap.org/img/wn/${json.weather[0].icon}@2x.png"/>`);  | ||||
|                 } | ||||
|                 catch(error) { | ||||
|                     $('.results').html("La ville que vous avez rentré n'existe pas (dans l'API)."); | ||||
|   | ||||
| @@ -7,13 +7,16 @@ | ||||
| <!-- Page Content --> | ||||
| <div class="container"> | ||||
|   <h1><span class="important"><?php echo $title?></span> :</h1> | ||||
|   <p class="pt-3 text-center"><?php echo $description?></p> | ||||
|   <p class="pt-3 text-center"><?php echo $description?> <br>  | ||||
|   Pour une meilleure précision, je recommande de préciser le pays de la ville. <br> | ||||
|   Exemple : Paris, FR | ||||
|   </p> | ||||
|   <div class="text-center"> | ||||
|     <img class="function-image" src="/img/function-image/weatherRequest.png" alt="Météo"> | ||||
|   </div> | ||||
|   <div class="form-group"> | ||||
| 		<label for="cityName">Entrez le nom d'une ville :</label> | ||||
|         <input name="cityName" type="text" id="cityName" placeholder="(e.g : Paris)" class="form-control"> | ||||
|         <input name="cityName" type="text" id="cityName" placeholder="(e.g : Paris, FR)" class="form-control"> | ||||
|         <br> | ||||
|         <div class="form-row text-center"> | ||||
|             <div class="col-12"> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user