mirror of
https://github.com/Zhuym07/Tsumugiboshi.git
synced 2025-11-07 10:15:10 +08:00
添加PWA支持,创建manifest.json和service-worker.js,更新index.html以支持离线缓存和图标
This commit is contained in:
153
index.html
153
index.html
@@ -1,27 +1,54 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>TsumugiBoshi|纺星</title>
|
||||
<!-- Material Icons -->
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
|
||||
<!-- React 依赖 -->
|
||||
<!-- PWA 支持 -->
|
||||
<link rel="manifest" href="manifest.json">
|
||||
<meta name="theme-color" content="#1976d2">
|
||||
<link rel="apple-touch-icon" href="icons/icon-192x192.png">
|
||||
|
||||
<!-- OpenGraph 标签 -->
|
||||
<meta property="og:title" content="TsumugiBoshi|纺星">
|
||||
<meta property="og:description" content="神秘API调试工具">
|
||||
<meta property="og:image" content="icons/og-image.png">
|
||||
<meta property="og:url" content="https://your-domain.com">
|
||||
<meta property="og:type" content="website">
|
||||
|
||||
<title>TsumugiBoshi|纺星</title>
|
||||
<!--
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
||||
<script src="https://unpkg.com/react@17/umd/react.production.min.js"></script>
|
||||
<script src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"></script>
|
||||
<script src="https://unpkg.com/@babel/standalone@7.21.5/babel.min.js"></script>
|
||||
<script src="https://unpkg.com/@mui/material@5.14.0/umd/material-ui.production.min.js"></script>
|
||||
//-->
|
||||
|
||||
<!-- 使用本地js代替CDN -->
|
||||
|
||||
<!-- Material Icons -->
|
||||
<link rel="stylesheet" href="https://fonts.loli.net/icon?family=Material+Icons">
|
||||
|
||||
<!-- React 依赖 -->
|
||||
<script src="js\react.production.min.js"></script>
|
||||
<script src="js\react-dom.production.min.js"></script>
|
||||
|
||||
<!-- Babel -->
|
||||
<script src="https://unpkg.com/@babel/standalone@7.21.5/babel.min.js"></script>
|
||||
<script src="js\babel.min.js"></script>
|
||||
|
||||
<!-- Material UI 组件库 -->
|
||||
<script src="https://unpkg.com/@mui/material@5.14.0/umd/material-ui.production.min.js"></script>
|
||||
|
||||
<script src="js\material-ui.production.min.js"></script>
|
||||
|
||||
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: Arial, sans-serif;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font-size: 16px;
|
||||
}
|
||||
#root {
|
||||
flex: 1;
|
||||
@@ -79,39 +106,109 @@
|
||||
border-radius: 4px;
|
||||
}
|
||||
@media (max-width: 600px) {
|
||||
.MuiContainer-root {
|
||||
padding: 8px !important;
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
.MuiPaper-root {
|
||||
|
||||
.MuiContainer-root {
|
||||
padding: 12px !important;
|
||||
}
|
||||
|
||||
.MuiPaper-root {
|
||||
padding: 16px !important;
|
||||
margin-bottom: 16px !important;
|
||||
}
|
||||
|
||||
.MuiTypography-h4 {
|
||||
font-size: 1.5rem !important;
|
||||
font-size: 1.75rem !important;
|
||||
margin-bottom: 0.5rem !important;
|
||||
}
|
||||
|
||||
.MuiTypography-h6 {
|
||||
font-size: 1.1rem !important;
|
||||
font-size: 1.25rem !important;
|
||||
}
|
||||
|
||||
.MuiTab-root {
|
||||
min-height: 48px !important;
|
||||
padding: 6px 12px !important;
|
||||
font-size: 0.8rem !important;
|
||||
min-height: 56px !important;
|
||||
padding: 8px 16px !important;
|
||||
font-size: 1rem !important;
|
||||
}
|
||||
|
||||
.MuiInputBase-input {
|
||||
font-size: 0.9rem !important;
|
||||
font-size: 1rem !important;
|
||||
padding: 14px !important;
|
||||
}
|
||||
|
||||
.MuiButton-root {
|
||||
padding: 12px 24px !important;
|
||||
font-size: 1rem !important;
|
||||
}
|
||||
|
||||
.backend-selector {
|
||||
margin-top: 1rem;
|
||||
padding: 1rem;
|
||||
margin-top: 1.5rem;
|
||||
padding: 1.25rem;
|
||||
}
|
||||
h4.MuiTypography-root {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
.scrollable-tabs::-webkit-scrollbar {
|
||||
display: none;
|
||||
|
||||
pre {
|
||||
font-size: 0.9rem;
|
||||
padding: 12px;
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
.api-description {
|
||||
font-size: 0.875rem;
|
||||
padding: 8px;
|
||||
font-size: 0.95rem;
|
||||
padding: 12px;
|
||||
margin: 12px 0 !important;
|
||||
}
|
||||
|
||||
/* 增强触摸区域 */
|
||||
.MuiIconButton-root {
|
||||
padding: 12px !important;
|
||||
}
|
||||
|
||||
/* 改善表单间距 */
|
||||
.MuiGrid-container {
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
/* 增加选择器高度 */
|
||||
.MuiSelect-select {
|
||||
padding: 14px !important;
|
||||
}
|
||||
|
||||
/* 调整按钮大小和间距 */
|
||||
.MuiButton-contained {
|
||||
margin-top: 16px;
|
||||
width: 100%;
|
||||
height: 48px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 添加暗色模式支持 */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
background-color: #121212;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.MuiPaper-root {
|
||||
background-color: #1e1e1e !important;
|
||||
}
|
||||
|
||||
pre {
|
||||
background-color: #2d2d2d;
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
.api-description {
|
||||
background-color: #2d2d2d;
|
||||
border-left-color: #90caf9;
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
footer {
|
||||
background-color: #1e1e1e;
|
||||
color: #888;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -371,7 +468,7 @@
|
||||
))
|
||||
);
|
||||
|
||||
setSnackbarMessage('后端已删除');
|
||||
setSnackbarMessage('后端URL已删除');
|
||||
setSnackbarOpen(true);
|
||||
};
|
||||
|
||||
@@ -488,7 +585,7 @@
|
||||
</Paper>
|
||||
)}
|
||||
|
||||
{/* 移动后端选择器到底部 */}
|
||||
{/* 后端选择器 */}
|
||||
<Paper elevation={3} className="backend-selector">
|
||||
<Typography variant="h6" gutterBottom>
|
||||
后端设置
|
||||
|
||||
Reference in New Issue
Block a user