Change on PTT.cc.
当前为
// ==UserScript==
// @name PTT Long Change
// @description Change on PTT.cc.
// @include https://www.ptt.cc/bbs/*
// @include https://iamchucky.github.io/PttChrome/*
// @version 1.0.0
// @grant none
// @namespace https://gf.qytechs.cn/users/154761
// ==/UserScript==
(function(){
//if(document.body.scrollTop>38.5)
document.body.background="https://images.urbanoutfitters.com/is/image/UrbanOutfitters/39566682_001_s";
document.getElementById('topbar-container').setAttribute('style','background:rgba(0, 0, 136, 0.4);opacity: 0;transition: opacity 0.3s;');
document.getElementById('topbar-container').setAttribute('onmouseout','document.getElementById(\'topbar-container\').setAttribute(\'style\',\'background:rgba(10, 106, 196, 0.4);opacity: 0;transition: opacity 0.3s;\');');
document.getElementById('topbar-container').setAttribute('onmouseover','document.getElementById(\'topbar-container\').setAttribute(\'style\',\'background:rgba(10, 106, 196, 0.4);opacity:1;\');');
document.getElementById('navigation-container').outerHTML="";
//document.getElementById('topbar-container').outerHTML="";
document.getElementsByClassName('right small')[1].outerHTML="";
document.getElementsByClassName('right small')[0].outerHTML="";
var metatext=document.getElementsByClassName('article-meta-value')[0].innerText;
var name = metatext.split(" ",1)[0];
var pushes = document.querySelectorAll(".push"),
i;
function createCount(i, base) {
var span = document.createElement("span");
span.className = "push-count push-tag";
span.style="color:grey;";
if(pushes.length >= 100){
if(i<100){span.textContent = " "+i+"樓 ";}
if(i<10){span.textContent = " "+i+"樓 ";}
if(i>=100){span.textContent = i+"樓 ";}
}
else{
if(i<10){span.textContent = " "+i+"樓 ";}
else {span.textContent = i+"樓 ";}
}
return span;
}
for (i = 0; i < pushes.length; i++) {
pushes[i].insertBefore(createCount(i + 1, pushes[i]), pushes[i].children[0]);
var id=document.getElementsByClassName('f3 hl push-userid')[i].innerText.trim();
if(id == name){
document.getElementsByClassName('f3 hl push-userid')[i].setAttribute('style','background-color:rgb(0,70,0);');}
document.getElementsByClassName('f3 hl push-userid')[i].setAttribute('id',id);
document.getElementsByClassName('f3 hl push-userid')[i].setAttribute('onclick','go(\'#\' + this.id);');
}
var script = document.createElement('script');
script.appendChild(document.createTextNode(go +';'));
(document.body || document.head || document.documentElement).appendChild(script);
function go(x){
var metatext=document.getElementsByClassName('article-meta-value')[0].innerText;
var name = metatext.split(" ",2)[1];
var all = document.querySelectorAll('.push');
for(var j=0; j<all.length; j++){
if(all[j].children[2].id == name){
all[j].children[2].style.backgroundColor = 'rgb(0,70,0)';}
else{
all[j].children[2].style.backgroundColor = '';}
}
var elements = document.querySelectorAll(x);
for(var i=0; i<elements.length; i++) {
if(elements[i].getAttribute('name') == 'pri'){
if(elements[i].id==name){
elements[i].style.backgroundColor='rgb(0,70,0)';}
else{
elements[i].style.backgroundColor='';}
elements[i].removeAttribute('name');}
else{
elements[i].style.backgroundColor='rgb(0,0,90)';
elements[i].setAttribute('name','pri');}
}
}
})();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址