madou+

显示缩略图

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==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);
})();