From 55c589be4876c4c113c3d68c7caeb5e11c22b9d1 Mon Sep 17 00:00:00 2001
From: Zeti_1223 <121749710+zeti1223@users.noreply.github.com>
Date: Sun, 8 Feb 2026 12:11:32 +0100
Subject: [PATCH 1/4] update
---
public/index.html | 2018 ++++++++++++++++++++------------------
public/service-worker.js | 43 +-
2 files changed, 1107 insertions(+), 954 deletions(-)
diff --git a/public/index.html b/public/index.html
index 0b85eeb..dc7e7d0 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1,15 +1,18 @@
-
-
+
+
-
-
-
Csatlakozás Szobához
-
-
+
+
+
+
+
+
+
Join Room
+
+
-
+
-
+
-
-
-
Add meg a neved
-
-
-
+
+
+
Enter your name
+
+
+
-
-
-
-
-
-
+ });
+
+
diff --git a/public/service-worker.js b/public/service-worker.js
index 500fa7c..7925358 100644
--- a/public/service-worker.js
+++ b/public/service-worker.js
@@ -1,46 +1,48 @@
// Service Worker a PWA-hoz
-const CACHE_NAME = 'chat-pwa-v1';
+const CACHE_NAME = "chat-pwa-v1";
const urlsToCache = [
- '/chat.html',
- '/',
- 'https://www.gstatic.com/firebasejs/9.22.0/firebase-app-compat.js',
- 'https://www.gstatic.com/firebasejs/9.22.0/firebase-database-compat.js'
+ "/chat.html",
+ "/",
+ "https://www.gstatic.com/firebasejs/9.22.0/firebase-app-compat.js",
+ "https://www.gstatic.com/firebasejs/9.22.0/firebase-database-compat.js",
];
// Install esemény - cache-elés
-self.addEventListener('install', (event) => {
+self.addEventListener("install", (event) => {
event.waitUntil(
- caches.open(CACHE_NAME)
+ caches
+ .open(CACHE_NAME)
.then((cache) => {
- console.log('Cache megnyitva');
+ console.log("Cache opened");
return cache.addAll(urlsToCache);
})
.catch((err) => {
- console.log('Cache hiba:', err);
- })
+ console.log("Cache error:", err);
+ }),
);
});
// Activate esemény - régi cache-ek törlése
-self.addEventListener('activate', (event) => {
+self.addEventListener("activate", (event) => {
event.waitUntil(
caches.keys().then((cacheNames) => {
return Promise.all(
cacheNames.map((cacheName) => {
if (cacheName !== CACHE_NAME) {
- console.log('Régi cache törlése:', cacheName);
+ console.log("Deleting old cache:", cacheName);
return caches.delete(cacheName);
}
- })
+ }),
);
- })
+ }),
);
});
// Fetch esemény - cache-first stratégia
-self.addEventListener('fetch', (event) => {
+self.addEventListener("fetch", (event) => {
event.respondWith(
- caches.match(event.request)
+ caches
+ .match(event.request)
.then((response) => {
// Cache-ben van, visszaadja
if (response) {
@@ -49,7 +51,11 @@ self.addEventListener('fetch', (event) => {
// Nincs cache-ben, hálózatból tölti
return fetch(event.request).then((response) => {
// Csak érvényes válaszokat cache-elünk
- if (!response || response.status !== 200 || response.type !== 'basic') {
+ if (
+ !response ||
+ response.status !== 200 ||
+ response.type !== "basic"
+ ) {
return response;
}
// Klónozzuk a választ
@@ -63,7 +69,6 @@ self.addEventListener('fetch', (event) => {
.catch(() => {
// Hálózati hiba esetén offline oldalt adhatnánk vissza
// Jelenleg csak továbbítjuk a hibát
- })
+ }),
);
});
-
From 203f1a5f39c0a4a2010d51f8a9539a132e30fd14 Mon Sep 17 00:00:00 2001
From: Zeti_1223 <121749710+zeti1223@users.noreply.github.com>
Date: Sun, 8 Feb 2026 12:16:58 +0100
Subject: [PATCH 2/4] tailwindcss
---
public/index.html | 2038 ++++++++++++++++++---------------------------
1 file changed, 821 insertions(+), 1217 deletions(-)
diff --git a/public/index.html b/public/index.html
index dc7e7d0..a20fe95 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1,6 +1,7 @@
-
+
+
PIN Code Chat
@@ -9,10 +10,7 @@
-
+
@@ -28,1285 +26,891 @@
+
+
-
-
-
-
-
-
-
Join Room
-
-
-
-
+
+
+
+
+
+
+
Join Room
+
+
+
+
+
-
-
-
-
-
Enter your name
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
Enter your name
+
+
-
-
-
-
+
+
+
+
+
Chat Room
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
\ No newline at end of file
From d70e64f2cb0b85b5cde3aa97c67a23365954ded3 Mon Sep 17 00:00:00 2001
From: Zeti_1223 <121749710+zeti1223@users.noreply.github.com>
Date: Sun, 8 Feb 2026 12:25:05 +0100
Subject: [PATCH 3/4] phone
---
public/index.html | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/public/index.html b/public/index.html
index a20fe95..aa462a9 100644
--- a/public/index.html
+++ b/public/index.html
@@ -3,7 +3,7 @@
-
+
PIN Code Chat
@@ -74,13 +74,14 @@
+ class="bg-gray-100 dark:bg-gray-900 text-gray-900 dark:text-gray-100 font-sans h-[100dvh] flex items-center justify-center overflow-hidden transition-colors duration-300 touch-manipulation">
Join Room
-
@@ -106,7 +107,7 @@
Enter your name
+ class="chat-header flex justify-between items-center p-4 pt-[calc(1rem+env(safe-area-inset-top))] bg-white/95 dark:bg-gray-800/95 backdrop-blur-sm border-b border-gray-200 dark:border-gray-700 shadow-sm z-10">
Chat Room
+ class="flex-grow p-4 overflow-y-auto overscroll-contain bg-gray-50 dark:bg-gray-900 space-y-4 pb-[env(safe-area-inset-bottom,0)]">
Chat Room
@@ -729,7 +730,7 @@
Chat Room
}
const bubble = document.createElement("div");
- bubble.className = `max-w-[75%] px-4 py-2 rounded-2xl break-words shadow-sm ${isOwn ? "bg-teal-600 text-white rounded-br-none" : "bg-gray-200 dark:bg-gray-700 text-gray-900 dark:text-gray-100 rounded-bl-none"}`;
+ bubble.className = `max-w-[85%] md:max-w-[70%] px-4 py-2 rounded-2xl break-words shadow-sm ${isOwn ? "bg-teal-600 text-white rounded-br-none" : "bg-gray-200 dark:bg-gray-700 text-gray-900 dark:text-gray-100 rounded-bl-none"}`;
bubble.textContent = message.text;
const info = document.createElement("div");
From b927319850efc7f71a87dfce2f103786aed7654e Mon Sep 17 00:00:00 2001
From: Zeti_1223 <121749710+zeti1223@users.noreply.github.com>
Date: Sun, 8 Feb 2026 12:48:08 +0100
Subject: [PATCH 4/4] notification
---
public/index.html | 7 ++++---
public/service-worker.js | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/public/index.html b/public/index.html
index aa462a9..b283133 100644
--- a/public/index.html
+++ b/public/index.html
@@ -205,6 +205,7 @@
Chat Room
let typingTimeout = null;
let currentReply = null; // { username, text }
let notificationsEnabled = false;
+ const appStartTime = Date.now();
// --- Téma Kezelés ---
function applyTheme(theme) {
@@ -633,9 +634,9 @@
Chat Room
if (!message || message.username === currentUsername) return;
if (Notification.permission !== "granted") return;
- const isDesktopVisible =
- document.visibilityState === "visible" && !isMobileDevice();
- if (isDesktopVisible) {
+ if (message.timestamp && message.timestamp <= appStartTime) return;
+
+ if (document.visibilityState === "visible") {
return;
}
diff --git a/public/service-worker.js b/public/service-worker.js
index 7925358..db91903 100644
--- a/public/service-worker.js
+++ b/public/service-worker.js
@@ -1,7 +1,7 @@
// Service Worker a PWA-hoz
const CACHE_NAME = "chat-pwa-v1";
const urlsToCache = [
- "/chat.html",
+ "/index.html",
"/",
"https://www.gstatic.com/firebasejs/9.22.0/firebase-app-compat.js",
"https://www.gstatic.com/firebasejs/9.22.0/firebase-database-compat.js",