remove utils
All checks were successful
/ depoly (push) Successful in 1m22s

* add ~platform/DocumentTitle
* add titles for some pages
This commit is contained in:
thislight 2025-01-02 22:43:37 +08:00
parent 1115135380
commit 1c8a3f0bbb
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E
12 changed files with 843 additions and 823 deletions

View file

@ -3,14 +3,12 @@ import {
splitProps,
Component,
createSignal,
createEffect,
onMount,
createRenderEffect,
Show,
} from "solid-js";
import { css } from "solid-styled";
import { decode } from "blurhash";
import { mergeClass } from "../utils";
type ImgProps = {
blurhash?: string;
@ -24,6 +22,7 @@ const Img: Component<ImgProps> = (props) => {
"blurhash",
"keepBlur",
"class",
"classList",
"style",
]);
const [isImgLoaded, setIsImgLoaded] = createSignal(false);
@ -61,21 +60,21 @@ const Img: Component<ImgProps> = (props) => {
const onImgLoaded = () => {
setIsImgLoaded(true);
setImgSize({
width: imgE.width,
height: imgE.height,
width: imgE!.width,
height: imgE!.height,
});
};
const onMetadataLoaded = () => {
setImgSize({
width: imgE.width,
height: imgE.height,
width: imgE!.width,
height: imgE!.height,
});
};
onMount(() => {
setImgSize((x) => {
const parent = imgE.parentElement;
const parent = imgE!.parentElement;
if (!parent) return x;
return x
? x
@ -87,7 +86,14 @@ const Img: Component<ImgProps> = (props) => {
});
return (
<div class={mergeClass(managed.class, "img-root")} style={managed.style}>
<div
classList={{
...managed.classList,
[managed.class ?? ""]: true,
"img-root": true,
}}
style={managed.style}
>
<Show when={managed.blurhash}>
<canvas
ref={(canvas) => {