Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. @import url('https://fonts.googleapis.com/css?family=Roboto:400,700');
  2. html,body{
  3. padding: 0;
  4. margin: 0;
  5. font-family: "Roboto", sans-serif;
  6. color: #FFF;
  7. }
  8.  
  9.  
  10. #name{
  11. text-align: center;
  12. }
  13.  
  14. #alertHolder{
  15. opacity: 0; /* set to 0 */
  16. }
  17.  
  18. #name{
  19. /*font-size: 52px;*/
  20. position: absolute;
  21. top: 381px;
  22. left: 50%;
  23. transform: translateX(-50%);
  24. }
  25.  
  26.  
  27.  
  28.  
  29. $( document ).ready(function() {
  30.  
  31. function loaded(){
  32. var canvas = document.getElementById('name');
  33. var context = canvas.getContext('2d');
  34.  
  35. var xPosition = (canvas.width/2);
  36. var yPosition = (canvas.height/2);
  37.  
  38. var imageObjShadow = new Image();
  39. var imageObjWithShadow = new Image();
  40.  
  41. function drawText(){
  42. context.font = "26px Roboto";
  43. context.fillStyle = "{bottomColor}";
  44. context.textAlign = "center";
  45. context.textBaseline = "middle";
  46.  
  47. /* DELETE THIS BLOCK TO REMOVE DROP SHADOW */
  48. context.shadowColor = 'rgba(0,0,0,.5)';
  49. context.shadowBlur = 8;
  50. /* DELETE THIS BLOCK TO REMOVE DROP SHADOW */
  51.  
  52. context.fillText("{bottomText}", xPosition, yPosition);
  53. }
  54.  
  55.  
  56.  
  57.  
  58. function getShadowsImg(){
  59. context.save();
  60. context.font = "bold 52px Titillium Web";
  61. context.textAlign = "center";
  62. context.textBaseline = "middle";
  63. context.globalCompositeOperation = "destination-over";
  64. context.clearRect(0,0,canvas.width,canvas.height);
  65. context.fillStyle = "#a3004a";
  66. context.fillText("{bottomText}", xPosition-2, yPosition);
  67. context.fillStyle = "#09c4de";
  68. context.fillText("{bottomText}", xPosition+2, yPosition);
  69. context.restore();
  70.  
  71. imageDataShadows = canvas.toDataURL("image/png", 1.0);
  72. }
  73.  
  74. getShadowsImg();
  75. context.clearRect(0,0,canvas.width,canvas.height);
  76. drawText();
  77.  
  78. }
  79.  
  80. function run() {
  81. var video = document.getElementById('vid');
  82. video.addEventListener('loadeddata', function() {
  83. animate();
  84. }, false);
  85. video.load();
  86. }
  87.  
  88. if (!window.scriptLoaded) {
  89. jQuery.getScript("https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.4/TweenMax.min.js")
  90. .done(function() {
  91. window.scriptLoaded = true;
  92. loaded();
  93. run();
  94. });
  95. } else {
  96. run();
  97. loaded();
  98. }
  99.  
  100. var animate = function() {
  101. var tl = new TimelineMax();
  102. tl.timeScale(1);
  103.  
  104. tl.to( "#alertHolder", 0, {onComplete: playVid, opacity: 1, delay: 0});
  105. tl.from( "#infoHolder", .2, {delay: 1.8, opacity: 0});
  106. tl.from( "#infoHolder", .2, {delay: 7.2, opacity: 0});
  107.  
  108. function playVid() {
  109. var vid = document.getElementById("vid");
  110. vid.volume = {vidVolume} * .01;
  111. vid.play();
  112. }
  113. }
  114.  
  115. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement