3Hentai PervertMonkey

Infinite scroll [optional], Filter by Title, thumb preview

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

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

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         3Hentai PervertMonkey
// @namespace    pervertmonkey
// @version      1.0.20
// @author       violent-orangutan
// @description  Infinite scroll [optional], Filter by Title, thumb preview
// @license      MIT
// @icon         https://www.google.com/s2/favicons?sz=64&domain=3hentai.net
// @homepage     https://github.com/smartacephale/sleazy-fork#readme
// @homepageURL  https://sleazyfork.org/en/users/1253342-smartacephale
// @source       https://github.com/smartacephale/sleazy-fork
// @supportURL   https://github.com/smartacephale/sleazy-fork/issues
// @match        https://*.3hentai.net/*
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/core/pervertmonkey.core.umd.js
// @grant        GM_addStyle
// @grant        unsafeWindow
// @run-at       document-idle
// ==/UserScript==

var ___core = window.pervertmonkey.core || pervertmonkey.core;
var ___utils = ___core;


(function(___core, ___utils) {
	"use strict";
	new ___core.Rules({
		containerSelectorLast: ".listing-container",
		thumbs: { selector: ".doujin-col" },
		thumb: { selectors: { title: ".title" } },
		thumbImg: { strategy: "auto" },
		gropeStrategy: "all-in-all",
		schemeOptions: [
			"Title Filter",
			"Badge",
			"Advanced"
		],
		animatePreview
	});
	function animatePreview() {
		const tick = new ___utils.Tick(500, false);
		const end = 9999;
		function rotate(src) {
			return src.replace(/(\d+)(?=t\.jpg$)/, (_, n) => `${(0, ___utils.circularShift)(parseInt(n), end)}`);
		}
		___utils.OnHover.create(document.body, ".doujin-col", (e) => {
			const img = e.querySelector("img");
			const origin = img.src;
			img.src = img.src.replace(/\w+\.\w+$/, "1t.jpg");
			img.onerror = (_) => tick.stop();
			tick.start(() => {
				img.src = rotate(img.src);
			}, () => {
				img.src = origin;
			});
			return () => tick.stop();
		});
	}
})(___core, ___utils);