Hack Space4Online

hack space4.online~

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

Advertisement:

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

Advertisement:

// ==UserScript==
// @name         Hack Space4Online
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  hack space4.online~
// @author       You
// @match        http://space4.online/problems/*
// @icon         https://www.google.com/s2/favicons?domain=space4.online
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    setTimeout(() => {
        // move the toolbar at the bottom
        let content = document.getElementById("blah2");
        let header = content.previousElementSibling;
        header.parentElement.insertBefore(content, header);

        // remove footer
        document.getElementsByTagName('footer')[0].remove();

        // get the height of header;
        let header_height = document.getElementsByTagName('header')[0].offsetHeight;

        // let the main part's display is flex.
        let main_part = header.parentElement.parentElement.parentElement.parentElement;
        main_part.style.display = "flex";
        main_part.style.height = "calc(100vh - " + header_height + "px)";
        console.log("calc(100vh - " + header_height + "px)");
        let left = main_part.children[0];
        let right = main_part.children[1];

        // change left's outlook
        left.style.overflow="scroll";
        left.style.width = "40%";
        left.children[2].style["max-width"] = "100%";
        left.children[2].style.display = "block";
        let tags = left.children[2].children[1];
        let text = left.children[2].children[0];
        text.parentElement.insertBefore(tags, text);

        // change right's outlook
        right.style["min-height"] = "0";
        right.style.width = "60%";
        right.children[0].style.height = "75%";
        right.children[1].style.height = "25%";
        right.children[1].children[0].style["min-height"] = "0";
        right.children[1].children[1].style["min-height"] = "0";

        // refrash
        let evt = document.createEvent("HTMLEvents");
        evt.initEvent("resize", true, true);
        window.dispatchEvent(evt);
    }, 3000);
})();