separate variable constants

This commit is contained in:
Harvey committed 2022-04-27 10:42:07 +08:00
1 parent 57a14f63ac
commit fc3abd7d1d
20 files changed
+143 -80

No files matched your search

+6 -4
View File
@@ -22,20 +22,22 @@ export default class Control extends Component {
const {
option,
constructor,
events: { proxy },
template: { $player },
} = art;
this.mouseMoveTime = Date.now();
let activeTime = Date.now();
art.on('mousemove', () => {
proxy($player, ['click', 'mousemove', 'touchstart', 'touchmove'], () => {
this.show = true;
removeClass($player, 'art-hide-cursor');
addClass($player, 'art-hover');
this.mouseMoveTime = Date.now();
activeTime = Date.now();
});
art.on('video:timeupdate', () => {
if (art.playing && this.show && Date.now() - this.mouseMoveTime >= 3000) {
if (art.playing && this.show && Date.now() - activeTime >= constructor.CONTROL_HIDE_TIME) {
this.show = false;
addClass($player, 'art-hide-cursor');
removeClass($player, 'art-hover');