s.to - Minified for Laptop

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

目前為 2022-08-01 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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()