Toggle navigation
Sign Up
Log In
Explore
Works
Folders
Tools
Collections
Artists
Groups
Groups
Topics
Tasks
Tasks
Jobs
Teams
Jobs
Recommendation
More Effects...
JS
;void function () { var depth = 16 , branchWidth = 12, step = 0 var newDepthPub, depthPub var canvas = document.getElementById('mycanvas') var ctx = canvas.getContext('2d') canvas.width = window.innerWidth canvas.height = window.innerHeight ctx.globalCompositeOperation = 'lighter'; var drawTree = function (ctx, startX, startY, length, angle ,depth, branchWidth) { var rand = Math.random, newDepth, newLength, newAngle, maxBranch = 3, endX, endY, maxAngle = 2*Math.PI /4, subBranches, lenShrink; ctx.beginPath() ctx.moveTo(startX, startY) endX = startX + length * Math.cos(angle) endY = startY + length * Math.sin(angle) ctx.lineCap = 'round' ctx.lineWidth = branchWidth ctx.lineTo(endX, endY) if (depth <= 2) { ctx.strokeStyle = 'rgb(0,' +(((rand()*64) + 128) >> 0) + ',0)' }else{ ctx.strokeStyle = 'rgb(' +(((rand()*64) + 64) >> 0) + ',50, 25)' } ctx.stroke() newDepth = depth -1 if (!newDepth) return subBranches = maxBranch -1 branchWidth *= .7 for (var i = 0; i < subBranches; i++) { newAngle = angle + rand()*maxAngle - maxAngle*.5 newLength = length * (.7 + rand()*.3) setTimeout(function () { drawTree(ctx, endX, endY, newLength, newAngle, newDepth, branchWidth) newDepthPub = newDepth depthPub = depth step++; },100) } } var init = function () { step = 0 canvas.width = window.innerWidth canvas.height = window.innerHeight ctx.globalCompositeOperation = 'lighter'; ctx.clearRect(0, 0, window.innerWidth, window.innerHeight) drawTree(ctx, ~~(window.innerWidth/2), ~~(window.innerHeight/1.02), 60, -Math.PI/2, depth, branchWidth) } var regrow = function () { if (step < 65534) return init() } document.querySelector('body').addEventListener('click', function (e) { regrow() }) document.addEventListener('DOMContentLoaded',function(){ init() },false); window.onresize = regrow }();
CSS
body{ margin: 0; padding: 0; /*background:linear-gradient(360deg, #e56420, #37bbde);*/ overflow:hidden; background-color: black; width:100%; height:100vh; background-size:cover; background-blend-mode: hard-light; animation: hue-rotate 10s linear infinite; } @keyframes hue-rotate { from { -webkit-filter: hue-rotate(0); -moz-filter: hue-rotate(0); -ms-filter: hue-rotate(0); filter: hue-rotate(0); } to { -webkit-filter: hue-rotate(360deg); -moz-filter: hue-rotate(360deg); -ms-filter: hue-rotate(360deg); filter: hue-rotate(360deg); } }
HTML
Join Effecthub.com
Working with Global Gaming Artists and Developers!
Login
Sign Up
Or Login with Your Email Address:
Email
Password
Remember
Or Sign Up with Your Email Address:
Your Email
This field must contain a valid email
Set Password
Password should be at least 1 character
Stay informed via email