mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-06 00:47:09 +00:00
chore(control): added upload finished animation
This commit is contained in:
@@ -55,6 +55,20 @@
|
|||||||
loading_data = liveQuery(() => get_loading_data(get_file_primary_key(file), d));
|
loading_data = liveQuery(() => get_loading_data(get_file_primary_key(file), d));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let loading_finished = $state(false);
|
||||||
|
$effect(() => {
|
||||||
|
if (!loading_data) return;
|
||||||
|
let prev: boolean | undefined;
|
||||||
|
const sub = loading_data.subscribe((v) => {
|
||||||
|
if (prev === true && v.is_loading === false) {
|
||||||
|
loading_finished = true;
|
||||||
|
setTimeout(() => (loading_finished = false), 200);
|
||||||
|
}
|
||||||
|
prev = v.is_loading;
|
||||||
|
});
|
||||||
|
return () => sub.unsubscribe();
|
||||||
|
});
|
||||||
|
|
||||||
let thumbnail_url = liveQuery(() => get_thumbnail_url(get_file_primary_key(file)));
|
let thumbnail_url = liveQuery(() => get_thumbnail_url(get_file_primary_key(file)));
|
||||||
let date_mapping: Observable<Record<string, Date>> = liveQuery(() =>
|
let date_mapping: Observable<Record<string, Date>> = liveQuery(() =>
|
||||||
get_date_mapping(get_file_primary_key(file))
|
get_date_mapping(get_file_primary_key(file))
|
||||||
@@ -151,7 +165,9 @@
|
|||||||
function get_main_classes(): string {
|
function get_main_classes(): string {
|
||||||
let out = '';
|
let out = '';
|
||||||
|
|
||||||
if ($loading_data?.is_loading) {
|
if (loading_finished) {
|
||||||
|
out += 'bg-stone-500 text-white/30';
|
||||||
|
} else if ($loading_data?.is_loading) {
|
||||||
out += 'bg-stone-700 text-white/30';
|
out += 'bg-stone-700 text-white/30';
|
||||||
} else {
|
} else {
|
||||||
out += get_selectable_color_classes(
|
out += get_selectable_color_classes(
|
||||||
@@ -216,7 +232,7 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div data-testid="inode" class="flex flex-row h-{$current_height.file} w-full">
|
<div data-testid="inode" class="flex flex-row h-{$current_height.file} w-full {loading_finished ? 'scale-105' : ''} transition-[scale] duration-300">
|
||||||
{#if !not_interactable}
|
{#if !not_interactable}
|
||||||
<div class="h-{$current_height.file} aspect-square max-w-15 flex">
|
<div class="h-{$current_height.file} aspect-square max-w-15 flex">
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user