Update index.html
parent
8c81188346
commit
7fe00b7086
46
index.html
46
index.html
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block title %}Баasdadasdзa{% endblock %}
|
{% block title %}Baza{% endblock %}
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
|
@ -8,6 +8,9 @@
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
@ -85,6 +88,47 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h1 class="oglavlenije">Текущее время в Латвии</h1>
|
||||||
|
<p id="datetime" class="datatime"></p>
|
||||||
|
|
||||||
|
|
||||||
|
<script >
|
||||||
|
function updateLatviaTime() {
|
||||||
|
const date = new Date();
|
||||||
|
const displayDate = date.toLocaleDateString();
|
||||||
|
const displayTime = date.toLocaleTimeString();
|
||||||
|
document.getElementById('datetime').innerHTML = `${displayDate} ${displayTime}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Обновление времени каждую секунду
|
||||||
|
setInterval(updateLatviaTime, 1000);
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h1 class="oglavlenije">Погода в Риге</h1>
|
||||||
|
<p id="weather" class="datatime"></p>
|
||||||
|
|
||||||
|
<script >
|
||||||
|
async function getWeather() {
|
||||||
|
try {
|
||||||
|
const response = await fetch("https://api.openweathermap.org/data/2.5/weather?id=456173&appid=e53814d3c7b076180e8d0273015b2804&units=metric");
|
||||||
|
const data = await response.json();
|
||||||
|
const weatherDescription = data.weather[0].description;
|
||||||
|
const temperature = data.main.temp;
|
||||||
|
const humidity = data.main.humidity;
|
||||||
|
|
||||||
|
document.getElementById("weather").textContent = `Сейчас в Риге ${weatherDescription}. Температура: ${temperature}°C, Влажность: ${humidity}%`;
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Ошибка при получении данных о погоде:", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getWeather();
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
|
||||||
<footer id ="avtor">
|
<footer id ="avtor">
|
||||||
<p style="font-size:larger">Михаэль Мееров 11.8 </p>
|
<p style="font-size:larger">Михаэль Мееров 11.8 </p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
Loading…
Reference in New Issue