aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXe Iaso <me@christine.website>2022-09-13 01:56:07 +0000
committerXe Iaso <me@christine.website>2022-09-13 01:56:07 +0000
commit979bcb2433e184344896cef5bf054e41c63dec0a (patch)
tree7a37858ba642ffcd8d78686009b4e9110aced3b8
parentc03769d6c59a3ea1800d6488021bc9670cf9f039 (diff)
downloadxesite-979bcb2433e184344896cef5bf054e41c63dec0a.tar.xz
xesite-979bcb2433e184344896cef5bf054e41c63dec0a.zip
Revert "fix site on ios 16"
This reverts commit 67c3de61cb69aab382f9a11e9cbef926ad26d03d.
-rw-r--r--frontend/src/xeact/jsx-runtime.js15
-rw-r--r--frontend/src/xeact/xeact.js88
-rw-r--r--frontend/src/xeact/xeact.ts9
-rw-r--r--src/tmpl/mod.rs2
4 files changed, 1 insertions, 113 deletions
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.<Node|string>=)}
- */
-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.<Element>}
- */
-const c = (name) => document.getElementsByClassName(name);
-
-/** @type{function(string): HTMLCollectionOf.<Element>} */
-const n = (name) => document.getElementsByName(name);
-
-/**
- * Get all elements matching the given HTML selector.
- *
- * Matches selectors with `document.querySelectorAll(selector)`
- *
- * @type{function(string): Array.<HTMLElement>}
- */
-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"};
}