Merge pull request #1919 from acid-chicken/master

Improve analog clock
This commit is contained in:
syuilo 2018-07-18 02:15:12 +09:00 committed by GitHub
commit 51c33989fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View file

@ -39,6 +39,10 @@ export default Vue.extend({
dark: {
type: Boolean,
default: false
},
smooth: {
type: Boolean,
default: false
}
},
@ -75,7 +79,7 @@ export default Vue.extend({
},
ms(): number {
return this.now.getMilliseconds();
return this.now.getMilliseconds() * this.smooth;
}
s(): number {
return this.now.getSeconds();

View file

@ -1,8 +1,8 @@
<template>
<div class="mkw-analog-clock">
<mk-widget-container :naked="props.naked" :show-header="false">
<mk-widget-container :naked="!(props.design % 2)" :show-header="false">
<div class="mkw-analog-clock--body">
<mk-analog-clock :dark="$store.state.device.darkmode"/>
<mk-analog-clock :dark="$store.state.device.darkmode" :smooth="!(props.design && ~props.design)"/>
</div>
</mk-widget-container>
</div>
@ -13,12 +13,13 @@ import define from '../../../common/define-widget';
export default define({
name: 'analog-clock',
props: () => ({
naked: false
design: -1
})
}).extend({
methods: {
func() {
this.props.naked = !this.props.naked;
if (++this.props.design > 2)
this.props.design = -1;
this.save();
}
}