Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. function getRandomArbitrary(min, max) {
  2. return Math.random() * (max - min) + min;
  3. }
  4. function getRandomInt(min, max) {
  5. return Math.floor(Math.random() * (max - min + 1)) + min;
  6. }
  7.  
  8. var a = true;
  9. if (a) {
  10. for (var i = 0; i < 10; i++) {
  11. $('body').append('<div class="fake_div" style="filter: blur(5px); pointer-events: none; opacity: 0.01; border: 1px solid white; transition: all .3s; position: fixed; left: 0; top: 0; width: 0px; height: 0px; border-radius: 20px;"></div>');
  12. }
  13. $(window).on('scroll', function(e) {
  14. $('.fake_div').each(function(index, el) {
  15. $(el)
  16. .css('border-bottom-width', getRandomInt(15, 20))
  17. .css('box-shadow', '1px '+getRandomInt(1, 10)+'px 10px')
  18. .css('transform', 'translate3d('+getRandomArbitrary(0, 10)+'px,'+getRandomArbitrary(0, 10)+'px,250px) rotate3d(0, 1, 0, '+getRandomArbitrary(0, 45)+'deg) scale3d(0.5, 0.5, 0.5)');
  19. });
  20. });
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement