Skip to content

Commit

Permalink
style: improve view selector
Browse files Browse the repository at this point in the history
  • Loading branch information
agrrh committed Dec 8, 2023
1 parent 059fa5b commit 0a91879
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions frontend/src/lib/ViewSelector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
let curViewName = '';
let curViewIconClass = '';
let isActiveHours = "";
let isActiveQuarter = "";
let isActiveYear = "";
const views = [
{ name: 'hours', icon: 'fa fa-clock' },
{ name: 'quarter', icon: 'fa fa-calendar-days' },
Expand All @@ -27,19 +31,18 @@
viewStore.subscribe((value) => (view = value));
$: view;
$: curViewIconClass = views.filter((x) => x.name == view)[0]['icon'];
$: viewText = views.filter((x) => x.name == view)[0]['text'];
$: isActiveHours = view == 'hours' ? "" : "has-text-grey";
$: isActiveQuarter = view == 'quarter' ? "" : "has-text-grey";
$: isActiveYear = view == 'year' ? "" : "has-text-grey";
</script>

<div class="navbar-item">
<a id="viewSelector" class="button is-dark has-text-left" on:click={nextView}>
<span class={curViewIconClass}></span>
<span class="is-capitalized"> &nbsp; {view} </span>
<a id="viewSelector" class="button is-dark" on:click={nextView}>
<span class="fa fa-clock {isActiveHours}"></span>
<span class="fa fa-calendar-days mr-3 ml-3 {isActiveQuarter}"></span>
<span class="fa fa-earth-asia {isActiveYear}"></span>
</a>
</div>

<style>
a#viewSelector {
width: 120px;
}
</style>

0 comments on commit 0a91879

Please sign in to comment.