Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* This is "cinematic mode" for XKCD 1110 ( http://xkcd.com/1110/ )
- Author: Jan "Zopper" Tulak
- You can do with this whatever you want. Even destroy the world.
- */
- /* USAGE:
- paste it into the JS console (in Google Chrome: ctrl+shift+c, then select "console")
- CONTROL:
- W - up, S - down, A - left, D - right
- */
- $("#comic img")[0].style.display="none"
- $("body")[0].style.marginLeft=0;
- $("body")[0].style.backgroundColor="#fff";
- $("body")[0].style.left=0;
- $("#middleContainer")[0].style.marginLeft=0;
- $("#middleContainer")[0].style.border=0;
- $("#middleContainer")[0].style.position="absolute";
- $("#middleContainer")[0].style.left="0px";
- $("#middleContainer")[0].style.top="-100px";
- function setSize(){
- $("#comic")[0].style.width=($(window).width()-2)+"px";
- $("#comic")[0].style.height=($(window).height()-5)+"px";
- }
- setSize();
- $(window).resize(function() {
- setSize();
- });
- function move() {
- guu=$(".map")[0];
- this.left=function (){ guu.style.left=(guu.style.left.replace("px","")*1+100)+"px"; };
- this.right=function (){ guu.style.left=(guu.style.left.replace("px","")*1-100)+"px"; };
- this.top=function (){ guu.style.top=(guu.style.top.replace("px","")*1+100)+"px"; };
- this.down=function (){ guu.style.top=(guu.style.top.replace("px","")*1-100)+"px"; };
- }
- mv=new move();
- $("body").keypress(function(key){
- if(key.keyCode == 119) {
- mv.top();
- }else if(key.keyCode == 115) {
- mv.down();
- }else if(key.keyCode == 100) {
- mv.right();
- }else if(key.keyCode == 97) {
- mv.left();
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement