Skip to content

Commit

Permalink
Merge branch 'dev' into gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertoGonzalez committed Sep 29, 2015
2 parents b370d1d + 8151d3b commit 3f1f74f
Show file tree
Hide file tree
Showing 28 changed files with 1,601 additions and 519 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,36 @@ Here's an example of a retro theme (vim) with a **custom texture**:
}
```


### Creating custom designs

You can now use **completely custom designs for each block**! You just link to one image for each block when creating your theme and the plugin takes care of the rest. You can even use lists of images if you want BlockRain to pick a random design for each block.

**Keep in mind that the images need to follow the exact same format (rotation and width/height ratio) as [the blocks that are bundled with the custom theme](https://github.com/Aerolab/blockrain.js/tree/gh-pages/assets/blocks/custom)**.

Fun fact: Now you can rotate the square!


```js
'custom': {
background: '#040304',
backgroundGrid: '#000',
complexBlocks: {
line: ['assets/blocks/custom/line.png', 'assets/blocks/custom/line.png'],
square: 'assets/blocks/custom/square.png',
arrow: 'assets/blocks/custom/arrow.png',
rightHook:'assets/blocks/custom/rightHook.png',
leftHook: 'assets/blocks/custom/leftHook.png',
rightZag: 'assets/blocks/custom/rightZag.png',
leftZag: 'assets/blocks/custom/leftZag.png'
}
}
```


### Available themes:

* custom **NEW!**
* candy
* modern
* retro
Expand Down
Binary file added assets/blocks/custom/arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/blocks/custom/leftHook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/blocks/custom/leftZag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/blocks/custom/line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/blocks/custom/rightHook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/blocks/custom/rightZag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/blocks/custom/square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "blockrain",
"version": "0.1.0",
"version": "0.2.0",
"description": "Add a game of tetris to your site",
"main": "dist/blockrain.jquery.min.js",
"dependencies": {
"jquery": "~1.11.3"
},
"repository": {
"type": "git",
"url": "git:https://github.com/Aerolab/blockrain.js.git"
Expand Down
78 changes: 78 additions & 0 deletions demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />

<title>Blockrain.js - A Tetris game in HTML5 + Javascript (with autoplay!)</title>

<meta name="description" content="Blockrain.js lets you embed the classic Tetris game on your website" />
<meta name="keywords" content="js, jquery, game, plugin, html5, tetris" />
<meta name="robots" content="INDEX, FOLLOW" />
<meta name="author" content="Aerolab" />

<!-- Facebook Stuff -->
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Blockrain.js" />
<meta property="og:title" content="Blockrain.js - a Tetris game in HTML5 + Javascript" />
<meta property="og:description" content="Blockrain.js lets you embed the classic Tetris game on your website" />
<meta property="og:image" content="http:https://aerolab.github.io/blockrain.js/assets/images/social-card.png" />
<meta property="og:url" content="http:https://aerolab.github.io/blockrain.js" />
<meta property="fb:app_id" content="344819049029949" />

<!-- Twitter Stuff -->
<meta property="twitter:card" content="summary" />
<meta property="twitter:site" content="@aerolab" />
<meta property="twitter:title" content="Blockrain.js - a Tetris game in HTML5 + Javascript" />
<meta property="twitter:description" content="Blockrain.js lets you embed the classic Tetris game on your website" />
<meta property="twitter:image" content="http:https://aerolab.github.io/blockrain.js/assets/images/social-card.png" />
<meta property="twitter:url" content="http:https://aerolab.github.io/blockrain.js" />

<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:https://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>Check out the demo</h1>
</header>

<article id="example-slider">
<div class="example">
<div class="game" id="tetris-demo"></div>
<div class="game" id="tetris-demo-2"></div>
</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 $demo = $('#tetris-demo').blockrain({
speed: 100,
theme: 'individual',
autoplay: true
});

var $demo2 = $('#tetris-demo-2').blockrain({
speed: 100,
theme: 'individual',
autoplay: true
});

</script>

</body>
</html>
28 changes: 28 additions & 0 deletions dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,36 @@ Here's an example of a retro theme (vim) with a **custom texture**:
}
```


### Creating custom designs

You can now use **completely custom designs for each block**! You just link to one image for each block when creating your theme and the plugin takes care of the rest. You can even use lists of images if you want BlockRain to pick a random design for each block.

**Keep in mind that the images need to follow the exact same format (rotation and width/height ratio) as [the blocks that are bundled with the custom theme](https://github.com/Aerolab/blockrain.js/tree/gh-pages/assets/blocks/custom)**.

Fun fact: Now you can rotate the square!


```js
'custom': {
background: '#040304',
backgroundGrid: '#000',
complexBlocks: {
line: ['assets/blocks/custom/line.png', 'assets/blocks/custom/line.png'],
square: 'assets/blocks/custom/square.png',
arrow: 'assets/blocks/custom/arrow.png',
rightHook:'assets/blocks/custom/rightHook.png',
leftHook: 'assets/blocks/custom/leftHook.png',
rightZag: 'assets/blocks/custom/rightZag.png',
leftZag: 'assets/blocks/custom/leftZag.png'
}
}
```


### Available themes:

* custom **NEW!**
* candy
* modern
* retro
Expand Down
Binary file added dist/assets/blocks/custom/arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/assets/blocks/custom/leftHook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/assets/blocks/custom/leftZag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/assets/blocks/custom/line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/assets/blocks/custom/rightHook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/assets/blocks/custom/rightZag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/assets/blocks/custom/square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions dist/blockrain.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,70 @@
line-height: 140%;
}

/* Touch Controls */
.blockrain-touch {
position: absolute;
width: 50px;
height: 50px;
display: block;
border-radius: 100%;
border: 1px solid white;
background: rgba(255,255,255,0.2);
z-index: 10;

-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;

line-height: 50px;
text-align: center;
}
.blockrain-touch:active {
background: rgba(255,255,255,0.3);
}

.blockrain-touch-left {
left: -60px;
bottom: 10px;
}
.blockrain-touch-left::after {
content: "<";
}
.blockrain-touch-right {
right: -60px;
bottom: 10px;
}
.blockrain-touch-right::after {
content: ">";
}

.blockrain-touch-rotate-left {
left: -60px;
bottom: 80px;
}
.blockrain-touch-rotate-left::after {
content: "<o";
}

.blockrain-touch-rotate-right {
right: -60px;
bottom: 80px;
}
.blockrain-touch-rotate-right::after {
content: "o>";
}

.blockrain-touch-drop {
left: 50%;
margin-left: -25px;
bottom: -60px;
}
.blockrain-touch-drop::after {
content: ".";
}

/* Buttons */
.blockrain-btn {
position: relative;
Expand Down
Loading

0 comments on commit 3f1f74f

Please sign in to comment.