Advertisement
Guest User

Donation Alert

a guest
Jul 17th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. DONATIONS
  2. ------------
  3.  
  4. HTML :
  5.  
  6. <div id="alertHolder">
  7. <video id="vid" width="800" height="800" {mute}>
  8. <source src="{image}" type="video/webm">
  9. </video>
  10.  
  11. <div id="infoHolder">
  12. <div class="donation-title">{topText}</div>
  13. <div class="donation-text">{bottomText}</div>
  14. <canvas id="canvas" height="80" width="1920" />
  15. </div>
  16. </div>
  17.  
  18. ------------
  19.  
  20. CSS :
  21.  
  22. @import url('https://fonts.googleapis.com/css?family=Roboto:400,700');
  23. html,body{
  24. padding: 0;
  25. margin: 0;
  26. font-family: "Roboto", sans-serif;
  27. color: #FFF;
  28. }
  29.  
  30. #alertHolder{
  31. opacity: 0;
  32. }
  33.  
  34. .donation-title{
  35. font-size: 20px;
  36. position: absolute;
  37. top: 362px;
  38. left: 55%;
  39. transform: translateX(-50%);
  40. }
  41.  
  42. .donation-text{
  43. font-size: 20px;
  44. position: absolute;
  45. top: 402px;
  46. left: 56%;
  47. width: 331px;
  48. transform: translateX(-50%);
  49. text-shadow: 0px 0px 10px rgba(0, 0, 0, 0.8);
  50. text-align: center;
  51. padding: 0;
  52. }
  53.  
  54. #canvas{
  55. position: absolute;
  56. top: 380px;
  57. left: 56%;
  58. transform: translateX(-50%);
  59. }
  60.  
  61. ------------
  62.  
  63. JS :
  64.  
  65. $(document).ready(function() {
  66.  
  67. function run() {
  68. var video = document.getElementById('vid');
  69. video.addEventListener('loadeddata', function() {
  70. animate();
  71. }, false);
  72. video.load();
  73. }
  74.  
  75. if (!window.scriptLoaded) {
  76. jQuery.getScript("https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.4/TweenMax.min.js").done(function() {
  77. window.scriptLoaded = true;
  78. run();
  79. });
  80. }
  81. else {
  82. run();
  83. }
  84.  
  85. var animate = function() {
  86. var tl = new TimelineMax();
  87. tl.timeScale(1);
  88. tl.to( "#alertHolder", 0, {onComplete: playVid, opacity: 1, delay: 0});
  89. tl.from( "#infoHolder", .2, {delay: 1.8, opacity: 0});
  90. tl.from( "#infoHolder", .2, {delay: 7.1, opacity: 0});
  91.  
  92. function playVid() {
  93. var vid = document.getElementById("vid");
  94. vid.volume = {vidVolume} * .01;
  95. vid.play();
  96. }
  97. }
  98. });
  99.  
  100. ------------
  101.  
  102. CUSTOM FIELDS EDITOR:
  103.  
  104. {
  105. "mute": {
  106. "label": "Mute custom sounds?",
  107. "type": "dropdown",
  108. "options": {
  109. "muted": "yes",
  110. "none": "no"
  111. },
  112. "value": "none"
  113. },
  114. "vidVolume": {
  115. "label": "Custom Sound Volume",
  116. "type": "slider",
  117. "name": "",
  118. "value": 50,
  119. "min": 0,
  120. "max": 100,
  121. "steps": 1
  122. },
  123. "topText": {
  124. "label": "Subscriber Name",
  125. "type": "textfield",
  126. "value": "{name}"
  127. }
  128. }
  129.  
  130. ------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement