]> git.mdlowis.com Git - projs/mdl.git/commitdiff
.
author80B <wtf@idk.lol>
Thu, 7 Jan 2021 21:47:08 +0000 (21:47 +0000)
committer80B <wtf@idk.lol>
Thu, 7 Jan 2021 21:47:08 +0000 (21:47 +0000)
index.html [new file with mode: 0644]
index.json [new file with mode: 0644]
notes/N2021-01-06-201332604 [new file with mode: 0644]
style.css [new file with mode: 0644]

diff --git a/index.html b/index.html
new file mode 100644 (file)
index 0000000..4dca567
--- /dev/null
@@ -0,0 +1,81 @@
+<!doctype html>
+<html lang="en">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta name="viewport" content="initial-scale=1">
+<link rel="shortcut icon" type="image/x-icon" href="logo.svg">
+<link rel="stylesheet" href="style.css">
+<title>Michael D. Lowis - About Me</title>
+
+<aside id="dialog">
+    <section>
+        <label>Search Title:</label><input id="search"/>
+        <ul id="pages"></ul>
+    </section>
+</aside>
+
+<script>
+const loadPage = (file)=>{
+    const dir = (file[0] == 'J' ? 'journals' : (file[0] == 'N' ? 'notes' : 'tasks'));
+    fetch(dir+"/"+file)
+        .then(response => response.text())
+        .then(data => {
+            code.innerText = data;
+            dialog.style.display = "none";
+        })
+};
+
+(() => {
+    const L = (tag, props = {}, ...kids) => {
+        const el = document.createElement(tag);
+        el.append(...kids);
+        return Object.assign(el, props);
+    };
+
+    const filterPages = (allitems) => {
+        const value = search.value.toLowerCase();
+        for (var i = 0; i < pages.children.length; i++) {
+            const child = pages.children[i];
+            if (child.style.display !== "none" || allitems) {
+                if (!child.text) {
+                    child.text = child.innerText.toLowerCase();
+                }
+                const titleMatch = (child.text.toLowerCase().indexOf( value ) !== -1);
+                child.style.display = ((titleMatch) ? "list-item" : "none");
+            }
+        }
+    };
+
+    const keys = {
+        "f": () => {
+            dialog.style.display = "block";
+            search.value = "";
+            filterPages(true);
+            search.focus();
+        },
+        "Escape": () => {
+            dialog.style.display = "none";
+        }
+    };
+    document.onkeyup = (ev) => (!!keys[ev.key] ? (keys[ev.key])(ev) : true);
+
+    search.onkeyup = (ev) => {
+        filterPages(ev.key === "Backspace");
+        ev.stopPropagation();
+    }
+
+    loadPage("N2021-01-06-201332604");
+
+    fetch("index.json")
+        .then(response => response.json())
+        .then(data => {
+            for (const [key, value] of Object.entries(data)) {
+              pages.appendChild(
+                L('li', {}, L('a', {href: '#', onclick: ()=>loadPage(key)}, value)));
+            }
+        })
+})();
+</script>
+
+
+<code id="code">
+</code>
diff --git a/index.json b/index.json
new file mode 100644 (file)
index 0000000..f2260fc
--- /dev/null
@@ -0,0 +1 @@
+{"T2021-01-06-201242746":"An example task","T2021-01-06-202728067":"Untitled Task","J2021-01-06":"Journal 2021-01-06","N2021-01-06-201332604":" An example note"}
\ No newline at end of file
diff --git a/notes/N2021-01-06-201332604 b/notes/N2021-01-06-201332604
new file mode 100644 (file)
index 0000000..5c4d7f6
--- /dev/null
@@ -0,0 +1 @@
+# An example note
\ No newline at end of file
diff --git a/style.css b/style.css
new file mode 100644 (file)
index 0000000..612af12
--- /dev/null
+++ b/style.css
@@ -0,0 +1,121 @@
+:root {
+    --fg-color: #222222;
+}
+
+body {
+    font-family: Verdana, Geneva, sans-serif;
+    line-height: 1.5em;
+    padding: 0;
+    margin: 1em;
+    max-width: 900px;
+    width: 90%;
+    margin-left: auto;
+    margin-right: auto;
+    color: var(--fg-color);
+    background: #F5F5F0;
+}
+
+h1, h2, h3, h4, h5, h6 {
+    margin: 1.5em 0em 0em 0em;
+    font-weight: 100;
+}
+h1 { font-size: 2.00em; }
+h2 { font-size: 1.50em; }
+h3 { font-size: 1.17em; }
+h4 { font-size: 1.12em; }
+h5 { font-size: 0.83em; }
+h6 { font-size: 0.67em; }
+
+a { text-decoration: none; }
+p { margin: 1em 0 0 0; }
+td { border-top: 1px solid var(--fg-color); }
+pre { white-space: pre-wrap; }
+
+hr {
+    border: 0;
+    height: 1px;
+    background: var(--fg-color);
+}
+
+img, svg {
+    display: block;
+    margin-left: auto;
+    margin-right: auto;
+}
+
+table {
+    width: 100%;
+    text-align: left;
+    border-collapse: collapse;
+    border-spacing: 0;
+}
+
+blockquote {
+    border-left: 3px solid #0000EE;
+    margin: 0em 1em 0em 1em;
+    padding: 0em 1em 0em 1em;
+}
+
+//code {
+//    display: inline;
+//    padding: 0.25em 0.25em 0.25em 0.25em;
+//    background-color: #ffffff;
+//    border: 1px solid var(--fg-color);
+//}
+//
+//pre code {
+//    display: block;
+//    padding: 0.5em 1em 0.5em 1em;
+//}
+
+header a {
+    color: var(--fg-color);
+    text-decoration: none;
+    font-size: 1.5rem;
+    margin-left: 1rem;
+    flex-grow: 1;
+
+    line-height: 2.5;
+    display: inline-block;
+    vertical-align: middle;
+
+}
+
+nav, header {
+    display: flex;
+    flex-wrap: wrap;
+}
+
+nav a {
+    font-size: 1rem;
+    margin: 0 1rem 0 0;
+    flex-shrink: 1;
+}
+
+aside {
+    display: none;
+    position: fixed;
+    z-index: 1;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+    overflow: auto;
+    background-color: rgb(0,0,0);
+    background-color: rgba(0,0,0,0.4);
+}
+
+aside section {
+    background: #fafafa;
+    margin: 15% auto;
+    padding: 10px;
+    width: 80%;
+    overflow: hidden;
+    position: relative;
+    display: block;
+    border-radius: 2px;
+    box-sizing: border-box;
+    box-shadow: 0 2px 2px  0px rgba(0,0,0,0.14),
+                0 3px 1px -2px rgba(0,0,0,0.20),
+                0 1px 5px  0px rgba(0,0,0,0.12);
+}