Files
radicle-explorer/src/BlockTimer.svelte
T
Rūdolfs Ošiņš 9b8a9a46dd Upgrade Cypress dependency
This gets rid of the testing-library-* and cypress-vite-devserver
dependencies and updates the specs according to the latest Cypress
documentation.

Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2022-09-26 16:34:30 +02:00

34 lines
748 B
Svelte

<script lang="ts">
export let startBlock: number;
export let duration: number;
export let latestBlock: number;
let progress: number = 0;
$: if (latestBlock < startBlock + duration) {
progress = (latestBlock - startBlock) * Math.floor(100 / duration);
} else {
progress = 100;
}
</script>
<style>
.container {
text-align: center;
height: 0.5rem;
width: 100%;
border-radius: var(--border-radius-small);
background-color: var(--color-secondary-2);
}
.progress-bar {
height: 0.5rem;
width: 0px;
border-radius: var(--border-radius-small);
background-color: var(--color-secondary);
}
</style>
<div class="container">
<div class="progress-bar" style:width={`${progress}%`} />
</div>