-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview.html
More file actions
108 lines (102 loc) · 3.64 KB
/
view.html
File metadata and controls
108 lines (102 loc) · 3.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Redirecting...</title>
<style>
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--card: 0 0% 100%;
--card-foreground: 222.2 84% 4.9%;
--border: 214.3 31.8% 91.4%;
--muted: 210 40% 98%;
--muted-foreground: 215.4 16.3% 46.9%;
--primary: 222.2 47.4% 11.2%;
}
@media (prefers-color-scheme: dark) {
:root {
--background: 222.2 84% 4.9%;
--foreground: 210 40% 98%;
--card: 222.2 84% 4.9%;
--card-foreground: 210 40% 98%;
--border: 217.2 32.6% 17.5%;
--muted: 217.2 32.6% 17.5%;
--muted-foreground: 215 20.2% 65.1%;
--primary: 210 40% 98%;
}
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
margin: 0;
background-color: hsl(var(--background));
color: hsl(var(--foreground));
line-height: 1.5;
}
.container {
text-align: center;
padding: 2rem;
background-color: hsl(var(--card));
border: 1px solid hsl(var(--border));
border-radius: 0.5rem;
box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
max-width: 400px;
width: 90%;
}
.spinner {
width: 24px;
height: 24px;
border: 2px solid hsl(var(--muted));
border-top: 2px solid hsl(var(--primary));
border-radius: 50%;
animation: spin 1s linear infinite;
margin: 0 auto 1rem;
}
h2 {
font-size: 1.25rem;
font-weight: 600;
margin: 0 0 0.5rem 0;
color: hsl(var(--foreground));
}
p {
font-size: 0.875rem;
color: hsl(var(--muted-foreground));
margin: 0;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class="container">
<div class="spinner"></div>
<h2>Redirecting...</h2>
<p>Please wait while we redirect you to the translation page.</p>
</div>
<script>
// 獲取當前 URL 的參數
const currentUrl = new URL(window.location.href);
const params = currentUrl.searchParams;
// 構建目標 URL
const baseUrl = window.location.origin + window.location.pathname.replace("/view.html", "/");
let targetUrl = baseUrl + "#view";
// 如果有參數,添加到 hash 後面
if (params.toString()) {
targetUrl += "?" + params.toString();
}
// 立即重定向
window.location.href = targetUrl;
</script>
</body>
</html>