Skip to content

Commit

Permalink
28.11.2023 | Update Design Lernapp
Browse files Browse the repository at this point in the history
  • Loading branch information
ubodigat committed Nov 28, 2023
1 parent 3462966 commit 1a8093c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lerntools/zehnfingersystem/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ body {
font-weight: 700;
color: #fff;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.658);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.733);
text-align: center;
max-width: 80%;
border-radius: 10px;
Expand Down
7 changes: 1 addition & 6 deletions menü.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,18 @@ <h4 id="weather-info">Wetterbericht-München</h4>
</table>
</div>
<script>
// Stelle eine Verbindung zur OpenWeather API her
const apiKey = '516ad7cf647d0ef14dc8563616e85ec4';
const weatherUrl = `https://api.openweathermap.org/data/2.5/weather?q=Munich&units=metric&lang=de&appid=${apiKey}`;

// Runde eine Zahl auf die gewünschte Anzahl von Dezimalstellen
function roundNumber(number, decimals) {
return Math.round(number * 10 ** decimals) / 10 ** decimals;
}

// Hole das Wetter von der API und aktualisiere die Anzeige
function fetchWeather() {
fetch(weatherUrl)
.then(response => response.json())
.then(data => {
const temperature = roundNumber(data.main.temp, 0); // Auf 0 Dezimalstellen runden
const temperature = roundNumber(data.main.temp, 0);
const description = data.weather[0].description;
const icon = data.weather[0].icon;

Expand All @@ -146,10 +143,8 @@ <h4 id="weather-info">Wetterbericht-München</h4>
});
}

// Aktualisiere das Wetter alle 5 Minuten
setInterval(fetchWeather, 300000);

// Rufe das Wetter beim Laden der Seite auf
fetchWeather();
</script>

Expand Down

0 comments on commit 1a8093c

Please sign in to comment.