summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorMarin Ivanov <[email protected]>2024-08-20 12:02:40 +0300
committerMarin Ivanov <[email protected]>2024-08-20 12:02:40 +0300
commitec34163617e3588a63dc611834a372746f9d4107 (patch)
tree3d8220a89b9a0c5bb13bd911084b117d344e8a9f /index.html
parent08a1acccd6c6e6a11211b065a40629c08312686a (diff)
wip: dynamic data
Diffstat (limited to 'index.html')
-rw-r--r--index.html75
1 files changed, 13 insertions, 62 deletions
diff --git a/index.html b/index.html
index 8997249..5332fce 100644
--- a/index.html
+++ b/index.html
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
+ <meta charset="utf8">
<title>WebIF 2.0</title>
<link rel="stylesheet" href="style.css">
</head>
@@ -18,70 +19,20 @@
<a href="#/tools">Инструменти</a>
<a href="#/waiting">Пуйчи</a>
</nav>
- <section>
- <div id="loader">
- <div>
- <div class="loadspin"></div>
- <p>
- <noscript>Не</noscript>
- Зарежда...
- <noscript>JavaScript не е включен .</noscript>
- </p>
- </div>
- </div>
- <div id="app"></div>
- </section>
+ <section id="app"></section>
</main>
</div>
+ <div id="loader" title="цъкни да скриеш">
+ <div>
+ <div class="loadspin"></div>
+ <p>
+ <noscript>Не</noscript>
+ Зарежда...
+ <noscript>JavaScript не е включен.</noscript>
+ </p>
+ </div>
+ </div>
<script src="ka.js"></script>
- <script>
- let isLoading = 0;
- const loading = (val) => {
- isLoading = val;
- loader.$cls(isLoading ? "" : "hidden");
- }
- loader.$click(() => loading(0));
- const routes = {
- "/": () => div(
- h2("Lorem Ipsum"),
- p("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "),
- p("Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."),
-
- h2("Ipsum Lorem"),
- p("Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."),
- p("Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."),
- p("Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."),
- p("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "),
- ),
- "/network": () => div(
- table(
- tr(
- td("IP"),
- td(input("text").$value("127.0.0.1")),
- )
- ).$cls("network"),
- ),
- "/config": () => {
- return div();
- },
- "/waiting": () => {
- loading(1);
- setTimeout(() => {
- loading(0);
- app.reload();
- }, 3000);
- return div("Пуйчи");
- },
- "": () => div(
- h1("Несъществуваща страница"),
- p("Страницата не е намерена.")
- ),
- };
- const onchange = () => {
- doc.querySelectorAll('nav a').forEach(x => x.$cls((location.href===x.href)?"active":""));
- loading(isLoading);
- };
- router(app, routes, onchange);
- </script>
+ <script src="app.js"></script>
</body>
</html>