不要乱玩,因为真的会
转载产物,消掉了一些我觉得不好的东西,仅图一乐
// 页面特效样式
var styleTag = document.createElement( "style" );
styleTag.innerHTML = `
@keyframes glitch {
0% {
transform: skew(0);
opacity: 1;
}
25% {
transform: skew(5deg);
opacity: 0.8;
}
50% {
transform: skew(-5deg);
opacity: 1;
}
75% {
transform: skew(2deg);
opacity: 0.9;
}
100% {
transform: skew(0);
opacity: 1;
}
}
body {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: -1;
background: linear-gradient(to right, #00f, #f00, #0f0, #ff0, #0ff, #f0f, #00f);
background-size: 200% auto;
animation: glitch 5s infinite;
}`;
document.head.appendChild( styleTag );
// 创建弹窗
let popupMessage = "恭喜你被JC了!</br>想要学习如何JC他人?还是别了吧";
let popupDiv = document.createElement( "div" );
popupDiv.innerHTML = popupMessage;
// 设置弹窗的样式
popupDiv.style.position = "fixed";
popupDiv.style.top = "50%";
popupDiv.style.left = "50%";
popupDiv.style.transform = "translate(-50%, -50%)";
popupDiv.style.background = "#fff";
popupDiv.style.padding = "20px";
popupDiv.style.border = "1px solid #000";
popupDiv.style.zIndex = "9999";
document.body.appendChild( popupDiv );
// 延迟函数
function sleep ( ms ) {
return new Promise( ( resolve ) => setTimeout( resolve, ms ) );
}
async function fetchAPI ( url, method, body ) {
const headers = {
"content-type": "application/json",
"referer": "https://www.luogu.com.cn/",
"x-csrf-token": document.querySelector( "meta[name=csrf-token]" )
.content,
};
const response = await fetch( url, {
method,
headers,
body: JSON.stringify( body ),
} );
if ( !response.ok ) {
throw new Error( `API request failed with status ${response.status}` );
}
const json = await response.json();
return json;
};食用方法: 复制上面的代码,按下F12,在控制台/Console的命令行中粘贴,按下回车
祝君愉快(?)