154 lines
5.8 KiB
HTML
154 lines
5.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<link rel="icon" type="image/svg+xml" href="/logo.png" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title><%- title %></title>
|
|
</head>
|
|
<body>
|
|
<div id="app">
|
|
<style>
|
|
html,
|
|
body,
|
|
#app {
|
|
width: 100%;
|
|
height: 100%;
|
|
padding: 0;
|
|
margin: 0;
|
|
font-size: 12px !important;
|
|
}
|
|
.loading-box {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
.loading-box .loading-wrap {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 98px;
|
|
}
|
|
.dot {
|
|
position: relative;
|
|
box-sizing: border-box;
|
|
display: inline-block;
|
|
width: 32px;
|
|
height: 32px;
|
|
font-size: 32px;
|
|
transform: rotate(45deg);
|
|
animation: ant-rotate 1.2s infinite linear;
|
|
}
|
|
.dot i {
|
|
position: absolute;
|
|
display: block;
|
|
width: 14px;
|
|
height: 14px;
|
|
background-color: #409eff;
|
|
border-radius: 100%;
|
|
opacity: 0.3;
|
|
transform: scale(0.75);
|
|
transform-origin: 50% 50%;
|
|
animation: ant-spin-move 1s infinite linear alternate;
|
|
}
|
|
.dot i:nth-child(1) {
|
|
top: 0;
|
|
left: 0;
|
|
}
|
|
.dot i:nth-child(2) {
|
|
top: 0;
|
|
right: 0;
|
|
animation-delay: 0.4s;
|
|
}
|
|
.dot i:nth-child(3) {
|
|
right: 0;
|
|
bottom: 0;
|
|
animation-delay: 0.8s;
|
|
}
|
|
.dot i:nth-child(4) {
|
|
bottom: 0;
|
|
left: 0;
|
|
animation-delay: 1.2s;
|
|
}
|
|
|
|
@keyframes ant-rotate {
|
|
to {
|
|
transform: rotate(405deg);
|
|
}
|
|
}
|
|
|
|
@keyframes ant-spin-move {
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
}
|
|
</style>
|
|
<div class="loading-box">
|
|
<div class="loading-wrap">
|
|
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
// 默认布局设置
|
|
const globalState = JSON.parse(window.localStorage.getItem("gw-global"));
|
|
if (globalState) {
|
|
const dot = document.querySelectorAll(".dot i");
|
|
const html = document.querySelector("html");
|
|
dot.forEach(item => (item.style.background = globalState.primary));
|
|
if (globalState.isDark) html.style.background = "#141414";
|
|
}
|
|
</script>
|
|
<script type="module" src="/src/main.ts"></script>
|
|
<script>
|
|
// let gwUser = JSON.parse(localStorage.getItem("gw-user"));
|
|
|
|
// if (gwUser) {
|
|
// const { phpToken, refreshToken } = gwUser;
|
|
// function offline() {
|
|
// const pathurl = localStorage.getItem("baseUrl") + `uc/offline`;
|
|
// fetch(pathurl, {
|
|
// method: "POST",
|
|
// credentials: "include",
|
|
// keepalive: true,
|
|
// headers: {
|
|
// Authorization: phpToken,
|
|
// "Refresh-Authorization": refreshToken
|
|
// }
|
|
// });
|
|
// }
|
|
// window.onbeforeunload = function (e) {
|
|
// offline();
|
|
// };
|
|
// var ua = window.navigator.userAgent.toLowerCase();
|
|
// var rkn =
|
|
// /\b(opera|chrome|webkit|safari|msie|firefox|gecko|qqbrowser|edg)\b(\s*(version|rv:|\/)*(\d+(\.\d+)*))?/g;
|
|
// window.addEventListener("mouseover", function () {
|
|
// window.removeEventListener("beforeunload", offline, true);
|
|
// ua.replace(rkn, function (match, type, all, rv, version) {
|
|
// if (type == "chrome" && parseInt(version) <= 86) {
|
|
// window.removeEventListener("unload", offline, true);
|
|
// }
|
|
// });
|
|
// });
|
|
|
|
// window.addEventListener("mouseout", function () {
|
|
// window.addEventListener("beforeunload", offline, true);
|
|
// ua.replace(rkn, function (match, type, all, rv, version) {
|
|
// if (type == "qqbrowser" || type == "edg" || (type == "chrome" && parseInt(version) <= 86)) {
|
|
// window.addEventListener("unload", offline, true);
|
|
// }
|
|
// });
|
|
// });
|
|
// if (window.location.pathnam !== "/login") {
|
|
// window.removeEventListener("beforeunload", offline);
|
|
// window.removeEventListener("unload", offline);
|
|
// }
|
|
// }
|
|
</script>
|
|
</body>
|
|
</html>
|