-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_module.html
74 lines (70 loc) · 1.8 KB
/
main_module.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html>
<head>
<style>
body, html { margin:0; padding: 0; overflow:hidden; font-family:Arial; font-size:20px }
#cr-stage { border:2px solid black; margin:5px auto}
</style>
</head>
<body>
<script src="http://cdn.crafty-modules.com/crafty-DEBUG.js"></script>
<script>
window.onload = function () {
Crafty.init(400, 336);
Crafty.scene("main", function() {
Crafty.modules(
'http://cdn.craftycomponents.com'
, { ClickFocus: "release" }
, function() {
var e1=Crafty.e("2D, DOM, Color, ClickFocus")
.attr({
x: 50
, y: 50
, w: 50
, h: 50
})
.color("red")
.bind('Focus', function() {
this.color("yellow")
})
.bind('Blur', function() {
this.color("red")
})
;
var e2=Crafty.e("2D, DOM, Color, ClickFocus")
.attr({
x: 250
, y: 50
, w: 50
, h: 50
})
.color("red")
.bind('Focus', function() {
this.color("blue")
})
.bind('Blur', function() {
this.color("red")
})
;
var e3=Crafty.e("2D, DOM, Color, ClickFocus")
.attr({
x: 250
, y: 250
, w: 50
, h: 50
})
.color("red")
.bind('Focus', function() {
this.color("cyan")
})
.bind('Blur', function() {
this.color("red")
})
;
});
});
Crafty.scene("main");
};
</script>
</body>
</html>