您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Allows the user to customize the background image and some visual test.
当前为
// ==UserScript== // @name Kindroid Tools // @namespace http://tampermonkey.net/ // @version 0.1 // @description Allows the user to customize the background image and some visual test. // @match https://kindroid.ai/home // @grant GM_setValue // @grant GM_getValue // @info By TenPassion // @license GNU GPLv3 // ==/UserScript== (function() { 'use strict'; // Function to change text function changeText(elements) { const text1 = document.querySelector('.css-19hb772'); const text2 = document.querySelector('.css-ppua9z'); elements.forEach(function(element) { element.textContent = text1.textContent + ' x ' + text2.textContent + ' on Kindroid '; }); } // Function to remove elements based on XPath function removeElements(xpath) { const elementsToRemove = document.evaluate(xpath, document, null, XPathResult.ANY_TYPE, null); let element = elementsToRemove.iterateNext(); while (element) { element.parentNode.removeChild(element); element = elementsToRemove.iterateNext(); } } // Function to change the background image function changeBackground(imageURL) { const targetElement = document.querySelector('.css-1lvpjll'); if (targetElement) { // Remove the old background image const oldBackground = targetElement.style.backgroundImage; if (oldBackground !== 'none') { URL.revokeObjectURL(oldBackground); } targetElement.style.backgroundImage = 'none'; if (imageURL !== '') { targetElement.style.backgroundImage = `url("${imageURL}")`; targetElement.style.backgroundSize = 'cover'; targetElement.style.backgroundRepeat = 'no-repeat'; } } } // Function to adjust opacity of 'css-teti0a' and 'css-100dd8p' elements function adjustOpacityTeti0a() { const elementsToAdjust = document.querySelectorAll('.css-teti0a, .css-1j9xj7u'); elementsToAdjust.forEach(function(element) { element.style.opacity = '0.9'; }); } // Function to adjust opacity of 'css-100dd8p' elements function adjustOpacity100dd8p() { const elementsToAdjust = document.querySelectorAll('.css-100dd8p'); elementsToAdjust.forEach(function(element) { element.style.opacity = '0.9'; }); } // Function to handle file selection for custom background image function handleFileSelect(event) { const file = event.target.files[0]; if (file) { const reader = new FileReader(); reader.onload = function(e) { const imageURL = e.target.result; GM_setValue('customImageURL', imageURL); changeBackground(imageURL); }; reader.readAsDataURL(file); } } // Create a hidden file input element for image customization const fileInput = document.createElement('input'); fileInput.type = 'file'; fileInput.style.display = 'none'; fileInput.addEventListener('change', handleFileSelect); // Create a button for customizing the background image const customImageButton = document.createElement('button'); customImageButton.textContent = '😈'; customImageButton.style.position = 'fixed'; customImageButton.style.bottom = '10px'; customImageButton.style.right = '10px'; customImageButton.style.zIndex = '9999'; customImageButton.addEventListener('click', function() { fileInput.click(); }); // Append the file input and custom image button to the document body document.body.appendChild(fileInput); document.body.appendChild(customImageButton); // Get the URL of the custom image from local storage const customImageURL = GM_getValue('customImageURL', ''); if (customImageURL !== '') { changeBackground(customImageURL); } // Add an event listener to re-display the image when the page is loaded window.addEventListener('load', function() { const customImageURL = GM_getValue('customImageURL', ''); if (customImageURL !== '') { changeBackground(customImageURL); } }); // Use MutationObserver to watch for changes in the DOM const observer = new MutationObserver(function(mutationsList, observer) { for (let mutation of mutationsList) { if (mutation.type === 'childList') { const elements = document.querySelectorAll('.chakra-text.css-s68iw5'); if (elements.length > 0) { changeText(elements); adjustOpacityTeti0a(); adjustOpacity100dd8p(); } removeElements('//header/div[2]/a[1]/*[1]'); removeElements('//header/div[2]/a[2]/*[1]'); } } }); observer.observe(document.body, { childList: true, subtree: true }); // Initial adjustments adjustOpacityTeti0a(); adjustOpacity100dd8p(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址