diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2025-05-02 16:37:29 +0300 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2025-05-02 16:37:29 +0300 |
| commit | ef72b74ec34e95a38890d542cda298dd6565d5ad (patch) | |
| tree | 63fe96b24a8534e8dd2d88b1ca3d69b21c502d3e /browser/static | |
| parent | daca0e6b68d32d885face00d68df5b5cb00e098b (diff) | |
Start replacing browser with a chat demo
Diffstat (limited to 'browser/static')
| -rw-r--r-- | browser/static/InclusiveSans-Regular.ttf | bin | 57124 -> 0 bytes | |||
| -rw-r--r-- | browser/static/htmp.js | 38 | ||||
| -rw-r--r-- | browser/static/styles.css | 140 |
3 files changed, 0 insertions, 178 deletions
diff --git a/browser/static/InclusiveSans-Regular.ttf b/browser/static/InclusiveSans-Regular.ttf Binary files differdeleted file mode 100644 index 3a30e79..0000000 --- a/browser/static/InclusiveSans-Regular.ttf +++ /dev/null diff --git a/browser/static/htmp.js b/browser/static/htmp.js deleted file mode 100644 index 27d963b..0000000 --- a/browser/static/htmp.js +++ /dev/null @@ -1,38 +0,0 @@ -const iframe = document.createElement("iframe"); -iframe.name = "htmp"; -iframe.hidden = true; -iframe.addEventListener("load", function () { - setTimeout(() => { - const cd = this.contentDocument; - const cw = this.contentWindow; - // If the server responds with an entire HTML document, replace the current document with it. - // To check whether the response is an entire page we check the presence of this very snippet. - if (cd.querySelector("iframe[name='htmp']")) { - document.documentElement.replaceWith(cd.documentElement); - // If the server responds with a fragment, replace the target element with it. - } else { - document - .querySelector(cw.location.hash || null) - ?.replaceWith(...cd.body.childNodes); - const url = new URL(cw.location.href); - url.searchParams.delete("htmp"); - url.hash = ""; - history.replaceState({}, "", url.toString()); - } - }); -}); -document.body.appendChild(iframe); - -document.querySelectorAll("form[htmp]").forEach(function (el) { - const r = el.attributes.replace.value; - const input = document.createElement("input"); - input.type = "hidden"; - input.name = "htmp"; - input.value = r; - el.appendChild(input); - - const action = new URL(el.action); - action.hash = r; - el.action = action.toString(); - el.target = "htmp"; -}); diff --git a/browser/static/styles.css b/browser/static/styles.css deleted file mode 100644 index 82bed74..0000000 --- a/browser/static/styles.css +++ /dev/null @@ -1,140 +0,0 @@ -:root { - --blue: rgb(30, 99, 248); - --red: #d42f2f; - --yellow: #ff9800; - --black: rgb(0, 0, 0); - --white: rgb(255, 255, 255); - --gray: #666; - --light-gray-1: #f2f2f2; - --light-gray-2: #f8f6ff; - --gold-trans: #ffcd0455; - - --font-family: "Inclusive Sans", sans-serif; -} - -@font-face { - font-family: "Inclusive Sans"; - font-style: normal; - font-weight: 400; - font-display: swap; - src: url(/static/InclusiveSans-Regular.ttf) format("woff2"); -} - -html { - font-family: var(--font-family) !important; - font-size: 16px; -} - -body { - padding: 10px; - margin: 0 auto; - line-height: 24px; -} - -#container { - display: flex; - flex-flow: row wrap; - justify-content: space-between; - align-items: flex-start; -} - -a, -.contrast { - color: var(--blue); -} - -h1 { - margin-bottom: 40px; -} - -h1 a { - color: var(--black); - text-decoration: none; -} - -h1:hover a { - border-bottom: 2px dotted var(--blue); - text-decoration: none; -} - -textarea, -input { - font-family: var(--font-family); - font-size: 16px; -} - -button, -input[type="submit"] { - cursor: pointer; - font-size: 16px; - border-radius: 4px; - text-shadow: none; - box-shadow: none; - padding: 5px 8px; - border: 0; - background-color: var(--blue); - color: var(--white); - - margin-top: 20px; -} - -button.link, -input[type="submit"].link { - background: none; - color: var(--blue); - padding: 0; - margin: 0; - text-decoration: underline; - font-family: "Inclusive Sans"; -} - -button.red, -input[type="submit"].red { - background-color: var(--red); -} - -button.blue, -input[type="submit"].blue { - background-color: var(--blue); -} - -button.yellow, -input[type="submit"].yellow { - background-color: var(--yellow); -} - -input[type="text"], -input[type*="date"] { - font-size: 16px; - color: var(--black); -} - -input[type="text"]:disabled, -input[type*="date"]:disabled { - color: var(--gray); -} - -aside { - width: 250px; -} - -main { - flex: 1; - overflow-y: scroll; - max-height: 100%; -} - -table { - width: 100%; -} - -th, -td { - min-width: 100px; - text-align: left; - padding: 7px 5px; -} - -tr:nth-of-type(odd) td { - background-color: var(--light-gray-2); -} |
