-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathspot.js
More file actions
24 lines (20 loc) · 809 Bytes
/
spot.js
File metadata and controls
24 lines (20 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
(function() {
'use strict';
var canvas = document.getElementById('canvas');
var engine = new Shape.Engine(canvas);
var promise = new Promise((resolve) => { resolve(); });
document.getElementById('go').addEventListener('click', start);
function start() {
document.getElementById('go').removeEventListener('click', start);
promise.then(() => engine.toText('L'))
.then(() => engine.shake())
.then(() => engine.toText('O'))
.then(() => engine.shake())
.then(() => engine.toText('V'))
.then(() => engine.shake())
.then(() => engine.toText('E'))
.then(() => engine.shake())
.then(() => engine.clear())
.then(() => document.getElementById('go').addEventListener('click', start));
}
})();