Advertisement
Guest User

Untitled

a guest
May 27th, 2015
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 4.36 KB | None | 0 0
  1. <html>
  2. <head>
  3.  
  4. <link rel="stylesheet" href="fonts/stylesheet.css" type="text/css" charset="utf-8" />
  5.  
  6. <script type="text/javascript" src="js/gsap/TweenMax.js"></script>
  7.  
  8. <style>
  9.  
  10. body {
  11.     margin:0px;
  12.     background-color: rgba(0, 0, 0, 0);
  13.     /*background-image: url('imgs/l3rdguide.png');*/
  14.     font-family: 'goudy_trajan_regularregular';
  15.     font-size: 26px;
  16.     color:#FFFFFF;
  17.     overflow: hidden;
  18.     width:1920px;
  19.     height:1080px;
  20.     -webkit-touch-callout: none;
  21.     -webkit-user-select: none;
  22.     -webkit-text-stroke: 0.35px;
  23. }
  24.  
  25. #container {
  26.     width: 1920px;
  27.     height: 1080px;
  28.     position: absolute;
  29.     top: 0;
  30.     left: 0;
  31. }
  32.  
  33. #l3rd {
  34.     position:absolute;
  35.     width:1177px;
  36.     height: 118px;
  37.     bottom:37px;
  38.     left:124px;
  39.     overflow: hidden;
  40. }
  41.  
  42. #l3rdbg {
  43.     position: absolute;
  44.     height: 100%;
  45.     width: 100%;
  46.     top:0px;
  47.     left:0px;
  48.     background-image: url("imgs/l3rdnormal.png");
  49. }
  50.  
  51. #logo {
  52.     position: absolute;
  53.     bottom:12px;
  54.     left:49px;
  55.     width: 168px;
  56.     height: 168px;
  57.     background-image: url("imgs/mkxlogo.png");
  58.  
  59. }
  60.  
  61. #line1 {
  62.     position: absolute;
  63.     top:24px;
  64.     left:115px;
  65.     font-size: 36px;
  66. }
  67.  
  68.  
  69. #line2 {
  70.     position: absolute;
  71.     top:67px;
  72.     left:115px;
  73.     font-size: 24px;
  74. }
  75.  
  76. .hidden {
  77.     display: none;
  78. }
  79.  
  80. </style>
  81.  
  82. <script type="text/javascript">
  83.     window.onload = init;
  84.  
  85.     var xhr = new XMLHttpRequest();
  86.  
  87.     var timestampOld=0;
  88.     var timestamp=0;
  89.     var cacheBuster=0;
  90.  
  91.     var firstupdate = true;
  92.  
  93.     var scObj;
  94.  
  95.     var cTitle1;
  96.     var cTitle2;
  97.  
  98.     var animating = 0;
  99.  
  100.     var showl3rd = false;
  101.  
  102.     function init() {
  103.    
  104.         if (window.external.SetLocalPropertyAsync) {
  105.             window.external.SetLocalPropertyAsync("prop:BrowserSize","1920,1080");
  106.             window.external.SetLocalPropertyAsync("prop:pos","0.000000,0.000000,1.000000,1.000000");
  107.         }
  108.  
  109.         cTitle1 = document.querySelector("#line1");
  110.         cTitle2 = document.querySelector("#line2");
  111.  
  112.         xhr.overrideMimeType('application/json');
  113.  
  114.         xhr.onreadystatechange = scLoaded;
  115.  
  116.         pollHandler();
  117.  
  118.         setInterval(function() {
  119.             pollHandler();
  120.         }, 500);
  121.     }
  122.  
  123.     function pollHandler() {
  124.         xhr.open('GET', "streamcontrol.json?test="+cacheBuster,true);
  125.         xhr.send();
  126.         cacheBuster++;
  127.                
  128.     }
  129.  
  130.     function scLoaded() {
  131.        
  132.         if (xhr.readyState === 4) {
  133.            
  134.             scObj = JSON.parse(xhr.responseText);
  135.            
  136.             timestampOld = timestamp;
  137.             timestamp = scObj["timestamp"];
  138.            
  139.             if (timestamp != timestampOld) {
  140.               l3rdUpdate();
  141.             }
  142.                        
  143.         }
  144.        
  145.     }
  146.  
  147.     function l3rdUpdate() {
  148.         if (showl3rd == false && scObj["showl3rd"] == "1") {
  149.             update();
  150.             showl3rd = true;
  151.         } else if (showl3rd == true && scObj["showl3rd"] == "0") {
  152.             TweenMax.to(document.getElementById("container"),1,{opacity:0,onComplete:function(){
  153.                 document.getElementById("container").style.display = "none";
  154.                 TweenMax.set(document.getElementById("container"),{opacity:1});
  155.                 firstupdate = true;
  156.             }})
  157.             showl3rd = false;
  158.         } else if (showl3rd == true) {
  159.             update();
  160.         }
  161.     }
  162.  
  163.     function update() {
  164.         if (firstupdate) {
  165.                 animating++;
  166.  
  167.                 cTitle1.innerHTML = scObj["cTitle1"];
  168.                 cTitle2.innerHTML = scObj["cTitle2"];
  169.  
  170.                 TweenMax.from(document.querySelector("#logo"),1,{css:{transform: "rotate(-90deg) scale(0.01,0.01)"}});
  171.                 TweenMax.from(document.querySelector("#l3rdbg"),1,{x:"-1177px",delay:1});
  172.  
  173.                 TweenMax.from(cTitle1,0.5,{x:"100px",opacity:0,delay:1.5});
  174.                 TweenMax.from(cTitle2,0.5,{x:"100px",opacity:0,delay:1.6,onComplete:function(){animating--;}});
  175.  
  176.  
  177.                 document.getElementById("container").style.display="block";
  178.  
  179.                 firstupdate = false;
  180.             } else if (animating == 0) {
  181.  
  182.                 if (cTitle1.innerHTML != scObj["cTitle1"]) {
  183.                     animating++;
  184.                     TweenMax.to(cTitle1,0.5,{x:"100px",opacity:0,onComplete:function(){cTitle1.innerHTML = scObj["cTitle1"];}});
  185.                     TweenMax.to(cTitle1,0.5,{x:"0px",opacity:1,delay:0.5,onComplete:function(){animating--;}})
  186.                 }
  187.                 if (cTitle2.innerHTML != scObj["cTitle2"]) {
  188.                     animating++;
  189.                     TweenMax.to(cTitle2,0.5,{x:"100px",opacity:0,delay:0.1,onComplete:function(){cTitle2.innerHTML = scObj["cTitle2"];}});
  190.                     TweenMax.to(cTitle2,0.5,{x:"0px",opacity:1,delay:0.6,onComplete:function(){animating--;}})
  191.                 }
  192.  
  193.  
  194.             }
  195.     }
  196. </script>
  197.  
  198. </head>
  199.  
  200. <body>
  201. <div id="container" class="hidden">
  202.     <div id="l3rd">
  203.         <div id="l3rdbg"></div>
  204.         <div id="line1">Cameraman</div>
  205.         <div id="line2">@Zhieeep</div>
  206.     </div>
  207.     <div id="logo"></div>
  208. </div>
  209. </body>
  210. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement