Skip to content

Commit 9965a16

Browse files
committedJan 7, 2015
Rought draft of the plugin with a few demos
1 parent 899159d commit 9965a16

14 files changed

+2318
-0
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

‎Copyright

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*!
2+
* Tetris.js <%= version %>
3+
* jQuery plugin that lets you put a playable (and configurable) tetris in your site or just leave it in auto in the background.
4+
* http://aerolab.github.io/tetris.js/
5+
*
6+
* Copyright (c) 2015 Aerolab <hey@aerolab.co>
7+
*
8+
* Released under the MIT license
9+
* http://aerolab.github.io/tetris.js/LICENSE.txt
10+
*/
11+

‎LICENSE ‎LICENSE.txt

File renamed without changes.

‎assets/css/images/hipster-bg.jpg

113 KB
Loading

‎assets/css/normalize.css

+428
Large diffs are not rendered by default.

‎assets/css/styles.css

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
html, body {
2+
background: white;
3+
padding: 0;
4+
margin: 0;
5+
font-family: "Roboto", "Arial", sans-serif;
6+
line-height: 160%;
7+
font-size: 16px;
8+
color: #303030;
9+
}
10+
11+
header {
12+
position: relative;
13+
min-height: 500px;
14+
}
15+
header .welcome {
16+
position: relative;
17+
z-index: 10;
18+
text-align: center;
19+
padding: 150px 0;
20+
color: #303030;
21+
}
22+
header h1 {
23+
font-size: 60px;
24+
}
25+
26+
#cover-tetris {
27+
position: absolute;
28+
top: 0;
29+
left: 0;
30+
right: 0;
31+
bottom: 0;
32+
z-index: 0;
33+
}
34+
35+
36+
37+
section.versus {
38+
text-align: center;
39+
padding-top: 100px;
40+
}
41+
42+
section.versus .game {
43+
display: inline-block;
44+
margin: 0px 20px;
45+
width: 200px;
46+
height: 500px;
47+
}
48+
49+
50+
section.hipster {
51+
text-align: center;
52+
padding-top: 100px;
53+
}
54+
55+
section.hipster .game {
56+
display: inline-block;
57+
margin: 0px 20px;
58+
width: 500px;
59+
height: 500px;
60+
background: url(images/hipster-bg.jpg) no-repeat 50% 50%;
61+
background-size: cover;
62+
}
63+
section.hipster .game canvas {
64+
opacity: 0.8;
65+
}

‎assets/js/jquery-1.11.1.min.js

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎bower.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "tetris",
3+
"version": "0.1.0",
4+
"description": "Add a game of tetris to your site",
5+
"main": "tetris.jquery.js",
6+
"license": "MIT",
7+
"authors": [
8+
"Aerolab <hey@aerolab.co>"
9+
],
10+
"keywords": [
11+
"jquery",
12+
"ui",
13+
"scrolling",
14+
"header",
15+
"midnight"
16+
],
17+
"ignore": [
18+
"assets",
19+
"index.html",
20+
"AUTHORS.txt",
21+
"gulpfile.js",
22+
"package.json"
23+
]
24+
}

‎gulpfile.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
var gulp = require('gulp')
2+
, fs = require('fs')
3+
, uglify = require("gulp-uglify")
4+
, concat = require("gulp-concat")
5+
, header = require("gulp-header");
6+
7+
var getVersion = function () {
8+
info = require("./package.json");
9+
return info.version;
10+
};
11+
var getCopyright = function () {
12+
return fs.readFileSync('Copyright');
13+
};
14+
15+
gulp.task('build', function () {
16+
gulp.src('./tetris.jquery.src.js')
17+
.pipe(header(getCopyright(), {version: getVersion()}))
18+
.pipe(concat('tetris.jquery.js'))
19+
.pipe(gulp.dest('./'))
20+
.pipe(uglify({preserveComments:'some'}))
21+
.pipe(concat('tetris.jquery.min.js'))
22+
.pipe(gulp.dest('./'));
23+
});
24+
25+
gulp.task('default', ['build']);

‎index.html

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Tetris.js - A tetris game in HTML5 + Javascript (with autoplay!)</title>
6+
7+
<link href='http://fonts.googleapis.com/css?family=Roboto:500' rel='stylesheet' type='text/css'>
8+
<link rel="stylesheet" href="assets/css/normalize.css">
9+
<link rel="stylesheet" href="assets/css/styles.css">
10+
11+
</head>
12+
<body>
13+
14+
<header>
15+
16+
<div class="welcome">
17+
<h1>Tetris.js</h1>
18+
<p>Play tetris on your site</p>
19+
</div>
20+
21+
<div id="cover-tetris"></div>
22+
23+
</header>
24+
25+
26+
<section class="versus">
27+
28+
<h1>Pit two bots against each other</h1>
29+
30+
<div class="game" id="tetris-versus-1">
31+
32+
</div>
33+
34+
<div class="game" id="tetris-versus-2">
35+
36+
</div>
37+
38+
</section>
39+
40+
41+
<section class="hipster">
42+
43+
<h1>Use a background</h1>
44+
45+
<div class="game" id="tetris-hipster">
46+
47+
</div>
48+
49+
</section>
50+
51+
52+
53+
<script src="assets/js/jquery-1.11.1.min.js"></script>
54+
<script src="tetris.jquery.src.js"></script>
55+
<script>
56+
$('#cover-tetris').tetris({
57+
autoplay: true,
58+
speed: 10,
59+
autoBlockWidth: true,
60+
autoBlockSize: 25
61+
});
62+
63+
$('#tetris-versus-1, #tetris-versus-2').tetris({
64+
autoplay: true,
65+
speed: 10
66+
});
67+
68+
$('#tetris-hipster').tetris({
69+
autoplay: true,
70+
speed: 10,
71+
autoBlockWidth: true,
72+
autoBlockSize: 30,
73+
theme: {
74+
primary: '#000000',
75+
secondary: '#000000'
76+
}
77+
});
78+
</script>
79+
80+
</body>
81+
</html>

‎package.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "Tetris.JS",
3+
"version": "0.1.0",
4+
"description": "Add a game of tetris to your site",
5+
"devDependencies": {
6+
"gulp": "^3.8.8",
7+
"gulp-concat": "^2.4.1",
8+
"gulp-header": "^1.1.1",
9+
"gulp-uglify": "^1.0.1"
10+
},
11+
"repository": {
12+
"type": "git",
13+
"url": "https://github.com/Aerolab/tetris.js"
14+
},
15+
"author": "Aerolab",
16+
"license": "MIT",
17+
"bugs": {
18+
"url": "https://github.com/Aerolab/tetris.js/issues"
19+
}
20+
}

‎tetris.jquery.js

+829
Large diffs are not rendered by default.

‎tetris.jquery.min.js

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tetris.jquery.src.js

+819
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.