a more standard progress bar
This commit is contained in:
@@ -10,21 +10,20 @@
|
|||||||
|
|
||||||
let styl; let selected; let progress;
|
let styl; let selected; let progress;
|
||||||
$: selected = $currentModule && $currentModule.name === module.name
|
$: selected = $currentModule && $currentModule.name === module.name
|
||||||
$: if (selected) progress = getProgress($position)
|
$: if (selected) {
|
||||||
$: styl = selected
|
progress = getProgress($position)
|
||||||
? `background: linear-gradient(to right, var(--finished-bg) 0%, var(--finished-bg) ${progress + 1}%, var(--pending-bg) ${100 - progress}%, var(--pending-bg) 100%)`
|
}
|
||||||
: ""
|
|
||||||
|
|
||||||
// TODO: add checkboxes for 'want to watch'
|
// TODO: add checkboxes for 'want to watch'
|
||||||
// TODO: gray out watched modules
|
// TODO: gray out watched modules
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div on:click={() => dispatcher("selectModule", { module })} ><span style="{styl}" >I want to {module.outcome}.</span></div>
|
<div on:click={() => dispatcher("selectModule", { module })} >
|
||||||
{#if progress}
|
<span style="{styl}" >I want to {module.outcome}.</span>
|
||||||
<div>
|
{#if selected}
|
||||||
<progress value={progress} max=100>Hi</progress>
|
<progress value={progress} max=100>Hi</progress>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
|
||||||
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Reference in New Issue
Block a user