前往GreasyFork

吧啦吧啦

目前為 2021-12-08 提交的版本,檢視 最新版本

// ==UserScript==
// @name         前往GreasyFork
// @namespace    mimiko/greasyfork
// @version      0.0.2
// @description  吧啦吧啦
// @author       Mimiko
// @license      MIT
// @include      *
// @grant        GM.addStyle
// ==/UserScript==
// https://gf.qytechs.cn/zh-CN/scripts/436753-%E5%89%8D%E5%BE%80greasyfork

(() => {

  if (window.top !== window.self) return

  // function

  const insertHtml = () => {
    log('insertHtml')
    const $el = document.createElement('a')
    $el.setAttribute('href', `https://gf.qytechs.cn/zh-CN/scripts/by-site/${window.location.host.split('.').slice(-2).join('.')}?filter_locale=0`)
    $el.setAttribute('id', 'btn-jump-greasyfork')
    $el.setAttribute('target', '_blank')
    document.body.appendChild($el)
    return $el
  }

  const insertCss = () => {
    log('insertCss')
    GM.addStyle(`
      #btn-jump-greasyfork {
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 65535;
        width: 32px;
        height: 32px;
        background-color: rgb(153, 0, 0);
        border-radius: 0 32px 0 0;
        cursor: pointer;
        transition: all 0.3s ease;
        opacity: 0;
        transform-origin: left bottom;
        transform: scale(0.5);
      }
      #btn-jump-greasyfork:hover {
        opacity: 1;
        transform: scale(1);
      }
    `)
  }

  const log = (...args) => console.log('[GreasyFork]', ...args)

  const main = () => {
    insertCss()
    insertHtml()
  }

  // execute
  main()

})()

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址