Toggle navigation
Sign Up
Log In
Explore
Works
Folders
Tools
Collections
Artists
Groups
Groups
Topics
Tasks
Tasks
Jobs
Teams
Jobs
Recommendation
More Effects...
JS
function hslToHex(h, s, l){ var r, g, b; if(s == 0){ r = g = b = l; }else{ function hue2rgb(p, q, t){ if(t < 0) t += 1; if(t > 1) t -= 1; if(t < 1/6) return p + (q - p) * 6 * t; if(t < 1/2) return q; if(t < 2/3) return p + (q - p) * (2/3 - t) * 6; return p; } var q = l < 0.5 ? l * (1 + s) : l + s - l * s; var p = 2 * l - q; r = hue2rgb(p, q, h + 1/3); g = hue2rgb(p, q, h); b = hue2rgb(p, q, h - 1/3); } r = (r * 255).toFixed(0); g = (g * 255).toFixed(0); b = (b * 255).toFixed(0); var hR = Number(r).toString(16), hG = Number(g).toString(16), hB = Number(b).toString(16); hR = hR.length == 1 ? hR + '0' : hR.length > 2 ? hR[0] + hR[1] : hR; hG = hG.length == 1 ? hG + '0' : hG.length > 2 ? hG[0] + hG[1] : hG; hB = hB.length == 1 ? hB + '0' : hB.length > 2 ? hB[0] + hB[1] : hB; return '#'+hR+hG+hB; } /*for(var i = 1; i <= 48; i++){ var hue = Math.random(); for(var j = 1; j <= 5; j++){ var color = hslToHex(hue, 0.5, j/8 + 0.15), div = document.createElement('DIV'); div.style.background = color; document.body.appendChild(div); } }*/ (function add_drop(){ var hue = Math.random(), left = Math.random()*100, num_drops = 10, drops = $('
').addClass('drops'); drops.css({left: left+'vw'}); for(var j = 1; j <= num_drops; j++){ var color = hslToHex(hue, 0.5, (num_drops+1)/j), drop = $('
'); drop .addClass('drop') .css({ background: color, width: ((((num_drops+1)-j)/num_drops)*100)+'%', bottom: ((j/num_drops)*100)+'%' }); if(j == 1){ drop.css('box-shadow', color + ' 0 0 30px 5px'); } drops.prepend(drop); } $('body').append(drops); drops.css({top: -100}); $(drops).on('transitionEnd webkitTransitionEnd oTransitionEnd', function(){ $(this).addClass('ground'); $(this).on('animationEnd webkitAnimationEnd oAnimationEnd', function(){ $(this).remove(); }) }); setTimeout(function(){ drops.css({top: window.innerHeight - drops.height()}); },0); requestAnimationFrame(add_drop); })();
CSS
html, body { width: 100%; height: 100%; margin: 0; padding: 0; background: #000; overflow: hidden; } .drops { position: absolute; width: 10px; height: 100px; top: 0; transition: top 1s ease-in; text-align: center; } .drops .drop { position: absolute; box-sizing: border-box; padding: 0; margin: 0; display: inline-block; height: 10%; } .drops .drop:last-child { border-bottom-left-radius: 50%; border-bottom-right-radius: 50%; } .drops.ground { -webkit-animation: flatten 0.5s forwards; animation: flatten 0.5s forwards; } @-webkit-keyframes flatten { 0% { top: 100%; } 50% { width: 20px; height: 0px; top: 100%; } 100% { width: 100px; height: 0px; top: 100%; opacity: 0; } } @keyframes flatten { 0% { bottom: 0; } 100% { width: 100px; height: 0px; bottom: 0; } }
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