Skip to content

Commit fc06a4e

Browse files
author
Weera Wu
committed
Use enums for touch times
1 parent 6155067 commit fc06a4e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
// setup
133133
var Direction = {LEFT: 0, RIGHT: 1};
134134
var Theme = {BLACK: 0, WHITE: 1, GRADIENT: 2, SHOWROOM: 3};
135+
var Time = {TAP: 250, HOLD: 500};
135136

136137
var Fullscreen = {
137138
isEnabled: function() {
@@ -292,9 +293,9 @@
292293
return;
293294
}
294295
var time = state.touchTime();
295-
if (time > 500) {
296+
if (time > Time.HOLD) {
296297
state.nextTheme();
297-
} else if (time > 250) {
298+
} else if (time > Time.TAP) {
298299
} else if (state.touch.direction === Direction.LEFT) {
299300
this.play(state.backward);
300301
m.redraw();

0 commit comments

Comments
 (0)