This commit is contained in:
make
2025-05-07 10:42:20 +08:00
parent 6c8a77a123
commit e404014c66
2 changed files with 52 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -17,6 +18,7 @@
height: 100vh; height: 100vh;
color: #333; color: #333;
} }
.container { .container {
max-width: 500px; max-width: 500px;
padding: 20px; padding: 20px;
@@ -24,29 +26,47 @@
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 8px; border-radius: 8px;
} }
h1 { h1 {
font-size: 48px; font-size: 48px;
margin-bottom: 20px; margin-bottom: 20px;
color: #e74c3c; color: #e74c3c;
} }
p { p {
font-size: 16px; font-size: 16px;
margin-bottom: 10px; margin-bottom: 10px;
} }
a { a {
color: #3498db; color: #3498db;
text-decoration: none; text-decoration: none;
} }
a:hover { a:hover {
text-decoration: underline; text-decoration: underline;
} }
.countdown { .countdown {
font-weight: bold; font-weight: bold;
color: #e74c3c; color: #e74c3c;
} }
</style> </style>
<script> <script>
// let countdown = 5;
// function startCountdown() {
// const countdownElement = document.getElementById('countdown');
// const interval = setInterval(() => {
// countdown--;
// countdownElement.textContent = countdown;
// if (countdown <= 0) {
// clearInterval(interval);
// window.history.back();
// }
// }, 1000);
// }
let countdown = 5; let countdown = 5;
function startCountdown() { function startCountdown() {
const countdownElement = document.getElementById('countdown'); const countdownElement = document.getElementById('countdown');
const interval = setInterval(() => { const interval = setInterval(() => {
@@ -54,12 +74,21 @@
countdownElement.textContent = countdown; countdownElement.textContent = countdown;
if (countdown <= 0) { if (countdown <= 0) {
clearInterval(interval); clearInterval(interval);
window.history.back(); // Check if there is a previous page in history
if (document.referrer) {
window.history.back();
} else {
window.location.href = '/'; // Redirect to home if no previous page
}
} }
}, 1000); }, 1000);
} }
// Start the countdown when the script loads
window.onload = startCountdown;
</script> </script>
</head> </head>
<body onload="startCountdown()"> <body onload="startCountdown()">
<div class="container"> <div class="container">
<h1>{$strErrCode}</h1> <h1>{$strErrCode}</h1>
@@ -69,4 +98,5 @@
<p>或者 <a href="/">点击这里返回首页</a></p> <p>或者 <a href="/">点击这里返回首页</a></p>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -17,6 +18,7 @@
height: 100vh; height: 100vh;
color: #333; color: #333;
} }
.container { .container {
max-width: 500px; max-width: 500px;
padding: 20px; padding: 20px;
@@ -24,22 +26,27 @@
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 8px; border-radius: 8px;
} }
h1 { h1 {
font-size: 48px; font-size: 48px;
margin-bottom: 20px; margin-bottom: 20px;
color: #e74c3c; color: #e74c3c;
} }
p { p {
font-size: 16px; font-size: 16px;
margin-bottom: 10px; margin-bottom: 10px;
} }
a { a {
color: #3498db; color: #3498db;
text-decoration: none; text-decoration: none;
} }
a:hover { a:hover {
text-decoration: underline; text-decoration: underline;
} }
.countdown { .countdown {
font-weight: bold; font-weight: bold;
color: #e74c3c; color: #e74c3c;
@@ -47,6 +54,7 @@
</style> </style>
<script> <script>
let countdown = 5; let countdown = 5;
function startCountdown() { function startCountdown() {
const countdownElement = document.getElementById('countdown'); const countdownElement = document.getElementById('countdown');
const interval = setInterval(() => { const interval = setInterval(() => {
@@ -54,12 +62,21 @@
countdownElement.textContent = countdown; countdownElement.textContent = countdown;
if (countdown <= 0) { if (countdown <= 0) {
clearInterval(interval); clearInterval(interval);
window.history.back(); // Check if there is a previous page in history
if (document.referrer) {
window.history.back();
} else {
window.location.href = '/'; // Redirect to home if no previous page
}
} }
}, 1000); }, 1000);
} }
// Start the countdown when the script loads
window.onload = startCountdown;
</script> </script>
</head> </head>
<body onload="startCountdown()"> <body onload="startCountdown()">
<div class="container"> <div class="container">
<h1>404</h1> <h1>404</h1>
@@ -69,4 +86,5 @@
<p>或者 <a href="/">点击这里返回首页</a></p> <p>或者 <a href="/">点击这里返回首页</a></p>
</div> </div>
</body> </body>
</html> </html>