洛谷美化脚本
  • 板块灌水区
  • 楼主Perry6632
  • 当前回复17
  • 已保存回复17
  • 发布时间2024/8/22 10:34
  • 上次更新2024/8/22 13:02:16
查看原帖
洛谷美化脚本
934631
Perry6632楼主2024/8/22 10:34

洛谷美化脚本
有动态效果所以没图

// ==UserScript==
// @name         洛谷
// @namespace    http://tampermonkey.net/
// @version      2024-08-20
// @description  try to take over the world!
// @author       perry6632
// @match        https://www.luogu.com.cn/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=cnblogs.com
// @grant        none
// ==/UserScript==

(function() {
  'use strict';
  var fn=function(){
    var a=document.querySelector('.footer');
    if(a){
        a.parentNode.removeChild(a);
    }
    var b=document.getElementsByClassName("lg-article");
    if(b){
        for(let i=0;i<b.length;i++){
            b[i].onmouseover = function (){
                b[i].style.transition="transform .3s";
                b[i].style.transform="scale(1.02)";
            };
            b[i].onmouseout = function (){
                b[i].style.transition="transform .3s";
                b[i].style.transform="scale(1)";
            };
            b[i].style.boxShadow="0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)";
            b[i].style.borderRadius="10px";
        }
    }
    var d=document.getElementsByClassName("card");
    if(d){
        for(let i=0;i<d.length;i++){
            d[i].onmouseover = function (){
                d[i].style.transition="transform .3s";
                d[i].style.transform="scale(1.02)";
            };
            d[i].onmouseout = function (){
                d[i].style.transition="transform .3s";
                d[i].style.transform="scale(1)";
            };
            d[i].style.boxShadow="0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)";
            d[i].style.borderRadius="10px";
        }
    }
    /*
    var e=document.getElementsByClassName("lfe-body mobile-body");
    if(e){
        for(let i=0;i<e.length;i++){
            e[i].style.background="url(https://cdn.luogu.com.cn/upload/image_hosting/zx5zcyah.png) fixed";
            e[i].style.backgroundSize="cover";
        }
    }
    */
    setTimeout(fn,10)
  };
  fn()

})();
2024/8/22 10:34
加载中...