Advertisement
milkandcookies

individual letter bouncing (css only)

Aug 18th, 2021 (edited)
1,142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.20 KB | None | 0 0
  1. <!—- you’ll most likely have to play around with the positioning —>
  2.  
  3. <head>
  4. <style>
  5.  
  6. body {
  7. font-size: 16px;
  8. }
  9.  
  10. @font-face {
  11. font-family: sweet;
  12. src: url(https://dl.dropbox.com/s/enaxxtimb6c419h/SweetChiliDemo.ttf);
  13. }
  14.  
  15. .name {
  16. top: -1em;
  17. z-index: 99;
  18. -webkit-text-stroke: 2px black;
  19. text-transform: uppercase;
  20. color: white;
  21. font-family: sweet;
  22. font-size: 6em;
  23. padding: 0.625em;
  24. opacity: 80%;
  25. animation: bounce 2s infinite;
  26. animation-timing-function: cubic-bezier(0.25, 0.85, 0.4, 1);
  27. }
  28.  
  29. .first {
  30. right: 0.625em;
  31. }
  32.  
  33. .second {
  34. right: 0.125em;
  35. animation-delay: 0.3s;
  36. }
  37.  
  38. .third {
  39. right: -0.75em;
  40. animation-delay: 0.5s;
  41. }
  42.  
  43. .fourth {
  44. right: -0.875em;
  45. animation-delay: 0.65s;
  46. }
  47.  
  48. @keyframes bounce {
  49. 0% { transform: scale(1,1) translateY(0); }
  50. 10% { transform: scale(1.1,.9) translateY(0); }
  51. 30% { transform: scale(.9,1.1) translateY(-30px); }
  52. 50% { transform: scale(1.05,.95) translateY(0); }
  53. 60% { transform: scale(1,1) translateY(-4px); }
  54. 100% { transform: scale(1,1) translateY(0); }
  55. }
  56.  
  57. </style>
  58. </head>
  59.  
  60. <body>
  61.  
  62. <span class="first name">r</span>
  63. <span class="second name">a</span>
  64. <span class="third name">e</span>
  65. <span class="fourth name">!</span>
  66.  
  67. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement