Advertisement
dasbimmerman

LOADING (anim/CSS)

Jun 15th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 3.31 KB | None | 0 0
  1. #stuck { /* fixed container */
  2.     text-align:center;
  3.     background-color:rgba(150,150,150,.6);
  4.     padding:10px;
  5.     width:150px;
  6.     min-height:30px;
  7.     position:fixed;
  8.     right:15px;
  9.     top:15px;
  10.     z-index:2;
  11.     border: 5px outset rgba(0,0,0,.2);
  12.     border-radius: 20%;
  13. }
  14.          /* Each letter of LOADING is*/
  15.         /* nested within a <span>   */
  16.        /*  with the following IDs  */
  17.  
  18. #l1 { /* L */
  19.     animation:pete 1s linear 0s 1 normal;
  20.     animation:repete 1s linear 1s 4 normal;    
  21.     }
  22. #l2 { /* O */
  23.     animation:pete 1s linear .1s 1 normal;
  24.     animation:repete 1s linear 1.1s 4 normal;    
  25.     }
  26. #l3 { /* A */
  27.     animation:pete 1s linear .2.s 1 normal;
  28.     animation:repete 1s linear 1.2s 4 normal;    
  29.     }
  30. #l4 { /* D */
  31.     animation:pete 1s linear .3s 1 normal;
  32.     animation:repete 1s linear 1.3s 4 normal;    
  33.     }
  34. #l5 { /* I */
  35.     animation:pete 1s linear 0.4s 1 normal;
  36.     animation:repete 1s linear 1.4s 4 normal;    
  37.     }
  38. #l6 { /* N */
  39.     animation:pete 1s linear 0.5s 1 normal;
  40.     animation:repete 1s linear 1.5s 4 normal;    
  41.     }
  42. #l7 { /* G */
  43.     animation:pete 1s linear 0.6s 1 normal;
  44.     animation:repete 1s linear 1.6s 4 normal;    
  45.     }
  46.    
  47.     /* The keyframes for the animation */
  48.  
  49. @keyframes pete{ /* Plays 1x */
  50.     0%   {color: black; font-size: 1em; text-shadow: 1px 0px 1px blue, -1px 0px 1px blue, 0px 1px 1px blue, 0px -1px 1px blue;}
  51.     14%  {color: blue; font-size: 1.1em; text-shadow: 2px 0px 2px purple, -2px 0px 2px purple, 0px 2px 2px purple, 0px -2px 2px purple;}
  52.     28%  {color: purple; font-size: 1.2em; text-shadow: 3px 0px 3px red, -3px 0px 3px red, 0px 3px 3px red, 0px -3px 3px red;}
  53.     42%  {color: red; font-size: 1.3em; text-shadow: 4px 0px 4px orange, -4px 0px 4px orange, 0px 4px 1px orange, 0px -4px 4px orange;}
  54.     56%  {color: orange; font-size: 1.4em; text-shadow: 5px 0px 5px yellow, -5px 0px 1px yellow, 0px 5px 5px yellow, 0px -5px 5px yellow;}
  55.     80% {color: yellow; font-size: 1.5em; text-shadow: 6px 0px 6px green, -6px 0px 6px green, 0px 6px 6px green, 0px -6px 6px green;}
  56.     100% {color: green; font-size: 1.6em; text-shadow: 7px 0px 7px blue, -7px 0px 7px blue, 0px 7px 7px blue, 0px -7px 7px blue;}
  57. }
  58.  
  59. @keyframes repete{  /* Plays 4x (intentional spelling) */
  60.  
  61.     0%  {color: blue; font-size: 1.1em; text-shadow: 2px 0px 2px purple, -2px 0px 2px purple, 0px 2px 2px purple, 0px -2px 2px purple;}
  62.     16%  {color: purple; font-size: 1.2em; text-shadow: 3px 0px 3px red, -3px 0px 3px red, 0px 3px 3px red, 0px -3px 3px red;}
  63.     38%  {color: red; font-size: 1.3em; text-shadow: 4px 0px 4px orange, -4px 0px 4px orange, 0px 4px 1px orange, 0px -4px 4px orange;}
  64.     58%  {color: orange; font-size: 1.4em; text-shadow: 5px 0px 5px yellow, -5px 0px 1px yellow, 0px 5px 5px yellow, 0px -5px 5px yellow;}
  65.     74% {color: yellow; font-size: 1.5em; text-shadow: 6px 0px 6px green, -6px 0px 6px green, 0px 6px 6px green, 0px -6px 6px green;}
  66.     100% {color: green; font-size: 1.6em; text-shadow: 7px 0px 7px blue, -7px 0px 7px blue, 0px 7px 7px blue, 0px -7px 7px blue;}
  67. }
  68.  
  69. /*  Example of use
  70. *
  71. *  <div id="stuck">
  72. *    <span id="l1">L</span>
  73. *    <span id="l2">O</span>
  74. *    <span id="l3">A</span>
  75. *    <span id="l4">D</span>
  76. *    <span id="l5">I</span>
  77. *    <span id="l6">N</span>
  78. *    <span id="l7">G</span>
  79. *  </div>
  80. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement