Created
September 20, 2014 22:37
-
-
Save simsketch/6b31032567b2b20004c7 to your computer and use it in GitHub Desktop.
trianglifyInit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script src="assets/js/trianglify.js"></script> | |
<script type="text/javascript"> | |
var t = new Trianglify({cellsize:520,noiseIntensity:0,x_gradient:["#800026","#bd0026","#e31a1c","#fc4e2a","#fd8d3c","#feb24c","#fed976"] }); | |
var d = document.getElementById("hero"); | |
var pattern = t.generate(document.body.clientWidth, document.body.clientHeight); | |
d.setAttribute('style', 'background-image: '+pattern.dataUrl); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment