mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
progress, top bar
This commit is contained in:
parent
cb7fb6146c
commit
194a512820
6 changed files with 78 additions and 36 deletions
|
@ -26,7 +26,7 @@
|
|||
<div class="graph">
|
||||
<h1>Added</h1>
|
||||
|
||||
<div class="range-box">
|
||||
<div class="range-box-inner">
|
||||
<label>
|
||||
<input type="radio" bind:group={range} value={AddedRange.Month} />
|
||||
Month
|
||||
|
|
|
@ -27,13 +27,15 @@
|
|||
let searchRange: SearchRange = SearchRange.Deck;
|
||||
let range: GraphRange = GraphRange.Month;
|
||||
let days: number = 31;
|
||||
let refreshing = false;
|
||||
|
||||
let search = "deck:current";
|
||||
let displayedSearch = search;
|
||||
|
||||
const refresh = async () => {
|
||||
console.log(`search is ${search}`);
|
||||
refreshing = true;
|
||||
sourceData = await getGraphData(search, days);
|
||||
refreshing = false;
|
||||
};
|
||||
|
||||
$: {
|
||||
|
@ -79,38 +81,45 @@
|
|||
</script>
|
||||
|
||||
<div class="range-box">
|
||||
<label>
|
||||
<input type="radio" bind:group={searchRange} value={SearchRange.Deck} />
|
||||
Deck
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" bind:group={searchRange} value={SearchRange.Collection} />
|
||||
Collection
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" bind:group={searchRange} value={SearchRange.Custom} />
|
||||
Custom
|
||||
</label>
|
||||
<div class="spin {refreshing ? 'active' : ''}">◐</div>
|
||||
|
||||
<input type="text" bind:value={displayedSearch} on:keyup={searchKeyUp} />
|
||||
<div class="range-box-inner">
|
||||
<label>
|
||||
<input type="radio" bind:group={searchRange} value={SearchRange.Deck} />
|
||||
Deck
|
||||
</label>
|
||||
<label>
|
||||
<input
|
||||
type="radio"
|
||||
bind:group={searchRange}
|
||||
value={SearchRange.Collection} />
|
||||
Collection
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" bind:group={searchRange} value={SearchRange.Custom} />
|
||||
Custom
|
||||
</label>
|
||||
|
||||
<input type="text" bind:value={displayedSearch} on:keyup={searchKeyUp} />
|
||||
</div>
|
||||
|
||||
<div class="range-box-inner">
|
||||
Review history:
|
||||
<label>
|
||||
<input type="radio" bind:group={range} value={GraphRange.Month} />
|
||||
Month
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" bind:group={range} value={GraphRange.Year} />
|
||||
Year
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" bind:group={range} value={GraphRange.All} />
|
||||
All
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="range-box">
|
||||
Review history:
|
||||
<label>
|
||||
<input type="radio" bind:group={range} value={GraphRange.Month} />
|
||||
Month
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" bind:group={range} value={GraphRange.Year} />
|
||||
Year
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" bind:group={range} value={GraphRange.All} />
|
||||
All
|
||||
</label>
|
||||
</div>
|
||||
<div class="range-box-pad" />
|
||||
|
||||
<TodayStats {sourceData} />
|
||||
<CardCounts {sourceData} />
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<div class="graph intervals">
|
||||
<h1>Review Intervals</h1>
|
||||
|
||||
<div class="range-box">
|
||||
<div class="range-box-inner">
|
||||
<label>
|
||||
<input type="radio" bind:group={range} value={IntervalRange.Month} />
|
||||
Month
|
||||
|
|
|
@ -100,8 +100,6 @@ export function renderButtons(
|
|||
}),
|
||||
];
|
||||
|
||||
console.log(data);
|
||||
|
||||
const yMax = Math.max(...data.map((d) => d.count));
|
||||
|
||||
const svg = select(svgElem);
|
||||
|
|
|
@ -47,6 +47,19 @@
|
|||
}
|
||||
|
||||
.range-box {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 4em;
|
||||
background: white;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
.range-box-pad {
|
||||
height: 4em;
|
||||
}
|
||||
|
||||
.range-box-inner {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
@ -71,3 +84,27 @@
|
|||
fill: none;
|
||||
pointer-events: all;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.spin {
|
||||
position: absolute;
|
||||
animation: spin;
|
||||
animation-duration: 1s;
|
||||
animation-iteration-count: infinite;
|
||||
display: inline-block;
|
||||
font-size: 2em;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.spin.active {
|
||||
opacity: 1;
|
||||
transition: opacity 1s;
|
||||
}
|
||||
|
|
|
@ -63,8 +63,6 @@ export function renderHours(
|
|||
): void {
|
||||
const data = sourceData.hours;
|
||||
|
||||
console.log(data);
|
||||
|
||||
const yMax = Math.max(...data.map((d) => d.totalCount));
|
||||
|
||||
const svg = select(svgElem);
|
||||
|
|
Loading…
Reference in a new issue