immich/web/src/lib/components/shared-components/navigation-loading-bar.svelte
Min Idzelis a78260296c
feat(web): assets now have a permanent URL (#8532)
* Remove asest redirect pages

* Rename route paths to handle optional assetId

* Update old references to new routes

* Load and display asset from all routes that can show assetId

* Add <main> in base layout, update portals to target it

* Wire up updating navigation in response to open/close/prev/next

* Replace events with navigation functions

* Add types to param matcher

* misc cleanup

* Fix reload on /search pages

* Avoid loading bar between photos nav. Delay loading bar by 200ms for all navigations

* Update url for maps routes. Note: on page reload, next/prev is not available

* Dynamically load asset-viewer on map page

* When reloading a url with assetUrl, hide background page to prevent flash during load

* Mostly style, review comments

* Load buckets for assets on demand

* Forgot this update call

* typo

* fix test

* Fix carelessness

* Review comment

* merge main

* remove assets

* fix submodule

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
2024-04-24 19:24:19 +00:00

33 lines
751 B
Svelte

<script lang="ts">
import { onMount } from 'svelte';
import { cubicOut } from 'svelte/easing';
import { tweened } from 'svelte/motion';
let showing = false;
// delay showing any progress for a little bit so very fast loads
// do not cause flicker
const delay = 100;
const progress = tweened(0, {
duration: 1000,
easing: cubicOut,
});
function animate() {
showing = true;
void progress.set(90);
}
onMount(() => {
const timer = setTimeout(animate, delay);
return () => clearTimeout(timer);
});
</script>
{#if showing}
<div class="absolute left-0 top-0 z-[999999999] h-[3px] w-screen bg-white">
<span class="absolute h-[3px] bg-immich-primary" style:width={`${$progress}%`} />
</div>
{/if}