summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2020-03-22 18:18:34 +0900
committersyuilo <syuilotan@yahoo.co.jp>2020-03-22 18:18:34 +0900
commit92f47cc9cbb2aaa021f2c9925f3cbe283a20b84a (patch)
tree9266b8ca3dc384e6cb7fbc8b640e707a45626505 /src/client
parentNew Crowdin translations (#6175) (diff)
downloadsharkey-92f47cc9cbb2aaa021f2c9925f3cbe283a20b84a.tar.gz
sharkey-92f47cc9cbb2aaa021f2c9925f3cbe283a20b84a.tar.bz2
sharkey-92f47cc9cbb2aaa021f2c9925f3cbe283a20b84a.zip
Remove smooth option to improve performance
Diffstat (limited to 'src/client')
-rw-r--r--src/client/components/analog-clock.vue18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/client/components/analog-clock.vue b/src/client/components/analog-clock.vue
index b689266780..81c6598c7a 100644
--- a/src/client/components/analog-clock.vue
+++ b/src/client/components/analog-clock.vue
@@ -38,13 +38,6 @@ import Vue from 'vue';
import * as tinycolor from 'tinycolor2';
export default Vue.extend({
- props: {
- smooth: {
- type: Boolean,
- default: false
- }
- },
-
data() {
return {
now: new Date(),
@@ -83,9 +76,6 @@ export default Vue.extend({
return tinycolor(this.computedStyle.getPropertyValue('--accent')).toHexString();
},
- ms(): number {
- return this.now.getMilliseconds() * (this.smooth ? 1 : 0);
- },
s(): number {
return this.now.getSeconds();
},
@@ -97,13 +87,13 @@ export default Vue.extend({
},
hAngle(): number {
- return Math.PI * (this.h % 12 + (this.m + (this.s + this.ms / 1000) / 60) / 60) / 6;
+ return Math.PI * (this.h % 12 + (this.m + this.s / 60) / 60) / 6;
},
mAngle(): number {
- return Math.PI * (this.m + (this.s + this.ms / 1000) / 60) / 30;
+ return Math.PI * (this.m + this.s / 60) / 30;
},
sAngle(): number {
- return Math.PI * (this.s + this.ms / 1000) / 30;
+ return Math.PI * this.s / 30;
},
graduations(): any {
@@ -121,7 +111,7 @@ export default Vue.extend({
const update = () => {
if (this.enabled) {
this.tick();
- requestAnimationFrame(update);
+ setTimeout(update, 1000);
}
};
update();