SHARE
TWEET

Untitled

a guest Sep 21st, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var parallax = 235;
  2.  
  3. var songDuration = 185;
  4.  
  5. var animations = [
  6.     {
  7.       "index": 1,
  8.       "type": "drop",
  9.       "start": 38.39,
  10.       "end": 64.06,
  11.       "animations": [
  12.         {
  13.           "type": "lyric",
  14.           "start": 36.76,
  15.           "end": 38.09,
  16.           "returnLogo": 38.39,
  17.           "text": "Lick Me Like a lollipop",
  18.           "transistionTime": 0.3,
  19.           "randomSeed": 51
  20.         }
  21.       ]
  22.     },
  23.     {
  24.       "index": 2,
  25.       "type": "drop",
  26.       "start": 102.39,
  27.       "end": 128.05,
  28.       "animations": [
  29.         {
  30.           "type": "glitch",
  31.           "start": 100.61,
  32.           "end": 102.39,
  33.           "returnLogo": 102.39
  34.         }
  35.       ]
  36.     }
  37.   ];
  38.  
  39.  
  40. function getMarker(time){
  41.     var i=0;
  42.     var minDiff=1000;
  43.     var marker;
  44.     for(i in animations){
  45.         var start = Math.abs(time-animations[i].start);
  46.         var end = Math.abs(time-animations[i].end);
  47.         var m = start > end ? end : start;
  48.         if(m<minDiff){
  49.             minDiff=m;
  50.             marker = animations[i];
  51.         }
  52.     }
  53.     return marker;
  54. }
  55.  
  56.  
  57. function getAnimationMarker(animationList, time){
  58.     var i=0;
  59.     var minDiff=1000;
  60.     var marker;
  61.     for(i in animationList){
  62.         var start = Math.abs(time-animationList[i].start);
  63.         var end = Math.abs(time-animationList[i].end);
  64.         var m = start > end ? end : start;
  65.         if(m<minDiff){
  66.             minDiff=m;
  67.             marker = animationList[i];
  68.         }
  69.     }
  70.     return marker;
  71. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top