Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>TeeBoard Notifications Widget</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <!-- visit http://www.greensock.com/get-started-js/ for more info -->
- <!--CDN links for the latest TweenLite, CSSPlugin, and EasePack -->
- <script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/plugins/CSSPlugin.min.js"></script>
- <script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/easing/EasePack.min.js"></script>
- <script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenLite.min.js"></script>
- <style type="text/css" media="all">
- @font-face {
- font-family: rexlia;
- src: url("fonts/rexlia rg.ttf");
- }
- html, body {
- height: 100%;
- /*background-color: #FFFFFF;*/
- background-color: rgba(255,255,255,0)!important;
- }
- body {
- margin: 0;
- padding: 0;
- overflow: hidden;
- }
- #flashContent {
- width: 200px;
- height: 100px;
- }
- #notification-msg {
- color: #000000;
- font-size: 18px;
- /*font-family: Tahoma, Geneva, sans-serif;*/
- font-family: Rexlia;
- font-weight: bold;
- text-transform: uppercase;
- position: relative;
- top: 50px;
- left: 50px;
- }
- #notification {
- visibility: hidden;
- }
- </style>
- <script>
- // relative paths to notification images
- var imgFollow = "images/notification-bg-follow.png";
- var imgSub = "images/notification-bg-sub.png";
- var imgDonate = "images/notification-bg-donate.png";
- function teeboardNotification(type, msg) {
- //alert("notification: " + type + " - " + msg);
- var img = document.getElementById("notification-img");
- // set image depending on notification type
- if(type == "follower") {
- img.src = imgFollow;
- }else if(type == "subscriber") {
- img.src = imgSub;
- }else if(type == "donation") {
- img.src = imgDonate;
- }
- // set the notification message
- var txt = document.getElementById("notification-msg");
- txt.innerHTML = msg;
- // animate everything onto the screen
- var div = document.getElementById("notification");
- div.style.visibility = "visible";
- TweenLite.killTweensOf(div);
- // tween x position from offscreen (0 - width of image) to 0
- TweenLite.fromTo(div, 2.0, {y:1420}, {y:500, ease:Elastic.easeOut, onComplete:hideNotification});
- }
- function hideNotification() {
- // animate everything back off screen
- var div = document.getElementById("notification");
- // tween x position from 0 to (0 - width of image)
- TweenLite.to(div, 0.6, {y:1420, delay:5});
- }
- </script>
- </head>
- <body>
- <!--
- Animations should take no longer than 10 seconds (showing + hiding), as notifications are queued,
- meaning that if there are 2 new followers, 2 alerts are invoked, 10 seconds apart.
- -->
- <div id="notification">
- <div id="notification-msg">
- TEEBOARD JAVASCRIPT NOTIFICATIONS!!
- </div>
- <img id="notification-img" src="images/notification-bg-follow.png" width="920" height="110">
- </div>
- <div id="flashContent">
- <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="200" height="100" id="teeboard-notifications" align="middle">
- <param name="movie" value="teeboard-notifications.swf" />
- <param name="quality" value="high" />
- <param name="bgcolor" value="#ffffff" />
- <param name="play" value="true" />
- <param name="loop" value="false" />
- <param name="wmode" value="transparent" />
- <param name="scale" value="noscale" />
- <param name="menu" value="false" />
- <param name="devicefont" value="false" />
- <param name="salign" value="lt" />
- <param name="allowScriptAccess" value="always" />
- <!--[if !IE]>-->
- <object type="application/x-shockwave-flash" data="teeboard-notifications.swf" width="200" height="100">
- <param name="movie" value="teeboard-notifications.swf" />
- <param name="quality" value="high" />
- <param name="bgcolor" value="#ffffff" />
- <param name="play" value="true" />
- <param name="loop" value="false" />
- <param name="wmode" value="transparent" />
- <param name="scale" value="noscale" />
- <param name="menu" value="false" />
- <param name="devicefont" value="false" />
- <param name="salign" value="lt" />
- <param name="allowScriptAccess" value="always" />
- </object>
- <!--<![endif]-->
- </object>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment