// ==UserScript==
// @name 校园网登录美化
// @namespace https://bbs.tampermonkey.net.cn/
// @version 0.1.0
// @description 适用于江苏信息职业技术学院的登录界面美化
// @author 雪中明月
// @match http://10.11.0.10/
// ==/UserScript==
(function () {
'use strict';
// 随机图片API
var background_api = "https://www.dmoe.cc/random.php"
get_edit()
function get_edit() {
// 重写标题
var mt_head = document.querySelector(".mt_head")
mt_head.innerHTML = `
苏信校园网登录
`
mt_head.style.cursor = "default"
var mt_body = document.querySelector(".mt_body")
mt_body.style.top = "90px"
// 输入框优化
var ISP_select = document.querySelector(`div.mt_body > div:nth-child(1) > div > select`)
var username = document.querySelector("div.mt_body > div:nth-child(1) > div > form > input:nth-child(3)")
var password = document.querySelector("div.mt_body > div:nth-child(1) > div > form > input:nth-child(4)")
username.placeholder = "Username"
password.placeholder = "Password"
ISP_select.style = `
top: 12px;
left: 21px;
width: 320px;
height: 50px;
font-size: 20px;
border-radius: 15px;
text-align: left;
color: rgb(127, 127, 127);
border: 3px solid transparent;
text-align: center;
position: absolute;
transition: 0.5s
background-color: rgb(255, 255, 255);`
ISP_select.selectedIndex = "请选择运营商"
username.style = `
top: 79px;
left: 21px;
width: 320px;
height: 50px;
font-size: 20px;
border-radius: 15px;
text-align: left;
color: rgb(127, 127, 127);
text-align: center;
position: absolute;
border: 3px solid transparent;
transition: border 0.5s;
background-color: rgb(255, 255, 255);`
password.style = `
top: 146px;
left: 21px;
width: 320px;
height: 50px;
font-size: 20px;
border: 3px solid transparent;
border-radius: 15px;
text-align: left;
color: rgb(127, 127, 127);
text-align: center;
position: absolute;
transition: 0.5s
background-color: rgb(255, 255, 255);`
ISP_select.addEventListener("focus", function () {
ISP_select.style = `
top: 12px;
left: 21px;
width: 320px;
height: 50px;
font-size: 20px;
border-radius: 15px;
text-align: left;
color: rgb(127, 127, 127);
text-align: center;
position: absolute;
transition: 0.5s;
border: 3px solid black;
background-color: rgb(255, 255, 255);`
})
ISP_select.addEventListener("blur", function () {
ISP_select.style = `
top: 12px;
left: 21px;
width: 320px;
height: 50px;
font-size: 20px;
border-radius: 15px;
text-align: left;
color: rgb(127, 127, 127);
text-align: center;
position: absolute;
transition: 0.5s;
border: 3px solid transparent;
background-color: rgb(255, 255, 255);`
})
username.addEventListener("focus", function () {
username.style = `
top: 79px;
left: 21px;
width: 320px;
height: 50px;
font-size: 20px;
border-radius: 15px;
text-align: left;
color: rgb(127, 127, 127);
text-align: center;
position: absolute;
transition: 0.5s;
border: 3px solid black;
background-color: rgb(255, 255, 255);`
})
username.addEventListener("blur", function () {
username.style = `
top: 79px;
left: 21px;
width: 320px;
height: 50px;
font-size: 20px;
border-radius: 15px;
text-align: left;
color: rgb(127, 127, 127);
text-align: center;
position: absolute;
transition: 0.5s;
border: 3px solid transparent;
background-color: rgb(255, 255, 255);`
})
password.addEventListener("focus", function () {
password.style = `
top: 146px;
left: 21px;
width: 320px;
height: 50px;
font-size: 20px;
border-radius: 15px;
text-align: left;
color: rgb(127, 127, 127);
text-align: center;
position: absolute;
transition: 0.5s;
border: 3px solid black;
background-color: rgb(255, 255, 255);`
})
password.addEventListener("blur", function () {
password.style = `
top: 146px;
left: 21px;
width: 320px;
height: 50px;
font-size: 20px;
border-radius: 15px;
text-align: left;
color: rgb(127, 127, 127);
text-align: center;
position: absolute;
transition: 0.5s;
border: 3px solid transparent;
background-color: rgb(255, 255, 255);`
})
// 提交按钮
var submit = document.querySelector("div.mt_body > div:nth-child(1) > div > form > input:nth-child(1)")
submit.style = `
top: 212px;
left: 60px;
width: 240px;
height: 48px;
position: absolute;
background-color: transparent;
font-size: 30px;`
submit.addEventListener("mouseenter", function () {
submit.style = `
top: 212px;
left: 60px;
width: 240px;
height: 48px;
position: absolute;
background-color: transparent;
border-bottom: 2px solid grey;
transition: 0.5s;
font-size: 30px;`
})
submit.addEventListener("mouseleave", function () {
submit.style = `
top: 212px;
left: 60px;
width: 240px;
height: 48px;
position: absolute;
border-bottom: 2px solid transparent;
transition: 0.5s;
background-color: transparent;
font-size: 30px;`
})
// 背景移除
var background = document.querySelector(".edit_cell.edit_image.ui-resizable-autohide")
var new_background = document.querySelector("body")
background.remove()
new_background.style.background = `url("https://www.dmoe.cc/random.php") center center no-repeat`
new_background.style.backgroundSize = "cover"
// 登录窗口
var login_window = document.querySelector(".edit_cell.edit_moreTabs.ui-resizable-autohide")
login_window.style = `
inset: 155px auto auto 50%;
width: 360px;
height: 372px;
background-color: rgb(246, 246, 246);
border-radius: 35px;
box-shadow: rgba(0, 0, 0, 0.5) 10px 10px 30px;
border-color: rgb(51, 51, 51);
transform: translateX(-50%);`
// 底部提示移除
var tip = document.querySelectorAll("div.edit_cell.edit_prog.ui-resizable-autohide")[1]
var tip_2 = document.querySelectorAll(".edit_row.ui-resizable-autohide")[1]
tip.remove()
try {
tip_2.remove()
} catch {
console.log("not mobile")
}
var cursor = document.createElement("script").setAttribute("src", "https://xn--fiqz59cpva341l.top/js/cursor2.js");
}
})();