Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. <style>
  2. @import url('https://fonts.googleapis.com/css?family=Teko:700');
  3. html,body{
  4. padding: 0;
  5. margin: 0;
  6. text-align: center;
  7. color: #FFF;
  8. font-family: "BigNoodleTitling", 'Teko', sans-serf;
  9. font-size: 96px;
  10. }
  11.  
  12. #notificationHolder {
  13. opacity: 0;
  14. }
  15. #vid {
  16. position: absolute;
  17. left: 50%;
  18. transform: translateX(-50%);
  19. }
  20. #textContainer{
  21. position: absolute;
  22. left: 0;
  23. top: 180px;
  24. width: 100%;
  25. z-index: 99;
  26. }
  27. #name {
  28. position: absolute;
  29. left: 0;
  30. top: 0;
  31. width: 100%;
  32. text-shadow: 2px 2px 6px #000, #9b40b2 0 0 40px,#9b40b2 0 0 60px;
  33. z-index: 9;
  34. }
  35. #nameShadow {
  36. position: absolute;
  37. left: 0;
  38. top: 0;
  39. width: 100%;
  40. color: rgba(0,0,0,0);
  41. text-shadow: #9b40b2 0 0 80px, #9b40b2 0 0 100px, #9b40b2 0 0 110px, #9b40b2 0 0 120px;
  42. z-index: 1;
  43. }
  44.  
  45. .amount{
  46. color: #cec9ff;
  47. }
  48. #message {
  49. position: absolute;
  50. top: 358px;
  51. width: 800px;
  52. left: 50%;
  53. transform: translateX(-50%);
  54. color: #ffce6a;
  55. font-size: 28px;
  56. color: #FFF;
  57. text-shadow: #000 0 0 2px, #000 2px 2px 4px;
  58. }
  59.  
  60. </style>
  61. <div id="notificationHolder">
  62. <div id="textContainer">
  63. <div id="name">{name} <span class="amount">{amount}</span></div>
  64. <div id="nameShadow">{name} <span class="amount">{amount}</span></div>
  65. <div id="message">{message}</div>
  66. </div>
  67.  
  68. <video id="vid" width="800" height="600">
  69. <source src="{image}" type="video/webm">
  70. </video>
  71. </div>
  72. <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.4/TweenMax.min.js"></script>
  73. <script>
  74. (function () {
  75.  
  76. function loadVideo (element) {
  77. return new Promise(resolve => {
  78. const go = () => {
  79. if (element.readyState >= 3) {
  80. resolve()
  81. }
  82. }
  83.  
  84. element.addEventListener('loadeddata', go)
  85. element.load()
  86.  
  87. go();
  88. })
  89. }
  90.  
  91. function run() {
  92.  
  93. const mainVideo = document.querySelector('#vid')
  94.  
  95. Promise.all([
  96. loadVideo(mainVideo)
  97. ]).then(() => {
  98. console.log('loaded')
  99. }).then(animate)
  100.  
  101. }
  102.  
  103. var animate = function() {
  104. var tl = new TimelineMax();
  105. tl.timeScale(1);
  106.  
  107. tl.to("#notificationHolder", .1, {opacity: 1, delay: .2, onComplete: playVid});
  108. tl.from("#textContainer", .1, {opacity: 0, delay: 3.5});
  109. tl.to("#nameShadow", 2.5, {opacity: 0}, "-=4");
  110. tl.from("#message", .1, {opacity: 0, delay: 1});
  111. tl.to("#textContainer", 1, {opacity: 0, delay: 4.25});
  112.  
  113. function playVid() {
  114. var vid = document.getElementById("vid");
  115. vid.volume = 0;
  116. vid.play();
  117. }
  118.  
  119. }
  120.  
  121. run();
  122.  
  123. }());
  124. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement