Skip to content

Commit d57332b

Browse files
author
Kuniwak
committed
Implement extra-stage
1 parent facabcb commit d57332b

File tree

4 files changed

+63
-0
lines changed

4 files changed

+63
-0
lines changed

test/stage1/analytics.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
(function() {
2+
'use strict';
3+
var XFlyingSushiMonsterProto = Object.create(HTMLDivElement.prototype);
4+
XFlyingSushiMonsterProto.createdCallback = function() {
5+
this.textContent = '\uD83C\uDF63';
6+
var style = this.style;
7+
8+
style.position = 'absolute';
9+
style.fontSize = '100px';
10+
style.webkitAnimationName = 'moveHorizontal';
11+
style.webkitAnimationDuration = '1s';
12+
style.webkitAnimationIterationCount = 'infinite';
13+
style.webkitAnimationDirection = 'alternate-reverse';
14+
style.webkitAnimationFillMode = 'forwards';
15+
};
16+
17+
var XFlyingSushiMonster = document.registerElement('x-flying-sushi-monster', {
18+
prototype: XFlyingSushiMonsterProto
19+
});
20+
21+
var target = document.createElement('div');
22+
target.style.position = 'relative';
23+
target.style.height = '100px';
24+
target.appendChild(new XFlyingSushiMonster());
25+
26+
var targetContainer = document.createElement('div');
27+
targetContainer.appendChild(target);
28+
document.body.appendChild(targetContainer);
29+
})();

test/stage1/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
expect = chai.expect;
4141
</script>
4242
<script>mocha.setup('bdd')</script>
43+
<script src="analytics.js"></script>
4344
<script src="tests.js"></script>
4445
<script>
4546
if (window.mochaPhantomJS) { mochaPhantomJS.run(); }

test/stage1/style.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,24 @@
7777
.js-training [data-js-training="darkorchid"] {
7878
background-color: darkorchid;
7979
}
80+
81+
@-webkit-keyframes moveHorizontal {
82+
from {
83+
left: -20%;
84+
}
85+
86+
to {
87+
left: 110%;
88+
}
89+
}
90+
91+
92+
@-moz-keyframes moveHorizontal {
93+
from {
94+
left: -20%;
95+
}
96+
97+
to {
98+
left: 110%;
99+
}
100+
}

test/stage1/tests.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,18 @@ describe('ステージ1(意図した DOM 要素を取得できるようにな
323323
secret('qnexbepuvq'));
324324
});
325325
});
326+
327+
328+
describe('エクストラステージ', function(){
329+
it('動いている寿司要素を取得する', function(){
330+
331+
// 'change me!' を書き換えてください。
332+
var element = 'change me!';
333+
334+
expect(element).to.have.deep.property(
335+
secret('grkgPbagrag'), '\uD83C\uDF63');
336+
});
337+
});
326338
});
327339

328340

0 commit comments

Comments
 (0)