madou+

显示缩略图

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         madou+
// @namespace    http://tampermonkey.net/
// @version      2025-06-30
// @description  显示缩略图
// @author       TT
// @match        https://madou.club/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=madou.club
// @grant        none
// ==/UserScript==

(function () {
  "use strict";

  const iframe = document.querySelector("iframe");
  if (!iframe) return;

  const videoId = iframe.src.split("/").at(-1);
  const imgurl = `https://dash.madou.club/videos/${videoId}/thumbnails.jpg`;

  const article = document.querySelector(".article-tags");
  if (!article) return;

  const thumbnailCount = 100;
  const thumbWidth = 160;
  const thumbHeight = 90;
  const thumbsPerRow = 5;

  const box = document.createElement("div");
  box.id = "abc";
  box.style.display = "flex";
  box.style.flexWrap = "wrap";
  box.style.gap = "0px";
  box.style.marginBottom = "1rem";

  for (let i = 0; i < thumbnailCount; i++) {
    const div = document.createElement("div");
    div.style.width = `${thumbWidth}px`;
    div.style.height = `${thumbHeight}px`;
    div.style.overflow = "hidden";
    div.style.flex = `0 0 auto`;

    const image = new Image();
    image.src = imgurl;
    image.style.maxWidth = "none";
    image.style.height = "100%";
    image.style.position = "relative";
    image.style.left = `-${thumbWidth * i}px`;

    div.appendChild(image);
    box.appendChild(div);
  }

  article.parentNode.insertBefore(box, article);
})();