Minimal UI for albums
This commit is contained in:
parent
89158497e5
commit
15ea565601
@ -1,15 +1,44 @@
|
|||||||
import { createSignal, onMount } from "solid-js";
|
import { For, createResource, createSignal, onMount } from "solid-js";
|
||||||
|
import { GetRandomAlbums } from "../../wailsjs/go/main/App";
|
||||||
|
import {main} from "../../wailsjs/go/models";
|
||||||
|
|
||||||
export function Home() {
|
export function Home() {
|
||||||
const [hidden, setHidden] = createSignal(true);
|
const [hidden, setHidden] = createSignal(true);
|
||||||
|
const [albums] = createResource(GetRandomAlbums);
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
|
// Fade in the UI
|
||||||
setTimeout(() => setHidden(false) , 150);
|
setTimeout(() => setHidden(false) , 150);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class={`min-h-screen ${hidden() ? "opacity-0" : "opacity-100"} transition-opacity`}>
|
<div class={`min-h-screen ${hidden() ? "opacity-0" : "opacity-100"} transition-opacity`}>
|
||||||
Home :D
|
<div class="py-10 h-64 overflow-scroll whitespace-nowrap">
|
||||||
|
<For each={albums()}>
|
||||||
|
{(album) => <Album album={album} />}
|
||||||
|
</For>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Album(props: {album: main.Album}) {
|
||||||
|
return (
|
||||||
|
<div class="inline-block mx-2 p-1 w-32 rounded bg-zinc-900">
|
||||||
|
<img
|
||||||
|
class="inline-block rounded w-30 h-30 min-w-30 min-h-30"
|
||||||
|
src={props.album.mediumImageUrl}
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
|
<div class="text-sm overflow-hidden overflow-ellipsis pt-1">
|
||||||
|
{props.album.name}
|
||||||
|
</div>
|
||||||
|
<div class="text-xs overflow-hidden overflow-ellipsis opacity-50">
|
||||||
|
{props.album.albumArtist}
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,11 @@ export function Login() {
|
|||||||
</label>
|
</label>
|
||||||
<br />
|
<br />
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<button type="submit" class="btn btn-primary">Login</button>
|
<button type="submit" class={`btn btn-primary ${loading() ? "animate-pulse" : ""}`}
|
||||||
|
disabled={loading()}
|
||||||
|
>
|
||||||
|
Login
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Show when={error() !== ""}>
|
<Show when={error() !== ""}>
|
||||||
|
@ -5,6 +5,13 @@ export default {
|
|||||||
content: [
|
content: [
|
||||||
"./src/**/*.{js,jsx,ts,tsx}",
|
"./src/**/*.{js,jsx,ts,tsx}",
|
||||||
],
|
],
|
||||||
|
theme: {
|
||||||
|
extend: {
|
||||||
|
spacing: {
|
||||||
|
"30": "7.5rem",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
daisyui,
|
daisyui,
|
||||||
],
|
],
|
||||||
|
3
frontend/wailsjs/go/main/App.d.ts
vendored
3
frontend/wailsjs/go/main/App.d.ts
vendored
@ -1,5 +1,8 @@
|
|||||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
// This file is automatically generated. DO NOT EDIT
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
import {main} from '../models';
|
||||||
|
|
||||||
|
export function GetRandomAlbums():Promise<Array<main.Album>>;
|
||||||
|
|
||||||
export function Greet(arg1:string):Promise<string>;
|
export function Greet(arg1:string):Promise<string>;
|
||||||
|
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
// This file is automatically generated. DO NOT EDIT
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
export function GetRandomAlbums() {
|
||||||
|
return window['go']['main']['App']['GetRandomAlbums']();
|
||||||
|
}
|
||||||
|
|
||||||
export function Greet(arg1) {
|
export function Greet(arg1) {
|
||||||
return window['go']['main']['App']['Greet'](arg1);
|
return window['go']['main']['App']['Greet'](arg1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user