Hpoi grid display

Grid display for hpoi user home page

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        Hpoi grid display
// @namespace   Violentmonkey Scripts
// @match       https://www.hpoi.net/user/home*
// @grant       none
// @version     1.0
// @author      arition
// @description Grid display for hpoi user home page
// @license MIT
// ==/UserScript==

function updateLayout() {
  $(".home-left").addClass("hidden");
  $(".home-right").addClass("hidden");
  $(".home-left + div").addClass("col-md-24");
  $(".home-info-content").addClass("col-md-24");
  $(".overlay-container").addClass("col-md-24");
  $(".hp-single-line").addClass("col-md-24").removeClass("col-xs-offset-8").removeClass("user-home-bottom-info");
  $(".main-content").css({
    display: "grid",
    "grid-template-columns": "repeat(6, minmax(0, 1fr))",
    gap: "1rem",
  });
}

$(document).ready(function () {
  updateLayout();

  var observer = new MutationObserver(function () {
    updateLayout();
  });

  observer.observe(document.querySelector(".main-content"), {
    childList: true,
    subtree: true,
  });
});