publink-zentao-beautify

售后宝禅道样式美化

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         publink-zentao-beautify
// @namespace    http://tampermonkey.net/
// @version      0.10
// @description  售后宝禅道样式美化
// @author       huangbc
// @include      *://*
// @license      MIT
// @icon         https://www.google.com/s2/favicons?sz=64&domain=shb.ltd
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    let styleElement = document.createElement('style')
    styleElement.textContent = `
    .header-btn .btn>.text { max-width: 550px !important; } 
    #globalSearchDiv { position: fixed; top: 9px; right: 250px; } 
    #globalSearchDiv .input-group { width: 260px; } 
    #searchbox .dropdown-menu.show-quick-go.with-active {top: 30px;    left: -2px;}
    #searchbox .dropdown-menu { top: 30px !important;  }
    #currentItem .text:nth-of-type(1) { display: none; }
    `
    document.body.append(styleElement)

    document.addEventListener('scroll', () => {
      try {
       const htmlElement = document.getElementsByTagName('html')[0]
       const scrollTop = htmlElement.scrollTop
       const searchElement = htmlElement.getElementById('globalSearchDiv')

       searchElement.style.display = scrollTop > 0 ? 'none' : 'block'

      } catch (error) {

      }
    })

    // Your code here...
})();