一个很好玩的小程序……
看到油猴这玩意挺好玩,就字写了一份代码……
说明:让洛谷界面翻转一百八十度(太菜了,只会写这个)
纯恶搞使用……
::::info[代码]
// ==UserScript==
// @name 洛谷页面垂直翻转
// @namespace https://luogu.com.cn/
// @version 1.0
// @description 将洛谷整个界面垂直翻转180度
// @author Musphy
// @match *://*.luogu.com.cn/*
// @grant none
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
const style = document.createElement('style');
style.textContent = `
html, body {
transform: rotate(180deg);
transform-origin: center center;
min-height: 100vh;
width: 100vw;
overflow-x: hidden;
}
.lg-container, #app, .main-container {
transform: rotate(180deg);
transform-origin: center center;
width: 100%;
}
`;
// 插入样式到页面头部
document.head.appendChild(style);
const observer = new MutationObserver(() => {
document.body.style.transform = 'rotate(180deg)';
});
observer.observe(document.body, {
childList: true,
subtree: true
});
})();
::::
最后附上效果图: