-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
155 lines (124 loc) · 4.41 KB
/
index.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>DESIGN-R | A NEXT GENERATION WEB DESIGN STUDIO</title>
<meta name="description" content="DESIGN-R" />
<meta name="keywords" content="js, jquery, game, plugin, html5, tetris" />
<meta name="robots" content="INDEX, FOLLOW" />
<!-- Facebook Stuff -->
<meta property="og:type" content="website" />
<meta property="og:site_name" content="DESIGN-R" />
<meta property="og:title" content="DESIGN-R" />
<meta property="og:description" content="A NEXT GENERATION DESIGN STUDIO" />
<meta property="og:image" content="http://design-r.github.io/assets/images/social-card.png" />
<meta property="og:url" content="http://design-r.github.io/" />
<!-- Twitter Stuff -->
<meta property="twitter:card" content="summary" />
<meta property="twitter:site" content="@zuluhosting" />
<meta property="twitter:title" content="Design-r" />
<meta property="twitter:description" content="Coming soon." />
<meta property="twitter:image" content="http://design-r.github.io/assets/images/social-card.png" />
<meta property="twitter:url" content="http://design-r:width.github.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui" />
<link rel="shortcut icon" href="assets/images/favicon.png">
<link href='http://fonts.googleapis.com/css?family=Play:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="assets/css/style.css">
<link rel="stylesheet" href="src/blockrain.css">
</head>
<body>
<section id="examples">
<header>
<h1>Site coming soon!</h1>
</header>
<article id="example-slider">
<div class="example">
<!--<div class="theme">theme: <strong>"vim"</strong></div>-->
<div class="instructions">
Use only arrows
<div class="keyboard">
<div class="key key-up"></div>
<div class="key key-left"></div>
<div class="key key-down"></div>
<div class="key key-right"></div>
</div>
</div>
<div class="game" id="tetris-demo"></div>
</div>
<!--<div class="buttons">
<a href="" class="btn btn-prev">Previous</a>
<a href="" class="btn btn-next">Next</a>
</div>-->
</article>
</section>
<script src="assets/js/jquery-1.11.1.min.js"></script>
<script src="src/blockrain.jquery.libs.js"></script>
<script src="src/blockrain.jquery.src.js"></script>
<script src="src/blockrain.jquery.themes.js"></script>
<script>
var $cover = $('#cover-tetris').blockrain({
autoplay: true,
autoplayRestart: true,
speed: 100,
autoBlockWidth: true,
autoBlockSize: 25,
theme: 'candy'
});
var versusSpeed = 100;
var $versus1 = $('#tetris-versus-1 .game').blockrain({
autoplay: true,
autoplayRestart: true,
speed: versusSpeed,
onGameOver: function() {
$versus1.blockrain('restart');
$versus2.blockrain('restart');
var $score = $versus2.parent().find('.score');
$score.text( parseInt($score.text()) + 1 );
}
});
var $versus2 = $('#tetris-versus-2 .game').blockrain({
autoplay: true,
autoplayRestart: true,
speed: versusSpeed,
onGameOver: function() {
$versus1.blockrain('restart');
$versus2.blockrain('restart');
var $score = $versus1.parent().find('.score');
$score.text( parseInt($score.text()) + 1 );
}
});
var $demo = $('#tetris-demo').blockrain({
speed: 20,
theme: 'vim',
onStart: function() {
ga( 'send', 'event', 'tetris', 'started');
},
onLine: function() {
ga( 'send', 'event', 'tetris', 'line');
},
onGameOver: function(score){
ga( 'send', 'event', 'tetris', 'over', score);
}
});
$('#example-slider').find('.btn-next').click(function(event){
event.preventDefault();
switchDemoTheme(true);
});
$('#example-slider').find('.btn-prev').click(function(event){
event.preventDefault();
switchDemoTheme(false);
});
function switchDemoTheme(next) {
var themes = Object.keys(BlockrainThemes);
var currentTheme = $demo.blockrain('theme');
var currentIx = themes.indexOf(currentTheme);
if( next ) { currentIx++; }
else { currentIx--; }
if( currentIx >= themes.length ){ currentIx = 0; }
if( currentIx < 0 ){ currentIx = themes.length-1; }
$demo.blockrain('theme', themes[currentIx]);
$('#example-slider .theme strong').text( '"'+themes[currentIx]+'"' );
}
</script>
</body>
</html>