mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-11-18 00:23:36 +08:00
218 lines
5.6 KiB
HTML
218 lines
5.6 KiB
HTML
<!doctype html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<link rel="icon" type="image/svg+xml" href="/ray.svg" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title><%= siteInfo.title %></title>
|
|
<meta name="description" content="<%= siteInfo.description %>" />
|
|
<meta name="color-scheme" content="light dark" />
|
|
<script>
|
|
try {
|
|
const settings = JSON.parse(
|
|
localStorage.getItem('<%= storageKeys.appPiniaSettingStore %>') ||
|
|
'null',
|
|
)
|
|
const mode = settings?.appTheme
|
|
if (mode !== 'auto') {
|
|
const dark =
|
|
mode === 'dark' || (mode == null && settings?._appTheme === true)
|
|
document.documentElement.classList.add(
|
|
dark ? 'r-template--dark' : 'r-template--light',
|
|
)
|
|
}
|
|
} catch {}
|
|
try {
|
|
if (
|
|
localStorage.getItem('<%= storageKeys.localeLanguage %>') ===
|
|
'"en-US"'
|
|
) {
|
|
document.documentElement.lang = 'en-US'
|
|
}
|
|
} catch {}
|
|
</script>
|
|
<style>
|
|
html.r-template--dark {
|
|
color-scheme: dark;
|
|
}
|
|
html.r-template--light {
|
|
color-scheme: light;
|
|
}
|
|
|
|
.ray-boot {
|
|
position: fixed;
|
|
z-index: 1;
|
|
inset: 0;
|
|
display: grid;
|
|
place-items: center;
|
|
padding: 24px;
|
|
color: CanvasText;
|
|
color: light-dark(#182436, #e9eef7);
|
|
background: Canvas;
|
|
background: light-dark(#f8f9fc, #141b27);
|
|
font:
|
|
400 14px / 1.5 system-ui,
|
|
sans-serif;
|
|
text-align: center;
|
|
}
|
|
|
|
.ray-boot__mark {
|
|
display: block;
|
|
margin: 0 auto 16px;
|
|
border-radius: 16px;
|
|
}
|
|
|
|
.ray-boot__title {
|
|
display: block;
|
|
font-size: 24px;
|
|
font-weight: 650;
|
|
letter-spacing: -0.025em;
|
|
}
|
|
|
|
.ray-boot__label {
|
|
margin: 4px 0 0;
|
|
color: inherit;
|
|
color: light-dark(#52647c, #b3c0d3);
|
|
}
|
|
|
|
.ray-boot__track {
|
|
display: block;
|
|
position: relative;
|
|
overflow: hidden;
|
|
inline-size: 112px;
|
|
block-size: 3px;
|
|
margin: 20px auto 0;
|
|
border-radius: 4px;
|
|
background: currentColor;
|
|
background: light-dark(#dce4f2, #36435c);
|
|
}
|
|
|
|
.ray-boot__track::after {
|
|
position: absolute;
|
|
inset-block: 0;
|
|
inset-inline-start: 0;
|
|
inline-size: 40%;
|
|
border-radius: inherit;
|
|
background: Highlight;
|
|
background: light-dark(#3b63d9, #aabaff);
|
|
animation: ray-boot-sweep 1.45s ease-in-out infinite alternate;
|
|
content: '';
|
|
}
|
|
|
|
@keyframes ray-boot-sweep {
|
|
from {
|
|
transform: translateX(0);
|
|
}
|
|
to {
|
|
transform: translateX(150%);
|
|
}
|
|
}
|
|
|
|
.ray-boot progress {
|
|
position: absolute;
|
|
inline-size: 1px;
|
|
block-size: 1px;
|
|
clip-path: inset(50%);
|
|
}
|
|
|
|
.ray-boot__failure,
|
|
.ray-boot [lang='en-US'] {
|
|
display: none;
|
|
}
|
|
|
|
html:lang(en) .ray-boot [lang='zh-CN'] {
|
|
display: none;
|
|
}
|
|
|
|
html:lang(en) .ray-boot [lang='en-US'] {
|
|
display: inline;
|
|
}
|
|
|
|
.ray-boot[data-state='failed'] .ray-boot__pending {
|
|
display: none;
|
|
}
|
|
|
|
.ray-boot[data-state='failed'] .ray-boot__failure {
|
|
display: block;
|
|
}
|
|
|
|
.ray-boot__retry {
|
|
margin-block-start: 12px;
|
|
padding: 5px 12px;
|
|
border: 1px solid currentColor;
|
|
border-radius: 6px;
|
|
background: transparent;
|
|
color: inherit;
|
|
font: inherit;
|
|
cursor: pointer;
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.ray-boot__track::after {
|
|
animation: none;
|
|
transform: translateX(75%);
|
|
}
|
|
}
|
|
</style>
|
|
<noscript>
|
|
<style>
|
|
#pre-loading-animation {
|
|
display: none;
|
|
}
|
|
</style>
|
|
</noscript>
|
|
</head>
|
|
<body>
|
|
<div id="app"></div>
|
|
<noscript>
|
|
<main>
|
|
<h1><%= siteInfo.title %></h1>
|
|
<p><%= siteInfo.description %></p>
|
|
<p>启用 JavaScript 后可体验在线演示。</p>
|
|
<p>
|
|
<a href="<%= siteInfo.repository %>">GitHub 源码</a>
|
|
·
|
|
<a href="<%= siteInfo.repository %>/blob/main/README.zh-CN.md"
|
|
>中文使用指南</a
|
|
>
|
|
</p>
|
|
</main>
|
|
</noscript>
|
|
<div id="pre-loading-animation" class="ray-boot">
|
|
<div>
|
|
<img
|
|
class="ray-boot__mark"
|
|
src="/ray.svg"
|
|
width="56"
|
|
height="56"
|
|
alt=""
|
|
/>
|
|
<strong class="ray-boot__title"><%= preloadingConfig.title %></strong>
|
|
<div class="ray-boot__pending">
|
|
<p class="ray-boot__label" id="ray-boot-label">
|
|
<span lang="zh-CN">正在载入工作区</span>
|
|
<span lang="en-US">Loading your workspace</span>
|
|
</p>
|
|
<progress aria-labelledby="ray-boot-label"></progress>
|
|
<span class="ray-boot__track" aria-hidden="true"></span>
|
|
</div>
|
|
<div class="ray-boot__failure" role="alert">
|
|
<p class="ray-boot__label">
|
|
<span lang="zh-CN">工作区未能启动</span>
|
|
<span lang="en-US">The workspace could not start</span>
|
|
</p>
|
|
<button
|
|
class="ray-boot__retry"
|
|
type="button"
|
|
onclick="location.reload()"
|
|
>
|
|
<span lang="zh-CN">重新加载</span>
|
|
<span lang="en-US">Reload</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script type="module" src="/src/main.ts"></script>
|
|
</body>
|
|
</html>
|