feat: add real-time weather animations (rain, snow, fog, storm, clouds)
This commit is contained in:
@@ -255,6 +255,12 @@ function renderPanel(data) {
|
||||
// Trigger reflow for animation
|
||||
requestAnimationFrame(() => panel.classList.add("visible"));
|
||||
|
||||
// Start weather animation
|
||||
if (typeof WeatherAnim !== "undefined") {
|
||||
// Small delay for canvas to be in DOM
|
||||
setTimeout(() => WeatherAnim.start(data), 100);
|
||||
}
|
||||
|
||||
// Header
|
||||
document.getElementById("panelCityName").textContent =
|
||||
`${data.risk?.emoji || "🏙️"} ${data.display_name}`;
|
||||
@@ -710,6 +716,8 @@ function closePanel() {
|
||||
document
|
||||
.querySelectorAll(".city-item")
|
||||
.forEach((el) => el.classList.remove("active"));
|
||||
// Stop weather animation
|
||||
if (typeof WeatherAnim !== "undefined") WeatherAnim.stop();
|
||||
}
|
||||
|
||||
// ──────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user