From c957bc97d387a2c1f5459105f6587f33ee1c1fd8 Mon Sep 17 00:00:00 2001 From: MatsuneMikuroi Date: Mon, 11 May 2026 23:11:32 +0200 Subject: [PATCH] whole app --- icon-maskable.svg | 17 + icon.svg | 17 + index.html | 1181 +++++++++++++++++++++++++++++++++++++++++++++ manifest.json | 24 + readme.md | 17 + sw.js | 48 ++ 6 files changed, 1304 insertions(+) create mode 100644 icon-maskable.svg create mode 100644 icon.svg create mode 100644 index.html create mode 100644 manifest.json create mode 100644 readme.md create mode 100644 sw.js diff --git a/icon-maskable.svg b/icon-maskable.svg new file mode 100644 index 0000000..68fe248 --- /dev/null +++ b/icon-maskable.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..38cc742 --- /dev/null +++ b/icon.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/index.html b/index.html new file mode 100644 index 0000000..f7a3ec9 --- /dev/null +++ b/index.html @@ -0,0 +1,1181 @@ + + + + + + Credit Tracker + + + + + + + + + + +
+
+
📚 Credit Tracker
+
Loading…
+
+ +
+ +
+ +
+
+ + + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+
+ + + + + + + + + + diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..d9a1a43 --- /dev/null +++ b/manifest.json @@ -0,0 +1,24 @@ +{ + "name": "Credit Tracker", + "short_name": "Credits", + "description": "Track your university courses, grades and credits", + "start_url": "./index.html", + "display": "standalone", + "background_color": "#F3F4F6", + "theme_color": "#4F46E5", + "orientation": "portrait", + "icons": [ + { + "src": "icon.svg", + "sizes": "any", + "type": "image/svg+xml", + "purpose": "any" + }, + { + "src": "icon-maskable.svg", + "sizes": "any", + "type": "image/svg+xml", + "purpose": "maskable" + } + ] +} diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..783cf65 --- /dev/null +++ b/readme.md @@ -0,0 +1,17 @@ +I need your help for a small web app i'd like to make. + +I take a lot of courses and i need to plannify when to take them and how much they give. + +Each course has this attributes: +- Study plan + - Block +- name +- credits +- semester (Autumn or Spring) +- Grade (if >= 4 or block.mean() >= 4, passed, else, failed) + +I'd like to have it as a small webapp i can use on my phone, where i can easily manage my different semester (being able to create one), add my grade, manage my study plan (able to add course to a new plan, an existing one or without study plan), choose the block the course is in (if in a study plan) + +Everything must be sumerized into tables (global, per study plan, per semester) + +Can you help me? \ No newline at end of file diff --git a/sw.js b/sw.js new file mode 100644 index 0000000..3056e12 --- /dev/null +++ b/sw.js @@ -0,0 +1,48 @@ +const CACHE_NAME = 'credittracker-v2'; +const ASSETS = [ + './index.html', + './manifest.json', + './icon.svg', + './icon-maskable.svg' +]; + +// Install: pre-cache all app shell files +self.addEventListener('install', event => { + event.waitUntil( + caches.open(CACHE_NAME).then(cache => cache.addAll(ASSETS)) + ); + self.skipWaiting(); +}); + +// Activate: clean up old caches +self.addEventListener('activate', event => { + event.waitUntil( + caches.keys().then(keys => + Promise.all(keys.filter(k => k !== CACHE_NAME).map(k => caches.delete(k))) + ) + ); + self.clients.claim(); +}); + +// Fetch: cache-first for app files, network-first for everything else +self.addEventListener('fetch', event => { + // Only handle same-origin GET requests + if (event.request.method !== 'GET') return; + + event.respondWith( + caches.match(event.request).then(cached => { + if (cached) return cached; + return fetch(event.request).then(response => { + // Cache successful responses for app assets + if (response.ok) { + const clone = response.clone(); + caches.open(CACHE_NAME).then(cache => cache.put(event.request, clone)); + } + return response; + }); + }).catch(() => { + // Offline fallback: return the app shell + return caches.match('./index.html'); + }) + ); +});