From 979bcb2433e184344896cef5bf054e41c63dec0a Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Tue, 13 Sep 2022 01:56:07 +0000 Subject: Revert "fix site on ios 16" This reverts commit 67c3de61cb69aab382f9a11e9cbef926ad26d03d. --- frontend/src/xeact/jsx-runtime.js | 15 ------- frontend/src/xeact/xeact.js | 88 --------------------------------------- frontend/src/xeact/xeact.ts | 9 ---- src/tmpl/mod.rs | 2 +- 4 files changed, 1 insertion(+), 113 deletions(-) delete mode 100644 frontend/src/xeact/jsx-runtime.js delete mode 100644 frontend/src/xeact/xeact.js delete mode 100644 frontend/src/xeact/xeact.ts diff --git a/frontend/src/xeact/jsx-runtime.js b/frontend/src/xeact/jsx-runtime.js deleted file mode 100644 index b71a99e..0000000 --- a/frontend/src/xeact/jsx-runtime.js +++ /dev/null @@ -1,15 +0,0 @@ -import { h } from './xeact.js'; - -/** - * Create a DOM element, assign the properties of `data` to it, and append all `data.children`. - * - * @type{function(string, Object=): HTMLElement} - */ -export const jsx = (tag, data) => { - let children = data.children; - delete data.children; - const result = h(tag, data, children); - result.classList.value = result.class; - return result; -}; -export const jsxs = jsx; diff --git a/frontend/src/xeact/xeact.js b/frontend/src/xeact/xeact.js deleted file mode 100644 index 7be9a1c..0000000 --- a/frontend/src/xeact/xeact.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Creates a DOM element, assigns the properties of `data` to it, and appends all `children`. - * - * @type{function(string|Function, Object=, Node|Array.=)} - */ -const h = (name, data = {}, children = []) => { - const result = typeof name == "function" ? name(data) : Object.assign(document.createElement(name), data); - if (!Array.isArray(children)) { - children = [children]; - } - result.append(...children); - return result; -}; - -/** - * Create a text node. - * - * Equivalent to `document.createTextNode(text)` - * - * @type{function(string): Text} - */ -const t = (text) => document.createTextNode(text); - -/** - * Remove all child nodes from a DOM element. - * - * @type{function(Node)} - */ -const x = (elem) => { - while (elem.lastChild) { - elem.removeChild(elem.lastChild); - } -}; - -/** - * Get all elements with the given ID. - * - * Equivalent to `document.getElementById(name)` - * - * @type{function(string): HTMLElement} - */ -const g = (name) => document.getElementById(name); - -/** - * Get all elements with the given class name. - * - * Equivalent to `document.getElementsByClassName(name)` - * - * @type{function(string): HTMLCollectionOf.} - */ -const c = (name) => document.getElementsByClassName(name); - -/** @type{function(string): HTMLCollectionOf.} */ -const n = (name) => document.getElementsByName(name); - -/** - * Get all elements matching the given HTML selector. - * - * Matches selectors with `document.querySelectorAll(selector)` - * - * @type{function(string): Array.} - */ -const s = (selector) => Array.from(document.querySelectorAll(selector)); - -/** - * Generate a relative URL from `url`, appending all key-value pairs from `params` as URL-encoded parameters. - * - * @type{function(string=, Object=): string} - */ -const u = (url = "", params = {}) => { - let result = new URL(url, window.location.href); - Object.entries(params).forEach((kv) => { - let [k, v] = kv; - result.searchParams.set(k, v); - }); - return result.toString(); -}; - -/** - * Takes a callback to run when all DOM content is loaded. - * - * Equivalent to `window.addEventListener('DOMContentLoaded', callback)` - * - * @type{function(function())} - */ -const r = (callback) => window.addEventListener('DOMContentLoaded', callback); - -export { h, t, x, g, c, n, u, s, r }; diff --git a/frontend/src/xeact/xeact.ts b/frontend/src/xeact/xeact.ts deleted file mode 100644 index 8974ec1..0000000 --- a/frontend/src/xeact/xeact.ts +++ /dev/null @@ -1,9 +0,0 @@ -export * from "./xeact.js"; - -declare global { - export namespace JSX { - interface IntrinsicElements { - [elemName: string]: any; - } - } -} diff --git a/src/tmpl/mod.rs b/src/tmpl/mod.rs index 2958c99..c0b1089 100644 --- a/src/tmpl/mod.rs +++ b/src/tmpl/mod.rs @@ -40,7 +40,7 @@ pub fn xeblog_slide(name: String, essential: bool) -> Markup { html! { div.hero.{@if essential {("xeblog-slides-essential")} @else {("xeblog-slides-fluff")}} { picture style="margin:0" { - //source type="image/avif" srcset={"https://cdn.xeiaso.net/file/christine-static/talks/" (name) ".avif"}; + source type="image/avif" srcset={"https://cdn.xeiaso.net/file/christine-static/talks/" (name) ".avif"}; source type="image/webp" srcset={"https://cdn.xeiaso.net/file/christine-static/talks/" (name) ".webp"}; img style="padding:0" loading="lazy" src={"https://cdn.xeiaso.net/file/christine-static/talks/" (name) "-smol.png"}; } -- cgit v1.2.3