Skip to content
This repository was archived by the owner on Apr 20, 2018. It is now read-only.

Commit 43961f5

Browse files
Initial animation for fadeout
1 parent 8cd4574 commit 43961f5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

examples/KonamiCode/konamicode.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44
var opacity = 1;
55
element.style.opacity = opacity;
66

7-
var subscription = Rx.Scheduler.timeout.schedulePeriodic(100, function () {
8-
opacity === 0 && subscription.dispose();
7+
var subscription = Rx.Scheduler.timeout.scheduleRecursiveWithRelative(100, function (self) {
8+
if (opacity === 0) {
9+
subscription.dispose();
10+
return;
11+
}
12+
913
opacity -= 0.1;
1014
element.style.opacity = opacity;
15+
self(100);
1116
});
1217
}
1318

@@ -19,7 +24,7 @@
1924

2025
Rx.DOM.keyup(document)
2126
.pluck('keyCode')
22-
.bufferWithCount(10, 10)
27+
.bufferWithCount(10, 1)
2328
.filter(function (data) { return data.toString() === codes.toString(); })
2429
.subscribe(function () {
2530
result.innerHTML = 'KONAMI!';

0 commit comments

Comments
 (0)