Created
November 9, 2017 09:58
-
-
Save CodeMyUI/0db4f46e2ef4aa8275d96a532b4267ae to your computer and use it in GitHub Desktop.
Codevember #6 - storm
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
<div class="image-container"> | |
<img src="" | |
alt="" | |
class="container" | |
id="image"> | |
</div> | |
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
var image = document.getElementById('image'); | |
image.onload = function() { | |
var engine = new RainyDay({ | |
image: this, | |
gravityAngle: Math.PI / 5 | |
}); | |
engine.trail = engine.TRAIL_SMUDGE; | |
engine.rain([ [3, 2, 2] ], 100); | |
engine.rain( | |
[ | |
[1, 0, 20], | |
[3, 3, 1], | |
[1, 2, 19] | |
], | |
100); | |
// engine.rain([ [0, 2, 200], [3, 3, 1] ], 100); | |
}; | |
image.crossOrigin = 'anonymous'; | |
image.src = 'http://images.pexels.com/photos/458785/pexels-photo-458785.jpeg?w=1260&h=750&auto=compress&cs=tinysrgb'; |
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="https://cdnjs.cloudflare.com/ajax/libs/rainyday.js/0.1.2/rainyday.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script> |
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
body { | |
overflow: hidden; | |
height: 100%; | |
margin: 0; | |
padding: 0; | |
} | |
.container { | |
width: 100vw; | |
height: 100vh; | |
} | |
.image-container { | |
overflow: hidden; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment