From b07e1577b075c1c0fb332fe9e5f67c1ca1bd0caa Mon Sep 17 00:00:00 2001 From: KyleBing Date: Thu, 29 Sep 2022 22:26:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=A9=BA=E5=9B=BE=E8=A1=A8=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ img/reset.png | Bin 0 -> 5531 bytes index.html | 12 +++++++++--- js/class/Engine.js | 5 +++++ js/class/Score.js | 24 +++++++++++++++++++++++ scss/mixin/_score.scss | 27 +++++++++++++++++++++++++- scss/typepad.css | 43 ++++++++++++++++++++++++++++++++++++++++- 7 files changed, 108 insertions(+), 5 deletions(-) create mode 100644 img/reset.png diff --git a/CHANGELOG.md b/CHANGELOG.md index 4647b80..7487f51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ### v2.65 `2022-09-26` - 状图展示:击键、码长、速度 +- fix 记录重复数错误 +- 清空图表记录 ### v2.64 `2022-09-23` - 展示当前跟打类型的统计数据 diff --git a/img/reset.png b/img/reset.png new file mode 100644 index 0000000000000000000000000000000000000000..af386c5722559821ee40e62b603654101496b75e GIT binary patch literal 5531 zcma)gS5y;FkTxYK5=!Vu6DcAAlopWQn;2RGgf5{7p@WD5Qk5zlLT{lHilKwjBm#o; zj)?T$1wrcK|L@s7XCL zI+ysr<9|i55Y!Edo>Egq5&oKR#~kPeAHO^2>up4n5N@l+u2284#Na>^P+Enteyds6K(((;tIzE(!7`9wmF&e z4-m)p+17i zOyHu*WpKwlow-r$h?hBx&ddCX*{9wJpQl+PT=Nf+Bt)XI$FDK5A-dh%W#tdE8B`C< zCx&!K6JA@eOEVI7gZP;;C5l2E-RcknoS-(SS-ey zlh~FO7Px~Ssg>Qf1Kkhnhd?0JT^{VQXAU;fIM9U+EpVpo=OEFWFY%;P+5%5@ovxqi zz0?#?A1P_mZ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&<+y^a7?s;jQfSuEl;Fy55MS=NG!*lK4L>ivL4zBv+rm Y{=>*R^YKPF{il#>s%ooLDm@SW4>(|M&;S4c literal 0 HcmV?d00001 diff --git a/index.html b/index.html index 49aabed..d147b92 100755 --- a/index.html +++ b/index.html @@ -199,7 +199,9 @@
-
击键
+
击键 +
reset
+
1
2
@@ -218,7 +220,9 @@
-
速度 × 10
+
速度 × 10 +
reset
+
3
6
@@ -239,7 +243,9 @@
-
码长
+
码长 +
reset
+
1
2
diff --git a/js/class/Engine.js b/js/class/Engine.js index 4c84c72..eec4af4 100755 --- a/js/class/Engine.js +++ b/js/class/Engine.js @@ -1051,7 +1051,12 @@ define( $(`.score-statistics-item.speed.level-${suffix} .process`).style.height = `${speed * HEIGHT_BAR / speedMax}px` } }) + } + // 清除某种类似文章的 某项数据 + clearScoreOf(typeOfScore){ + this.score.clearScoreFor(this.config.articleType, typeOfScore) + this.updateInfo() } } diff --git a/js/class/Score.js b/js/class/Score.js index ed32b44..a4c7fe4 100644 --- a/js/class/Score.js +++ b/js/class/Score.js @@ -95,6 +95,30 @@ define(['Article', 'ArticleType'],function (Article, ArticleType) { } } + // 清除某种类似文章的 某项数据 + clearScoreFor(articleType, typeOfScore){ + switch (typeOfScore){ + case 'HitRate': + for (let i = 0; i < 15; i++) { + this[articleType]['hitRate' + (i + 1)] = 0 + } + this.save() + break; + case 'Speed': + for (let i = 0; i < 14; i++) { + this[articleType]['speed' + String((i + 1) * 30)] = 0 + } + this.save() + break; + case 'CodeLength': + for (let i = 0; i < 10; i++) { + this[articleType]['codeLength' + (i + 1)] = 0 + } + this.save() + break; + } + } + save(){ localStorage.setItem(SCORE_NAME, JSON.stringify(this)); } diff --git a/scss/mixin/_score.scss b/scss/mixin/_score.scss index 2501ada..daae44f 100644 --- a/scss/mixin/_score.scss +++ b/scss/mixin/_score.scss @@ -24,7 +24,7 @@ .score{ color: $text-main; font-family: 'JetBrainsMonoOnlyCharacter'; - font-size: 14px; + font-size: 13px; } .desc{ color: $text-comment; @@ -35,7 +35,32 @@ .score-statistics-container{ .title{ + cursor: pointer; + width: 100%; margin-bottom: 5px; + display: flex; + justify-content: flex-start; + .btn-img{ + @include border-radius(20px); + opacity: 0; + @include transition(all 0.3s); + cursor: pointer; + width: 15px; + img{ + display: block; + width: 100%; + } + &:active{ + @include transform(rotate(-1080deg) !important); + } + } + &:hover{ + .btn-img{ + opacity: 1; + @include transition(all 0.3s); + @include transform(rotate(-360deg)); + } + } } .score-statistics-list{ display: flex; diff --git a/scss/typepad.css b/scss/typepad.css index 295ed67..8cffb7e 100755 --- a/scss/typepad.css +++ b/scss/typepad.css @@ -1333,7 +1333,7 @@ body.black .text-black { .score-info-item .score { color: #333; font-family: "JetBrainsMonoOnlyCharacter"; - font-size: 14px; + font-size: 13px; } .score-info-item .desc { color: #999; @@ -1342,7 +1342,48 @@ body.black .text-black { } .score-statistics-container .title { + cursor: pointer; + width: 100%; margin-bottom: 5px; + display: flex; + justify-content: flex-start; +} +.score-statistics-container .title .btn-img { + -webkit-border-radius: 20px; + -moz-border-radius: 20px; + border-radius: 20px; + opacity: 0; + -webkit-transition: all 0.3s; + -moz-transition: all 0.3s; + -ms-transition: all 0.3s; + -o-transition: all 0.3s; + transition: all 0.3s; + cursor: pointer; + width: 15px; +} +.score-statistics-container .title .btn-img img { + display: block; + width: 100%; +} +.score-statistics-container .title .btn-img:active { + -webkit-transform: rotate(-1080deg) !important; + -moz-transform: rotate(-1080deg) !important; + -ms-transform: rotate(-1080deg) !important; + -o-transform: rotate(-1080deg) !important; + transform: rotate(-1080deg) !important; +} +.score-statistics-container .title:hover .btn-img { + opacity: 1; + -webkit-transition: all 0.3s; + -moz-transition: all 0.3s; + -ms-transition: all 0.3s; + -o-transition: all 0.3s; + transition: all 0.3s; + -webkit-transform: rotate(-360deg); + -moz-transform: rotate(-360deg); + -ms-transform: rotate(-360deg); + -o-transform: rotate(-360deg); + transform: rotate(-360deg); } .score-statistics-container .score-statistics-list { display: flex;