Guest User

e-hentai fullscreen script by Patchwerk

a guest
Apr 28th, 2017
1,669
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         E-hentai Fullscreen Viewer
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  Fullscreen pictures on g.e-hentai.org. Use left and right arrows to navigate.
  6. // @author       patchwerk
  7. // @match        https://e-hentai.org/s/*
  8. // @grant        none
  9. // ==/UserScript==
  10. (function() {
  11.     'use strict';
  12.  
  13.     var link = document.querySelectorAll("#i3 > a > img");
  14.     var body = document.querySelectorAll("body");
  15.     var sni = document.querySelectorAll(".sni");
  16.     var sn = document.querySelectorAll(".sn a")[1].getAttribute("href");
  17.     var ifd = document.querySelectorAll(".if");
  18.     var tod = document.querySelectorAll(".tod");
  19.     var picto = document.querySelectorAll(".sn");
  20.     var sb = document.querySelectorAll(".sb");
  21.     var ip = document.querySelectorAll(".ip");
  22.     body = body[0];
  23.     sni = sni[0];
  24.     link = link[0];
  25.     var oldHeight = link.offsetHeight;
  26.     var href = document.querySelectorAll(".sni > #i3 > a");
  27.     fullscreen();
  28.  
  29.     function fullscreen() {
  30.         if (ifd[0] != null) {
  31.             ifd[0].style.display = "none";
  32.         }
  33.         if (tod[0] != null) {
  34.             tod[0].style.display = "none";
  35.         }
  36.         picto[0].style.display = "none";
  37.         picto[1].style.display = "none";
  38.         sb[0].style.display = "none";
  39.         ip[0].style.display = "none";
  40.         body.style.backgroundColor = "#E3E0D1";
  41.         body.style.color = "#E3E0D1";
  42.         sni.style.backgroundColor = "#E3E0D1";
  43.         sni.style.border = "1px solid #E3E0D1";
  44.         link.style.position = "fixed";
  45.         link.style.top = "0";
  46.         link.style.bottom = "0";
  47.         link.style.left = "0";
  48.         link.style.right = "0";
  49.         link.style.width = "";
  50.         link.style.height = "100%";
  51.         link.style.margin = "auto";
  52.         link.style.overflow = "auto";
  53.         link.style.zoom = "10";
  54.         link.style.zIndex = "100";
  55.     }
  56.     document.onkeydown = checkKey;
  57.  
  58.     function checkKey(e) {
  59.             console.log('ok');
  60.  
  61.         e = e || window.event;
  62.  
  63.         if (e.keyCode == '37') {
  64.             window.location.href = sn;
  65.         } else if (e.keyCode == '39') {
  66.             window.location.href = href[0].getAttribute("href");
  67.         } else if (e.keyCode == '27') {
  68.             if (ifd[0] != null) {
  69.                 ifd[0].style.display = "block";
  70.             }
  71.             if (tod[0] != null) {
  72.                 tod[0].style.display = "block";
  73.             }
  74.             picto[0].style.display = "block";
  75.             picto[1].style.display = "block";
  76.             sb[0].style.display = "block";
  77.             ip[0].style.display = "block";
  78.             body.style.backgroundColor = "#E3E0D1";
  79.             body.style.color = "#5C0D11";
  80.             sni.style.backgroundColor = "#EDEBDF";
  81.             sni.style.border = "1px solid #5C0D12";
  82.             link.style.position = "";
  83.             link.style.top = "";
  84.             link.style.bottom = "";
  85.             link.style.left = "";
  86.             link.style.right = "";
  87.             link.style.width = "";
  88.             link.style.height = oldHeight;
  89.             link.style.margin = "";
  90.             link.style.overflow = "";
  91.             link.style.zoom = "";
  92.             link.style.zIndex = "";
  93.         } else if (e.keyCode == '32') {
  94.             fullscreen();
  95.         }
  96.  
  97.     }
  98.  
  99. })();
Advertisement
Add Comment
Please, Sign In to add comment