华为Cloud-V0.976

按钮

// ==UserScript==
// @name         华为Cloud-V0.976
// @icon         http://yy.boloni.cn/cm/images/favicon.ico
// @namespace    http://tampermonkey.net/
// @version      0.976
// @description  按钮
// @author       HEBI VISION
// @match        http://*/*
// @match        https://*/*
// @grant        GM_addStyle
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // 定义要查找并删除的元素的选择器
    const selectors = ['#app > div.find_phone.isWapFindPhone > div.map-content.eject > div.map-position > div > div > div.gd-map-kit > img,#app > div.find_phone.isWapFindPhone > div.map-content.eject > div.map-position > div > div > div:nth-child(1) > div > ul,#app > div.find_phone.isWapFindPhone > div.map-content.eject > div.map-position > div > div > div:nth-child(1) > div > div.map-scale.show,#app > div.find_phone.isWapFindPhone > div.master_detail > div > div.device_operation > div.device_BellNavi,#app > div.find_phone.isWapFindPhone > div.master_detail > div > div.device_operation > div.device_Control,#app > div.find_phone.isWapFindPhone > div.master_detail > div > div.device_operation > div.device_Modify > div,#app > div.find_phone.isWapFindPhone > div.master_detail > div > div.header > div.header_content > div.header_name_item,#app > div.find_phone.isWapFindPhone > div.wap-panel > div:nth-child(1) > div > div:nth-child(3) > div > ul > div > div.findPhone-device-content > div > div.findPhone-first-line > div.findPhone-device-name,#app > div.find_phone.isWapFindPhone > div.map-content.eject > div.map-position > div > div > div.gd-map-kit > div.amap-container > div.amap-maps > div.amap-layers > div > div > div > div > div > div > img,#app > div.find_phone.isWapFindPhone > div.wap-panel > div.findPhoneWap-bottomtab > div'];

     // 每0.5秒执行一次查找和删除操作
    setInterval(function() {
        selectors.forEach(selector => {
            const elements = document.querySelectorAll(selector);
            elements.forEach(element => {
                element.remove();
            });
        });
    }, 500);

window.setInterval(function () {
document.querySelector('#app > div.find_phone.isWapFindPhone > div.map-content.eject > div.map-position > div > div > div.gd-map-kit > div.amap-container > div.amap-maps > div.amap-layers > div > div > div > div > div > div > span > img').src = 'https://forum.huawei.com/enterprise/api/file/v1/small/thread/814944394301870080.gif?appid=esc_zh';
},500);
window.setInterval(function () {
document.querySelector('#app > div.find_phone.isWapFindPhone > div.wap-panel > div:nth-child(1) > div > div:nth-child(3) > div > ul > div > div.findPhone-device-img > span.deviceImg > img').src = 'https://forum.huawei.com/enterprise/api/file/v1/small/thread/814944394301870080.gif?appid=esc_zh';
},500);
//https://consumer.huawei.com/content/dam/huawei-cbg-site/cn/mkt/pdp/wearables/kids-watch-5x/images/s2/huawei-kids-watch-5x-all-round-guard-function-girl.gif

window.setInterval(function () {
    // 在这里指定要删除背景颜色的元素的选择器
    var selector = 'div.findPhone-device-img';
    // 获取所有匹配选择器的元素
    var elements = document.querySelectorAll(selector);
    // 遍历每个匹配的元素并删除背景颜色
    elements.forEach(function(element) {
        element.style.backgroundColor = 'transparent';
    });
},500);



//持续判断元素.svg-icon[data-v-48571be8]的height是不是2em

    // 持续判断元素.svg-icon[data-v-710c972e]的height是不是3em,并设置为3em
    function checkAndSetIconSize() {
        // 查找所有具有指定类的SVG图标元素.svg-icon[data-v-48571be8]
        const svgIcons = document.querySelectorAll('.svg-icon[data-v-48571be8]');

        svgIcons.forEach(icon => {
            // 获取当前高度和宽度
            const currentHeight = window.getComputedStyle(icon).height;
            const currentWidth = window.getComputedStyle(icon).width;

            // 设置目标高度和宽度
            const targetHeight = '4em';
            const targetWidth = '1.9169em';

            // 如果当前高度不等于目标高度,则设置高度为目标高度
            if (currentHeight !== targetHeight) {
                icon.style.height = targetHeight;
            }

            // 如果当前宽度不等于目标宽度,则设置宽度为目标宽度
            if (currentWidth !== targetWidth) {
                icon.style.width = targetWidth;
            }
        });
    }

    // 初始时执行一次
    checkAndSetIconSize();

    // 监听DOM变化,以便动态添加的元素也能被处理
    const observer = new MutationObserver(mutations => {
        mutations.forEach(mutation => {
            if (mutation.type === 'childList') {
                checkAndSetIconSize();
            }
        });
    });

    // 选择需要观察的节点,这里选择整个文档体,可以根据需要调整
    const targetNode = document.body;

    // 配置观察选项
    const config = { attributes: false, childList: true, subtree: true };

    // 开始观察目标节点
    observer.observe(targetNode, config);

//持续判断元素.svg-icon[data-v-48571be8]的height是不是2em结束



//持续判断元素transform: translate是不是(-40%, -100%)

    // 定义目标元素的选择器
    const elementSelector = '#app > div.find_phone.isWapFindPhone > div.map-content.eject > div.map-position > div > div > div.gd-map-kit > div.amap-container > div.amap-maps > div.amap-layers > div > div > div > div > div > div > span';

    // 定义一个函数,用于设置元素的transform属性
    function setElementTransform() {
        // 获取目标元素
        const targetElement = document.querySelector(elementSelector);

        if (targetElement) {
            // 强制设置元素的style.transform属性值
            targetElement.style.transform = 'translate(-50%, -290%)';
        } else {
            console.warn('目标元素未找到');
        }
    }

    // 初始执行一次
    setElementTransform();

    // 使用setInterval每0.5秒执行一次设置transform的函数
    setInterval(setElementTransform, 500);
    
    
    
  





})();