summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Ivanov <[email protected]>2024-08-19 22:33:21 +0300
committerMarin Ivanov <[email protected]>2024-08-19 22:33:21 +0300
commitc043207f57aa71fd9a89f31fee0e9756aad1a597 (patch)
treefa41ba5ae060f615d6a0da85b614ad04ee6c46d6
parent58ffb8d601910055c3618d41cdbf559925aa6742 (diff)
cosmetic improvements
-rw-r--r--index.html8
-rw-r--r--ka.js10
-rw-r--r--style.css13
3 files changed, 18 insertions, 13 deletions
diff --git a/index.html b/index.html
index 66202a6..6376df2 100644
--- a/index.html
+++ b/index.html
@@ -9,7 +9,7 @@
<header><big>🛠️ WebIF 2.0</big></header>
<main>
<nav>
- <label for="showmenu"><big>≡ Меню</big></label>
+ <label for="showmenu"><span>☰</span> Меню</label>
<input type="checkbox" id="showmenu" />
<a class="active" href="#">Данни</a>
@@ -22,7 +22,11 @@
<div class="grid center middle">
<div>
<div class="loadspin"></div>
- <p>Зарежда...</p>
+ <p>
+ <noscript>Не</noscript>
+ Зарежда...
+ <noscript>JavaScript не е включен .</noscript>
+ </p>
</div>
</div>
</section>
diff --git a/ka.js b/ka.js
index 17370e9..9d5efc9 100644
--- a/ka.js
+++ b/ka.js
@@ -34,12 +34,10 @@ var input = (type) => tag("input", {type});
function router(root, routes, onreload) {
function reload() {
- let h = doc.location.hash.substr(1) || "/";
- if (!(h in routes)) {
- h = "";
- }
- root.replaceChildren(routes[h]());
- onreload && onreload(h);
+ const h = doc.location.hash.substr(1) || "/";
+ const r = h in routes ? h : "";
+ root.replaceChildren(routes[r]());
+ onreload && onreload(r);
};
reload();
window.addEventListener("hashchange", reload);
diff --git a/style.css b/style.css
index 825dc15..47f6315 100644
--- a/style.css
+++ b/style.css
@@ -4,7 +4,7 @@ body {
}
h1, h2, h3 {
- margin: 0.3em 0 0.3em 0;
+ margin: 0;
}
.container {
@@ -15,14 +15,12 @@ h1, h2, h3 {
main, nav, section, nav a, nav label {
box-sizing: border-box;
}
-
header {
padding: 1em;
}
section {
- padding: 0 0.5em 0 0.5em ;
+ padding: 0.5em;
}
-
main {
display: flex;
}
@@ -49,11 +47,16 @@ nav a, nav label {
}
nav label {
- font-size: 1.2em;
+ text-align: center;
+ font-size: 1.3em;
+ line-height: 1.3em;
background-color: #000;
color: #fff;
cursor: pointer;
}
+nav label > span {
+ font-size: 1.4em;
+}
nav input, nav label {
display: none;