* add ~platform/DocumentTitle * add titles for some pages
This commit is contained in:
parent
1115135380
commit
1c8a3f0bbb
12 changed files with 843 additions and 823 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue