DeezjaVu

TeeBoard Notification - AlderaaN

Sep 9th, 2014
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 4.22 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>TeeBoard Notifications Widget</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5.  
  6. <!-- visit http://www.greensock.com/get-started-js/ for more info -->
  7.  
  8. <!--CDN links for the latest TweenLite, CSSPlugin, and EasePack -->
  9. <script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/plugins/CSSPlugin.min.js"></script>
  10. <script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/easing/EasePack.min.js"></script>
  11. <script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenLite.min.js"></script>
  12.  
  13. <style type="text/css" media="all">
  14.  
  15. @font-face {
  16.     font-family: rexlia;
  17.     src: url("fonts/rexlia rg.ttf");
  18. }
  19.  
  20. html, body {
  21.     height: 100%;
  22.     /*background-color: #FFFFFF;*/
  23.     background-color: rgba(255,255,255,0)!important;
  24. }
  25.  
  26. body {
  27.     margin: 0;
  28.     padding: 0;
  29.     overflow: hidden;
  30. }
  31.  
  32. #flashContent {
  33.     width: 200px;
  34.     height: 100px;
  35. }
  36.  
  37. #notification-msg {
  38.     color: #000000;
  39.     font-size: 18px;
  40.     /*font-family: Tahoma, Geneva, sans-serif;*/
  41.     font-family: Rexlia;
  42.     font-weight: bold;
  43.     text-transform: uppercase;
  44.     position: relative;
  45.     top: 50px;
  46.     left: 50px;
  47. }
  48.  
  49. #notification {
  50.     visibility: hidden;
  51. }
  52.  
  53. </style>
  54.  
  55. <script>
  56.  
  57. // relative paths to notification images
  58. var imgFollow = "images/notification-bg-follow.png";
  59. var imgSub = "images/notification-bg-sub.png";
  60. var imgDonate = "images/notification-bg-donate.png";
  61.  
  62. function teeboardNotification(type, msg) {
  63.     //alert("notification: " + type + " - " + msg);
  64.    
  65.     var img = document.getElementById("notification-img");
  66.    
  67.     // set image depending on notification type
  68.     if(type == "follower") {
  69.         img.src = imgFollow;
  70.     }else if(type == "subscriber") {
  71.         img.src = imgSub;
  72.     }else if(type == "donation") {
  73.         img.src = imgDonate;
  74.     }
  75.    
  76.     // set the notification message
  77.     var txt = document.getElementById("notification-msg");
  78.     txt.innerHTML = msg;
  79.    
  80.     // animate everything onto the screen
  81.     var div = document.getElementById("notification");
  82.     div.style.visibility = "visible";
  83.     TweenLite.killTweensOf(div);
  84.     // tween x position from offscreen (0 - width of image) to 0
  85.     TweenLite.fromTo(div, 2.0, {y:1420}, {y:500, ease:Elastic.easeOut, onComplete:hideNotification});
  86. }
  87.  
  88. function hideNotification() {
  89.     // animate everything back off screen
  90.     var div = document.getElementById("notification");
  91.     // tween x position from 0 to (0 - width of image)
  92.     TweenLite.to(div, 0.6, {y:1420, delay:5});
  93. }
  94.  
  95. </script>
  96.  
  97. </head>
  98. <body>
  99.  
  100. <!--
  101. Animations should take no longer than 10 seconds (showing + hiding), as notifications are queued,
  102. meaning that if there are 2 new followers, 2 alerts are invoked, 10 seconds apart.
  103. -->
  104.  
  105. <div id="notification">
  106.   <div id="notification-msg">
  107.         TEEBOARD JAVASCRIPT NOTIFICATIONS!!
  108.    </div>
  109.   <img id="notification-img" src="images/notification-bg-follow.png" width="920" height="110">
  110. </div>
  111.  
  112. <div id="flashContent">
  113.   <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="200" height="100" id="teeboard-notifications" align="middle">
  114.     <param name="movie" value="teeboard-notifications.swf" />
  115.     <param name="quality" value="high" />
  116.     <param name="bgcolor" value="#ffffff" />
  117.     <param name="play" value="true" />
  118.     <param name="loop" value="false" />
  119.     <param name="wmode" value="transparent" />
  120.     <param name="scale" value="noscale" />
  121.     <param name="menu" value="false" />
  122.     <param name="devicefont" value="false" />
  123.     <param name="salign" value="lt" />
  124.     <param name="allowScriptAccess" value="always" />
  125.     <!--[if !IE]>-->
  126.     <object type="application/x-shockwave-flash" data="teeboard-notifications.swf" width="200" height="100">
  127.       <param name="movie" value="teeboard-notifications.swf" />
  128.       <param name="quality" value="high" />
  129.       <param name="bgcolor" value="#ffffff" />
  130.       <param name="play" value="true" />
  131.       <param name="loop" value="false" />
  132.       <param name="wmode" value="transparent" />
  133.       <param name="scale" value="noscale" />
  134.       <param name="menu" value="false" />
  135.       <param name="devicefont" value="false" />
  136.       <param name="salign" value="lt" />
  137.       <param name="allowScriptAccess" value="always" />
  138.     </object>
  139.     <!--<![endif]-->
  140.   </object>
  141. </div>
  142.  
  143.  
  144. </body>
  145. </html>
Advertisement
Add Comment
Please, Sign In to add comment