Added DeviceTile

This commit is contained in:
aronmal 2023-10-18 02:08:11 +02:00
parent 19b075058e
commit 5ec6a19f09
Signed by: aronmal
GPG key ID: 816B7707426FC612
3 changed files with 55 additions and 200 deletions

View file

@ -0,0 +1,21 @@
import { Show } from "solid-js";
function DeviceTile(props: { href?: string; name: string; src: string }) {
return (
<a href={props.href ?? "soon.HTML"}>
<div class="raster">
<h3>{props.name}</h3>
<Show when={props.src.startsWith("/images")}>
<img src={props.src} alt={props.name} />
</Show>
<Show when={props.src.startsWith("/videos")}>
<video width="auto" height="auto" autoplay muted loop>
<source src={props.src} type="video/mp4" />
</video>
</Show>
</div>
</a>
);
}
export default DeviceTile;