diff --git a/TODO.md b/TODO.md
index 42b1da9..a75f5a2 100644
--- a/TODO.md
+++ b/TODO.md
@@ -6,13 +6,10 @@
- [ ] edit user data - change password, mail...
## Core of the app
-- [ ] header and navbar
-- [ ] dashboard
- - [x] css
- - [ ] its just plain
- - [ ] graphs
-- [x] Habits list
- - [ ] css
-- [ ] Habits create
- - [ ] validate cron input
-- [ ] Habits track
+- [ ] intro tutorial when no car exist or just dont show anything
+- [ ] change/set default car
+- [ ] specific car view - charts, fuel records
+- [ ] remove/edit fuel record
+
+- [ ] IndexDB
+ - [ ]
diff --git a/app/views/dashboard/index.php b/app/views/dashboard/index.php
index 4d91474..4e8d959 100644
--- a/app/views/dashboard/index.php
+++ b/app/views/dashboard/index.php
@@ -5,6 +5,7 @@
-
-
+
+
diff --git a/public/css/global.css b/public/css/global.css
index 12b07e7..357c3c0 100644
--- a/public/css/global.css
+++ b/public/css/global.css
@@ -27,6 +27,7 @@ h1 {
cursor: pointer;
border-radius: var(--border-radious);
border: var(--borderWidth-thin) solid var(--clr-border);
+ color: white;
}
.btn-secondary {
diff --git a/public/js/offline-records.js b/public/js/offline-records.js
new file mode 100644
index 0000000..95b5744
--- /dev/null
+++ b/public/js/offline-records.js
@@ -0,0 +1,98 @@
+async function checkOnline() {
+ if (!navigator.onLine) {
+ console.log("Offline (no network connection)");
+ return false;
+ }
+
+ try {
+ const response = await fetch(
+ "https://www.google.com/favicon.ico?" + new Date().getTime(),
+ {
+ mode: "no-cors",
+ },
+ );
+ return true;
+ } catch (error) {
+ console.log("Connected to network but no internet access");
+ return false;
+ }
+}
+
+setInterval(async () => {
+ const isOnline = await checkOnline();
+ if (!isOnline) {
+ console.log("OFFLINE!!!");
+ }
+}, 5000);
+
+const offbtn = document.querySelector("#btn-offline-add");
+offbtn.addEventListener("click", (e) => {
+ e.preventDefault();
+ document.querySelector("section.dashboard").style.display = "none";
+ const offline = document.createElement("div");
+ offline.classList.add("offline");
+ offline.innerHTML = `
+ You're Offline
+ You can create an fuel record locally on your device and sync it later
+
+ `;
+ document.querySelector("main").appendChild(offline);
+});