您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a floating tooltip with the ASMR's tags when you hover over the thumbnail.
当前为
// ==UserScript== // @name Japanese ASMR Tags Tooltip on hover // @namespace https://www.swcombine.com/ // @version 1.0 // @description Adds a floating tooltip with the ASMR's tags when you hover over the thumbnail. // @author code-syl // @match https://japaneseasmr.com/* // @icon https://external-content.duckduckgo.com/ip3/japaneseasmr.com.ico // @grant none // @require https://code.jquery.com/jquery-3.6.3.min.js // @license MIT // ==/UserScript== (function() { 'use strict'; const styles = ` .op-square:hover .syl-tooltip { display: flex; } .syl-tooltip { display: none; flex-direction: row; justify-content: center; gap: .5em; flex-wrap: wrap; background: #262626; padding: .7em !important; max-width: 100%; align-self: center; z-index: 1000; } `; /* add custom styles to the page */ let styleSheet = document.createElement('style'); styleSheet.innerText = styles; document.head.appendChild(styleSheet); /** * Inserts a node after another node * @param {Node} referenceNode A node to insert the new node after * @param {Node} newNode The node to insert */ function insertAfter(referenceNode, newNode) { referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); } const onLoad = () => { const mainThumbnails = document.querySelectorAll('.site-archive-post .op-square'); mainThumbnails.forEach((thumbnail) => { const link = thumbnail.querySelector('a'); let tooltip = document.createElement('div'); tooltip.classList.add('syl-tooltip', 'post-meta', 'post-tags'); insertAfter(link, tooltip); $.get(link.href, (data) => { const tags = $(data).find('a[rel=tag]').toArray(); tags.forEach((tag) => { tooltip.appendChild(tag); }); }); }); }; window.addEventListener('load', onLoad, false); })();