Add: print sample - graph, ranking
This commit is contained in:
@@ -3,7 +3,12 @@
|
||||
|
||||
class HistoryBoard {
|
||||
|
||||
constructor() {
|
||||
constructor(type) {
|
||||
if(type === RecordBoard.TYPE_SAMPLE) {
|
||||
this.printSample();
|
||||
return;
|
||||
}
|
||||
|
||||
this.dbConnectManager = new DBConnectManager();
|
||||
|
||||
let arrayTabStyle = { font: "20px Arial", fill: "#fff", align: "left", tabs: [ 40, 80, 120 ] };
|
||||
@@ -32,6 +37,12 @@ class HistoryBoard {
|
||||
);
|
||||
}
|
||||
|
||||
calcDate(daysBefore) {
|
||||
let date = new Date();
|
||||
date.setDate(date.getDate() - daysBefore);
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
printRecord(index, date, bestRecord) {
|
||||
if(sessionStorageManager.playingAppName.indexOf("typing") < 0)
|
||||
@@ -77,4 +88,14 @@ class HistoryBoard {
|
||||
.setTextBounds(0, 0, 80, 60)
|
||||
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
}
|
||||
|
||||
printSample() {
|
||||
this.printRecord(0, DateUtil.getYYYYMMDD(this.calcDate(2)), 1270);
|
||||
this.printRecord(1, DateUtil.getYYYYMMDD(this.calcDate(3)), 1150);
|
||||
this.printRecord(2, DateUtil.getYYYYMMDD(this.calcDate(5)), 1080);
|
||||
this.printRecord(3, DateUtil.getYYYYMMDD(this.calcDate(7)), 960);
|
||||
this.printRecord(4, DateUtil.getYYYYMMDD(this.calcDate(10)), 1020);
|
||||
this.printRecord(5, DateUtil.getYYYYMMDD(this.calcDate(15)), 840);
|
||||
this.printRecord(6, DateUtil.getYYYYMMDD(this.calcDate(20)), 760);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user