// ==UserScript== // @name 脚本猫脚本站美化 // @namespace https://bbs.tampermonkey.net.cn/ // @version 0.2.3 // @description 脚本猫脚本站个性美化,向下滚动会出现返回顶部按钮! // @author 张仨 // @match https://scriptcat.org/* // @run-at document-start // @grant unsafeWindow // @grant GM_addStyle // @require https://code.jquery.com/jquery-3.6.0.min.js // ==/UserScript== $(function () { $( "
" ).appendTo( "body" ); $(window).scroll(function () { var scroHei = $(window).scrollTop(); if (scroHei > 500) { $('.back-to-top').css('top', '-200px'); } else { $('.back-to-top').css('top', '-999px'); } }) $('.back-to-top').click(function () { $('body,html').animate({ scrollTop: 0 }, 600); }) }) GM_addStyle(` /*背景*/ body{ background-image: url(https://img30.360buyimg.com/pop/jfs/t1/103195/35/25753/886812/623dc5afE76b0f9fd/917d28dbcacb8348.jpg) !important; background-repeat: no-repeat; background-position: top; background-attachment: fixed; } /*导航栏*/ .q-header, .q-toolbar{ background: rgba(0,0,0,0) !important; height: 45px !important; } /*底部导航*/ .q-footer{ display: none !important; } /*LOGO*/ .logo-title{ color: #d0e2f6 !important; } /*字体*/ .text-black { color: #2e6ad8 !important; } /*标题*/ .text-h4{ color: #477bc4 !important; } .q-card, .show-mess-page{ background: rgba(255,255,255,0.6) !important; margin-top: 10px !important; padding: 0px 15px !important; border-radius: 7px !important; } .show-mess-page, .justify-end{ background: rgba(0,0,0,0) !important; } .back-to-top { position: fixed; right: 80px; top: -900px; z-index: 2; width: 70px; height: 900px; cursor: pointer; background: url(https://gitee.com/MarHangover/images/raw/master/image/scroll.png); transition: all .5s ease-in-out; opacity: 1; } .back-to-top { -webkit-animation: float 2s linear infinite; animation: float 2s linear infinite } @media (max-width:1000px) { .back-to-top { display: none !important; } } @-webkit-keyframes float { 0% { -webkit-transform: translateY(0); transform: translateY(0) } 50% { -webkit-transform: translateY(-6px); transform: translateY(-6px) } 100% { -webkit-transform: translateY(0); transform: translateY(0) } } @keyframes float { 0% { -webkit-transform: translateY(0); -ms-transform: translateY(0); transform: translateY(0) } 50% { -webkit-transform: translateY(-6px); -ms-transform: translateY(-6px); transform: translateY(-6px) } 100% { -webkit-transform: translateY(0); -ms-transform: translateY(0); transform: translateY(0) } } `)