added estimated total words typed

This commit is contained in:
Miodec 2022-11-10 15:12:41 +01:00
parent f72c3a6702
commit 96229f0144
4 changed files with 29 additions and 0 deletions

View file

@ -120,6 +120,15 @@
}
.group {
&.estimatedWordsTyped {
display: flex;
align-items: center;
justify-content: center;
.title {
margin-right: 1rem;
}
}
&.noDataError {
margin: 20rem 0;
text-align: center;

View file

@ -499,6 +499,12 @@
}
}
}
.group.estimatedWordsTyped {
flex-direction: column;
.title {
margin-right: unset;
}
}
}
.badge::after,
.badge::before {

View file

@ -273,6 +273,8 @@ function fillContent(): void {
max: 0,
};
let totalEstimatedWords = 0;
// let totalSeconds = 0;
totalSecondsFiltered = 0;
@ -510,6 +512,10 @@ function fillContent(): void {
//filters done
//=======================================
totalEstimatedWords += Math.round(
(result.wpm / 60) * result.testDuration
);
const resultDate = new Date(result.timestamp);
resultDate.setSeconds(0);
resultDate.setMinutes(0);
@ -662,6 +668,8 @@ function fillContent(): void {
loadMoreLines();
////////
console.log(totalEstimatedWords);
const activityChartData_amount: MonkeyTypes.ActivityChartDataPoint[] = [];
const activityChartData_time: MonkeyTypes.ActivityChartDataPoint[] = [];
const activityChartData_avgWpm: MonkeyTypes.ActivityChartDataPoint[] = [];
@ -960,6 +968,8 @@ function fillContent(): void {
} ${Config.alwaysShowCPM ? "cpm" : "wpm"}.`
);
$(".pageAccount .estimatedWordsTyped .val").text(totalEstimatedWords);
applyHistorySmoothing();
ChartController.accountActivity.updateColors();
LoadingPage.updateBar(100, true);

View file

@ -459,6 +459,10 @@
<canvas id="accountActivityChart"></canvas>
</div>
</div>
<div class="group estimatedWordsTyped">
<div class="title">estimated words typed</div>
<div class="val">-</div>
</div>
<div class="triplegroup stats">
<div class="group testsStarted">
<div class="title">tests started</div>