s.to - Minified for Laptop

Minimize page elements to fit smaller screens and added some QoL.

当前为 2022-08-01 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         s.to - Minified for Laptop
// @namespace    https://greasyfork.org/users/928242
// @version      0.6
// @description  Minimize page elements to fit smaller screens and added some QoL.
// @author       Kamikaze (https://github.com/Kamiikaze)
// @iconURL      https://s.to/favicon.ico
// @match        https://s.to/serie/stream/*
// @match        https://serien.sx/serie/stream/*
// @match        https://anicloud.io/anime/stream/*
// @match        https://aniworld.to/anime/stream/*
// @grant        none
// @license      MIT
// ==/UserScript==

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css.replace(/;/g, ' !important;');
    head.appendChild(style);
}

// FIX: Force closing Dropdown Menu on MouseLeave
function closeMenuOnHoverLeave() {
    const menu = document.querySelector(".dd")
    const modal = document.querySelector(".modal")

    menu.addEventListener('mouseleave', () => {
        modal.style = "display:none"
    })
}

// Sticky-Top Episode List
// addGlobalStyle('div#stream > ul:nth-of-type(2) { position: fixed; top: 0; width: 100%; z-index: 99; }');

addGlobalStyle(`

/* Reduce Height of Video player */
.inSiteWebStream, .inSiteWebStream iframe {
    height: 150px;
}

.hosterSiteTitle {
    padding: 5px 0 10px;
}

/* Hiding unnecessary page elements (Editing Descripting, Language Box..) and already seen episodes  */
.descriptionSpoilerLink, .descriptionSpoilerPlaceholder,
.submitNewDescription, .hosterSectionTitle, .changeLanguageBox,
.hosterSiteDirectNav ul li .seen {
    display: none;
}

/* Hiding content box of more episodes from the same series */
#wrapper > div.seriesContentBox > div.container.marginBottom > div:nth-child(4) > div:nth-child(13) {
    display: none;

`);

closeMenuOnHoverLeave()