This commit is contained in:
2026-06-23 16:16:58 +08:00
parent c04ed8de6e
commit 1681d0bf6c
6 changed files with 844 additions and 321 deletions
+25 -60
View File
@@ -1,79 +1,44 @@
*,
*::before,
*::after {
box-sizing: border-box;
}
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
line-height: 1.5;
font-weight: 400;
color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;
color-scheme: light;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}
body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}
h1 {
font-size: 3.2em;
line-height: 1.1;
}
button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}
.card {
padding: 2em;
background: #0f0c29; /* fallback for loading */
}
#app {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
width: 100%;
}
@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
a {
color: inherit;
text-decoration: none;
}
/* 滚动条美化 */
::-webkit-scrollbar {
width: 6px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: rgba(255,255,255,0.15);
border-radius: 3px;
}
+11 -10
View File
@@ -1,13 +1,14 @@
// rem 适配
// rem适配 — 移动端缩放,PC端固定基准
export const useREM = () => {
const baseSize = 75 // 基准大小,注意这里改为75
function setRem() {
const scale = document.documentElement.clientWidth / 750 // 设计稿宽度改为750
document.documentElement.style.fontSize = baseSize * Math.min(scale, 2) + 'px'
const width = document.documentElement.clientWidth
// ≤768px 按375设计稿等比缩放,>768px 固定基准(不再放大)
if (width <= 768) {
document.documentElement.style.fontSize = (width / 375) * 37.5 + 'px'
} else {
document.documentElement.style.fontSize = '37.5px'
}
}
setRem() // 初始化
window.onresize = () => {
setRem()
}
}
setRem()
window.addEventListener('resize', setRem)
}
+799 -251
View File
File diff suppressed because it is too large Load Diff