lanhuapp

try to take over the world!

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         lanhuapp
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       lbc
// @email        [email protected]
// @match        https://lanhuapp.com/web/
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    window.curRemPanel = {}
    window.addRemPanel = function() {
        let a = window.dd.children[ window.dd.children.length - 1].cloneNode(true)
        let html = a.innerHTML.replace(/(\d*)px/g, function(match, a) {
            return `${a / 100}rem`
        })
        a.innerHTML = html
        window.dd.appendChild(a)
        window.curRemPanel = a
    }

    window.onload = function() {
       setTimeout(() => {
        let aside = dd.parentElement.parentElement.parentElement

        var mutationObserver = new MutationObserver(function(mutations) {
            mutations.forEach(function(mutation) {
                if (mutation.attributeName === 'class') {
                    console.log(aside.className)
                     if (aside.className.indexOf('open') > -1) {
                         setTimeout(() => {
                              window.addRemPanel()
                         }, 1000)
                     } else {
  window.curRemPanel.remove()
                     }
                }
            });
        });

        mutationObserver.observe(aside, {
            attributes: true,

            childList: true,
        });
       }, 1000)
    }

})();