Advertisement
republicaoldgamer

Untitled

Sep 22nd, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. <div id="alert-text-wrap">
  2.  
  3. <!-- alert text -->
  4. <div id="alert-text">
  5.  
  6. <!-- alert message -->
  7. <!-- messageTemplate will be replaced with your message template -->
  8. <!-- for example : {name} is now following! or {name} donated {amount} -->
  9. <div id="alert-message">{messageTemplate}</div>
  10. <div id="alert-user-message">{userMessage}</div>
  11.  
  12.  
  13. </div>
  14.  
  15. </div>
  16. <style>
  17. #vid {
  18. position: absolute;
  19. left: 50%;
  20. transform: translateX(-50%);
  21. }
  22. #textContainer{
  23. position: absolute;
  24. left: 0;
  25. top: 495px;
  26. width: 100%;
  27. z-index: 99;
  28. }
  29. #name {
  30. position: absolute;
  31. left: 0;
  32. top: 0;
  33. width: 100%;
  34. text-shadow: 2px 2px 6px #000, #e27beb 0 0 40px,#e27beb 0 0 60px;
  35. z-index: 9;
  36. }
  37. #nameShadow {
  38. position: absolute;
  39. left: 0;
  40. top: 0;
  41. width: 100%;
  42. color: rgba(0,0,0,0);
  43. text-shadow: #e27beb 0 0 80px, #e27beb 0 0 100px, #e27beb 0 0 110px, #e27beb 0 0 120px;
  44. z-index: 1;
  45. }
  46. </style>
  47. <div id="notificationHolder">
  48. <div id="textContainer">
  49. <div id="name">{name}</div>
  50. <div id="nameShadow">{name}</div>
  51. </div>
  52.  
  53. <video autoplay preload id="vid" width="800" height="800">
  54. <source src="{image}" type="video/webm">
  55. </video>
  56. </div>
  57. <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.4/TweenMax.min.js"></script>
  58. <script>
  59. (function () {
  60.  
  61. function loadVideo (element) {
  62. return new Promise(resolve => {
  63. const go = () => {
  64. if (element.readyState >= 3) {
  65. resolve()
  66. }
  67. }
  68.  
  69. element.addEventListener('loadeddata', go)
  70. element.load()
  71.  
  72. go();
  73. })
  74. }
  75.  
  76. function run() {
  77.  
  78. const mainVideo = document.querySelector('#vid')
  79.  
  80. Promise.all([
  81. loadVideo(mainVideo)
  82. ]).then(() => {
  83. console.log('loaded')
  84. }).then(animate)
  85.  
  86. }
  87.  
  88. var animate = function() {
  89. var tl = new TimelineMax();
  90. tl.timeScale(1);
  91.  
  92. tl.to("#notificationHolder", .1, {opacity: 1, delay: .2, onComplete: playVid});
  93. tl.from("#textContainer", .1, {opacity: 0, delay: 3.5});
  94. tl.from("#textContainer", 4, {y: "+=30"}, "-=.1");
  95. tl.to("#nameShadow", 2.5, {opacity: 0}, "-=4");
  96. tl.to("#textContainer", 1, {opacity: 0, delay: 2.25});
  97.  
  98. function playVid() {
  99. var vid = document.getElementById("vid");
  100. vid.volume = {videoVolume}*.01;
  101. vid.play();
  102. }
  103.  
  104. }
  105.  
  106. run();
  107.  
  108. }());
  109. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement