Greasy Fork

Mangadex navbar toggle button

Makes the nav-bar toggleable so that you can enjoy your reading in full screen but still navigate! Button at top right of screen.

目前为 2020-05-16 提交的版本。查看 最新版本

// ==UserScript==
// @name         Mangadex navbar toggle button
// @version      1.0
// @description  Makes the nav-bar toggleable so that you can enjoy your reading in full screen but still navigate! Button at top right of screen.
// @author       DinoMC
// @match        https://mangadex.org/*
// @grant        none
// @namespace https://greasyfork.org/users/563463
// ==/UserScript==

(function() {
    'use strict';

    $('<style> body.tall { padding-top: 0!important; } .reader-main.tall { height: 100vh!important; max-height: 100vh!important; } </style>').prependTo("body");
    var xbutton = $('<svg focusable="false" id="togglenavbar" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="position: absolute;height: 50px;width: 50px;top: 5px;right: 5px; z-index:99999"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" fill="black"></path></svg>').prependTo("body");
    xbutton.click(function() {
        $("nav.navbar").toggle();
        $("body,.reader-main").toggleClass("tall");
    });

})();