Greasy Fork

Greasy Fork is available in English.

Fix "Show Another Film" Position

Positions the "Show Another Recommendation" link on Criticker.com statically below the Top Recommendation headline.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Fix "Show Another Film" Position
// @namespace    http://tampermonkey.net/
// @version      0.0.4
// @description  Positions the "Show Another Recommendation" link on Criticker.com statically below the Top Recommendation headline.
// @author       Alsweider
// @match        https://www.criticker.com/
// @match        https://games.criticker.com/
// @icon         https://www.criticker.com/favicon.ico
// @grant        none
// @license MIT
// ==/UserScript==

(function () {
    'use strict';

    const fixLinkPosition = () => {
        const mainRecDiv = document.querySelector('.rc_toprec'); // Hauptcontainer für die Top-Empfehlung
        const header = mainRecDiv?.querySelector('h3.bold'); // Überschrift "Top Recommendation"
        const linkDiv = mainRecDiv?.querySelector('.titlerow_showanother'); // "Show Another Recommendation"-Link

        if (mainRecDiv && header && linkDiv) {
            // Link an der alten Position entfernen, falls noch vorhanden
            document.querySelectorAll('.titlerow_showanother').forEach(el => {
                if (el !== linkDiv) el.remove();
            });

            // Falls der Link noch nicht an der richtigen Stelle ist, verschieben
            if (linkDiv.parentElement !== mainRecDiv) {
                mainRecDiv.insertBefore(linkDiv, header.nextSibling);
                linkDiv.style.marginTop = '-20px'; // Abstand nach oben
                linkDiv.style.marginBottom = '0px'; // Abstand nach unten
            }
        }
    };

    // MutationObserver zur Erkennung von Änderungen auf der Seite
    const observer = new MutationObserver(() => {
        fixLinkPosition();
    });

    observer.observe(document.body, { childList: true, subtree: true });

    // Initiales Fixieren des Links
    window.addEventListener('load', fixLinkPosition);
})();