From d6f6eca9c376078dcbe2fa7b9c51233021a7da60 Mon Sep 17 00:00:00 2001 From: iontalp Date: Wed, 29 Jul 2026 04:48:40 +0200 Subject: [PATCH] =?UTF-8?q?saat=20eklendi=20ve=20widget=20tasar=C4=B1?= =?UTF-8?q?=C4=B1=20d=C3=BCzeltildi.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/desktop.js | 76 +++++++++++++++++++++++++++----------------- 1 file changed, 46 insertions(+), 30 deletions(-) diff --git a/src/pages/desktop.js b/src/pages/desktop.js index d7f43a1..1086c8c 100755 --- a/src/pages/desktop.js +++ b/src/pages/desktop.js @@ -17,19 +17,20 @@ export function renderDesktop(selectedCity = "Edremit", pb) { }); const html = ` -
- -
- - -
-

- 🖥️ Masaüstü Araçları -

- ${selectedCity} + +
+ +
+ +
+

CANLI SAAT

+
+ 00:00:00 +
+

${dateStr}

- +
@@ -43,50 +44,51 @@ export function renderDesktop(selectedCity = "Edremit", pb) {

Yükleniyor...

- +
+ +
📅 HİCRİ TAKVİM

${hijri.day} ${hijri.monthName} ${hijri.year}

-

${dateStr} / ${hijri.weekday}

+

${hijri.weekday}


- +
Hava durumu yükleniyor...

- +
Namaz vakitleri yükleniyor...
- -
- - -
-
- 📿 -
-

Kaza Namazı Takibi

-

Detaylı sayaç & takip

-
-
- -
-
+ + +
+
+ 📿 +
+

Kaza Namazı Takibi

+

Detaylı sayaç & takip

+
+
+ +
+
`; return { html, initEvents: (container) => { + startClock(container); loadWeather(container, selectedCity); loadImsakiye(container, selectedCity); if (pb) loadDesktopKazaProgress(container, pb); @@ -100,6 +102,20 @@ export function renderDesktop(selectedCity = "Edremit", pb) { }; } +// Canlı Saat Mantığı (Saniyede Bir Güncellenir) +function startClock(container) { + const clockEl = container.querySelector("#liveClock"); + if (!clockEl) return; + + const update = () => { + const now = new Date(); + clockEl.textContent = now.toLocaleTimeString("tr-TR"); + }; + + update(); + setInterval(update, 1000); +} + async function loadDesktopKazaProgress(container, pb) { const user = pb.authStore.model; if (!user) return;