Jason.json
Jason.json
SSolidJS
Created by Jason.json on 1/4/2025 in #support
Solid Start does not load images on load event?
It seems like it should work but it doesn't
11 replies
SSolidJS
Created by Jason.json on 1/4/2025 in #support
Solid Start does not load images on load event?
It does not swap the placeholder image in this case and idk why
11 replies
SSolidJS
Created by Jason.json on 1/4/2025 in #support
Solid Start does not load images on load event?
i used this freaky solution wich seems to work for me
import { createEffect, createSignal } from "solid-js";
import "./LazyImage.tsx.scss";
interface LazyImageProps {
placeholder?: string;
class?: string;
src: string;
alt: string;
}

export default function LazyImage(props: LazyImageProps) {
const [source, setSource] = createSignal(props.placeholder ?? props.src);
const [loading, setLoading] = createSignal(props.placeholder ? true : false);

let el: HTMLImageElement | undefined;

createEffect(() => {
if (el && el.complete) {
el.src = source();
el.onload = () => {
setLoading(false);
};
}
});

const onLoad = () => {
setSource(props.src);
};

return (
<img
classList={{ lazy: loading() }}
class={props.class}
ref={el}
src={source()}
onLoad={onLoad}
alt={props.alt}
draggable="false"
loading="lazy"
/>
);
}
import { createEffect, createSignal } from "solid-js";
import "./LazyImage.tsx.scss";
interface LazyImageProps {
placeholder?: string;
class?: string;
src: string;
alt: string;
}

export default function LazyImage(props: LazyImageProps) {
const [source, setSource] = createSignal(props.placeholder ?? props.src);
const [loading, setLoading] = createSignal(props.placeholder ? true : false);

let el: HTMLImageElement | undefined;

createEffect(() => {
if (el && el.complete) {
el.src = source();
el.onload = () => {
setLoading(false);
};
}
});

const onLoad = () => {
setSource(props.src);
};

return (
<img
classList={{ lazy: loading() }}
class={props.class}
ref={el}
src={source()}
onLoad={onLoad}
alt={props.alt}
draggable="false"
loading="lazy"
/>
);
}
11 replies
SSolidJS
Created by Jason.json on 1/4/2025 in #support
Solid Start does not load images on load event?
No description
11 replies
SSolidJS
Created by Jason.json on 1/4/2025 in #support
Solid Start does not load images on load event?
It stays like that maybe that's ssr problem?
11 replies
SSolidJS
Created by Jason.json on 1/4/2025 in #support
Solid Start does not load images on load event?
No description
11 replies
SSolidJS
Created by Jason.json on 1/4/2025 in #support
Solid Start does not load images on load event?
Ok thank you
11 replies
SSolidJS
Created by Jason.json on 1/3/2025 in #support
Post CSS with Solid Start
Sure thing, also same here. I've never used it before, but I want to make my website as much optimized as I can.
11 replies
SSolidJS
Created by Jason.json on 1/3/2025 in #support
Post CSS with Solid Start
Also in my case I should use .tsx files instead of html.
11 replies
SSolidJS
Created by Jason.json on 1/3/2025 in #support
Post CSS with Solid Start
Tbh I saw booth of those solutions before asking, but I wanted to be sure or find other solutions wich would work with solid start and vite. 🙂
11 replies
SSolidJS
Created by Jason.json on 1/3/2025 in #support
Post CSS with Solid Start
Oh cool
11 replies
SSolidJS
Created by Jason.json on 1/3/2025 in #support
Post CSS with Solid Start
Including purge?
11 replies
SSolidJS
Created by Jason.json on 12/26/2024 in #support
Changing baseURL based on production and window.location.href
No description
6 replies
SSolidJS
Created by Jason.json on 12/26/2024 in #support
Changing baseURL based on production and window.location.href
For your help
6 replies
SSolidJS
Created by Jason.json on 12/26/2024 in #support
Changing baseURL based on production and window.location.href
But thanks anyway
6 replies
SSolidJS
Created by Jason.json on 12/26/2024 in #support
Changing baseURL based on production and window.location.href
I didn't looked at them sorry
6 replies
SSolidJS
Created by Jason.json on 12/25/2024 in #support
Route for error 500
Thanks!
5 replies
SSolidJS
Created by Jason.json on 12/25/2024 in #support
Route for error 500
Also is there any chance to listen on DomContentLoadedEvent? I want to display Loading popup when the app is loading a route
5 replies
SSolidJS
Created by Jason.json on 12/18/2024 in #support
Solid Start offline indicator in mobile / desktop app
xd
3 replies
SSolidJS
Created by Jason.json on 12/14/2024 in #support
How to include Gzip compression to Solid Start project?
It was just turned off, idk why
20 replies