page view optimize - "esdoc"

I love esdoc!

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         page view optimize - "esdoc"
// @namespace    https://xianghongai.github.io/
// @version      0.0.1
// @description  I love esdoc!
// @author       Nicholas Hsiang
// @icon         https://xinlu.ink/favicon.ico
// @match        https://esdoc.org/*
// @grant        GM_addStyle
// @license      MIT
// ==/UserScript==

(function () {
  'use strict';
  
  const style = `
#all-tags+ul {
  position: fixed;
  right: 0;
  top: 0;
  z-index: 9;
  background: white;
  list-style: none;
  overflow-y: auto;
  bottom: 0;
  width: 200px;
  box-shadow: -1px 0 10px rgba(0,0,0,.1);
  box-sizing: border-box;
}
#all-tags + ul li {
  list-style: none;
}
#all-tags + ul ul {
}
#all-tags + ul ul {
  padding-left: 0;
}
#all-tags + ul > li:first-child {
  margin-top: 20px;
}
#all-tags + ul>li>a {
  font-weight: bold;
  color: #666;
  font-size: 14px;
}
#all-tags + ul > li {
  margin-top: 10px;
}
body > .content {
  padding-right: 220px;
}
#all-tags + ul > li:last-child {
  margin-bottom: 50px;
}
`;

  GM_addStyle(style);

  function initial(style) {
    let headEle = document.head || document.getElementsByTagName('head')[0];
    let styleEle = document.createElement('style');

    styleEle.type = 'text/css';

    if (styleEle.styleSheet) {
      styleEle.styleSheet.cssText = style;
    } else {
      styleEle.appendChild(document.createTextNode(style));
    }

    headEle.appendChild(styleEle);
  }

  // initial(style);
})();