Advertisement
Guest User

Your javascript code with torch

a guest
Mar 1st, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function() {
  2.  
  3. $(".title").hover(function() {
  4.     $(this).css("font-size","140%"); }
  5.     , function() {
  6.     $(this).css("font-size","120%"); });
  7.            
  8.         dontpropogate=function() {
  9.             $(this).stopPropagation();
  10.             }
  11.         showpage=function($label){
  12.             pageSound.playclip()
  13.             document.getElementById("paper").style.display="block";
  14.             switch ($label) {
  15.                 case 1:
  16.                 $contents = '<span style="font-weight:bold; font-size:50px; font-style:italic; font-family:\'Open Sans Condensed\';">The Eight Pages<\/span><hr style="width:40%;" \/><p>Based on the game by Mark J. Hadley, you start off in a dark wood at night, armed with only a flashlight. You must try to collect all eight pages, while being pursued by the Slenderman. Can you get them all before he catches you? Download and play to find out.<\/p><p>This game works on the TI-83+, TI-84+ and their respective Silver Editions. It may also work on the TI-84+ emulator on the TI-Nspire. It has not been tested on any other model.<\/p><hr style="width:40%;" \/>Download: <a href="downloads/slender8pages.zip" target="_blank" style="color:inherit; text-decoration:none; font-style:italic;">Slender: The Eight Pages, TI Edition<\/a>';
  17.                 break;
  18.                 }
  19.             document.getElementById("paper").innerHTML=$contents;
  20.             $("a").click(function(e){
  21.                 e.stopPropagation();
  22.                 });
  23.             }  
  24.         removepage=function() {
  25.             pageSound.playclip()
  26.             document.getElementById("paper").style.display="none";
  27.             }        
  28.         });
  29. var audiotypes={
  30.         "mp3": "audio/mpeg",
  31.         "mp4": "audio/mp4",
  32.         "ogg": "audio/ogg",
  33.         "wav": "audio/wav"
  34.     }
  35.  
  36. function ss_soundbits(sound){
  37.         var audio_element = document.createElement('audio')
  38.         if (audio_element.canPlayType){
  39.             for (var i=0; i<arguments.length; i++){
  40.                 var source_element = document.createElement('source')
  41.                 source_element.setAttribute('src', arguments[i])
  42.                 if (arguments[i].match(/\.(\w+)$/i))
  43.                     source_element.setAttribute('type', audiotypes[RegExp.$1])
  44.                 audio_element.appendChild(source_element)
  45.             }
  46.             audio_element.load()
  47.             audio_element.playclip=function(){
  48.                 audio_element.pause()
  49.                 audio_element.currentTime=0
  50.                 audio_element.play()
  51.             }
  52.         audio_element.stopclip=function(){
  53.                 audio_element.pause()
  54.                 }
  55.             return audio_element
  56.         }
  57.     }
  58.  var pageSound  = ss_soundbits("paper-rustle.mp3");
  59.  
  60. var originalBG = '',
  61.     lightColor = 'fff',
  62.     gradientSize = 5;
  63.     originalBG = $("body").css("background");
  64.  
  65. var handleMouseMove = function(e) {
  66.     x  = e.pageX - this.offsetLeft;
  67.     y  = e.pageY - this.offsetTop;
  68.     xy = x + " " + y;
  69.  
  70.     bgWebKit = "-webkit-gradient(radial, " + xy + ", 0, " + xy + ", 100, from(rgba(255,255,255,0.8)), to(rgba(255,255,255,0.0))), " + originalBG;
  71.     bgMoz    = "-moz-radial-gradient(" + x + "px " + y + "px 45deg, circle, " + lightColor + " 0%, " + originalBG + " " + gradientSize + "px)";
  72.  
  73.    $(this)
  74.       .css({ background: bgWebKit })
  75.       .css({ background: bgMoz });
  76.  
  77. }
  78.    
  79. var handleMouseLeave = function() {
  80.     $(this).css({ background: originalBG });
  81. }
  82.  
  83. $('body').mousemove(handleMouseMove).mouseleave(handleMouseLeave);
  84.  
  85. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement