Clone/download the project and then include the following scripts/snippets in your project:
<link rel="stylesheet" href="dist/dots-grid.css">
<script type="text/javascript" src="dist/webfont.min.js"></script>
<script type="text/javascript" src="dist/pixi.min.js"></script>
<script type="text/javascript" src="dist/zepto.min.js"></script>
<script type="text/javascript" src="dist/dots-grid.js"></script>
And then include the following code in your site:
<div class="canvasContainer">
<canvas id="grid"></canvas>
<div class="overlay">
<div class="content">
</div>
</div>
</div>
When the dom is ready, launch the function "initializeGrid"
$(document).ready(function(){
initializeGrid();
});
To add some interactive points to the grid, you need to include a script containing a variable "gridElements" and containing an Array with the specified dots
Here are the parameters for each element-dots:
Position in percentage. Top left is 0 / 0. Bottom Right is 100 / 100
Distance in dots of the position of the tooltip from the initial interactive dot.
Width & Height of the tooltip to be open In pixels
Anchor of the tooltip. Point where the tooltip is place in relation from the initail dot In pixels
Type of animation to be displayed on the grid when the tooltip opens
0: Oblique
1: Inversed Oblique
2: Cross
3: Asymetric Cross (Top-Left)
4: Asymetric Cross (Top-Right)
5: Asymetric Cross (Bottom-Right)
6: Asymetric Cross (Bottom-Left)
7: "L"
8: Inversed "L"
9: Arrow
10: Inversed Arrow
11: Square
12: Mirror Symtry from "L"
Display the title Latest News (near the square animation)
Type of the content to be displayed on click
keywords: floating keywords
html: embed html
For keyword type. Url of the link when the keywords are clicked
Html code to be placed in the tooltip (for an HTML type of element)
List of keywords to be displayed. (for a keywords type of element)
If there is no elements, the grid will be displayed anyway. Userful if you want to use the interactive grid without element, as a background.
See http://php.net/manual/en/function.json-encode.php for more infos about printing js compatible array from php
Julien Minguely - jminguely@gmail.com