Projects // Tetrjs

Play Tetrjs

Play Tetrjs

About Tetrjs

Tetrjs is a Tetris clone written in JavaScript. Tetrjs is compatible with most modern web browsers.

Tetrjs is Open Source

Tetrjs is freely available under the MIT open source license. Check out the Tetrjs GitHub page to clone the source code and embed Tetrjs in your own project.

Tetrjs is Easy To Embed

Add this to the header:

<!-- Bootstrap for Better Buttons and Icons -->
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

<!-- Tetrjs CSS -->
<link rel="stylesheet" type="text/css" href="tetrjs.css">

Add a container where Tetrjs will appear:

<!-- Put this container where you want Tetrjs to appear -->
<div id="tetrjs-wrapper"></div>

Add this to the footer (or directly below the container):

<!-- Required Javascript Libraries -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="https://twitter.github.com/hogan.js/builds/3.0.1/hogan-3.0.1.js"></script>

<!-- Tetrjs -->
<script src="dist/tetrjs.min.js"></script>

<script>
    $(function(){
        // Create an instance of Tetrjs
        var tetrjs = new Tetrjs();
        // Run Tetrjs
        tetrjs.run('tetrjs-wrapper');
    });
</script>