Skip to content

Commit 3b67ced

Browse files
committed
Fix by AI
1 parent 4fc7700 commit 3b67ced

2 files changed

Lines changed: 101 additions & 53 deletions

File tree

include/css/index.css

Lines changed: 94 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,115 @@
1-
@font-face {
2-
font-family: "JetBrains Mono";
3-
src: url("../JetBrainsMono.ttf") format("truetype");
4-
}
1+
/* index.css — 整理自 inline styles
2+
目标:合并重复规则、使用变量、格式化并删除空规则。 */
53

64
:root {
7-
--9_6-color: #999999;
8-
--5_6-color: #555555;
5+
--page-width: 65%;
6+
--page-margin: 15%;
7+
--card-bg: rgba(0, 0, 0, 0.5);
8+
--card-radius: 25px;
9+
--card-padding: 1% 2% 2%;
10+
--card-padding-bottom: 2.5%;
11+
--backdrop: blur(5px);
12+
--muted: #999999;
13+
--muted-dark: #555555;
914
--mono-font: "JetBrains Mono";
10-
--tahoma-font: Tahoma;
15+
--tahoma-font: Tahoma, system-ui, sans-serif;
1116
--bg-img: url("../bg.jpg");
1217
}
1318

19+
/* 布局 */
1420
body {
21+
margin: 0;
1522
background-image: var(--bg-img);
1623
background-size: cover;
1724
background-repeat: no-repeat;
1825
background-position: center center;
1926
background-attachment: fixed;
20-
min-height: 100%;
21-
background-color: var(--5_6-color);
27+
min-height: 100vh;
28+
background-color: var(--muted-dark);
29+
}
30+
31+
body.line-numbers {
32+
min-height: 100vh;
33+
}
34+
35+
/* 主体和版权块共享的“毛玻璃”样式 */
36+
#main,
37+
#copyright {
38+
display: table-cell;
39+
position: absolute;
40+
width: var(--page-width);
41+
margin-left: var(--page-margin);
42+
margin-right: var(--page-margin);
43+
padding: var(--card-padding);
44+
border-radius: var(--card-radius);
45+
background: var(--card-bg);
46+
backdrop-filter: var(--backdrop);
47+
}
48+
49+
/* main 特有 */
50+
#main {
51+
top: 0;
52+
overflow-y: auto;
53+
overflow-x: hidden;
54+
/* 保留滚动条空间以避免布局跳动 */
55+
scrollbar-gutter: stable both-edges;
56+
/* 始终显示(当无内容时会显示空的滚动条轨道) */
57+
height: auto !important;
58+
-webkit-overflow-scrolling: touch;
59+
padding-bottom: var(--gap-between);
60+
max-height: 75%;
61+
62+
/* 自定义滚动条(WebKit / Blink) */
63+
#main::-webkit-scrollbar {
64+
width: 12px;
65+
}
66+
#main::-webkit-scrollbar-track {
67+
background: rgba(255,255,255,0.03);
68+
border-radius: 6px;
69+
}
70+
#main::-webkit-scrollbar-thumb {
71+
background: rgba(255,255,255,0.12);
72+
border-radius: 6px;
73+
}
74+
/* Firefox */
75+
#main {
76+
scrollbar-width: thin;
77+
scrollbar-color: rgba(255,255,255,0.12) rgba(255,255,255,0.03);
78+
}
79+
}
80+
81+
/* copyright 特有 */
82+
#copyright {
83+
bottom: 0;
84+
min-height: 5%;
85+
margin-top: 2.5%;
86+
padding: 1% 2% var(--card-padding-bottom);
87+
height: auto;
88+
}
89+
90+
#copyright p {
91+
text-align: center;
92+
margin: 0;
93+
}
94+
95+
/* 文本样式 */
96+
@font-face {
97+
font-family: "JetBrains Mono";
98+
src: url("../JetBrainsMono.ttf") format("truetype");
2299
}
23100

24101
.chinese {
25-
font-family: var(--tahoma-font),system-ui;
26-
color: var(--9_6-color);
102+
font-family: var(--tahoma-font);
103+
color: var(--muted);
27104
}
28105

29106
.english {
30107
font-family: var(--mono-font), system-ui;
31-
color: var(--9_6-color);
108+
color: var(--muted);
109+
}
110+
111+
code,
112+
pre {
113+
font-family: var(--mono-font), system-ui;
32114
}
33115

34-
code pre {
35-
font-family: var(--mono-font),system-ui;
36-
}

index.html

Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- -*- conding: utf-8 -*- -->
2-
<!-- 2025.8.8 -->
2+
<!-- 2026.2.12 -->
33
<!DOCTYPE html>
44
<html lang="zh-CN">
55
<head>
@@ -28,8 +28,8 @@
2828
<link href="include/prism.css" rel="stylesheet">
2929
<link href="include/css/index.css" rel="stylesheet">
3030
</head>
31-
<body class="line-numbers" style="min-height: 100vh;">
32-
<div id="main" style="display: table-cell;top: 0;height: auto !important;max-height: 75%;position: absolute;margin-left: 15%;width: 65%;margin-right: 15%;padding: 1% 2% 2%;border-radius: 25px;background: rgba(0, 0, 0, 0.5);backdrop-filter: blur(5px);">
31+
<body class="line-numbers">
32+
<div id="main">
3333
<p class="chinese">警告!本网站处于测试阶段!</p>
3434
<p class="english">Warn! This site is in beta!</p>
3535
<pre><code class="language-python">print("Hello World!")
@@ -46,44 +46,13 @@
4646
System.out.println("Hello World!");
4747
}
4848
}</code></pre>
49-
<p class="english">
50-
1
51-
<br/>
52-
2
53-
<br/>
54-
3
55-
<br/>
56-
4
57-
<br/>
58-
5
59-
<br/>
60-
6
61-
<br/>
62-
7
63-
<br/>
64-
8
65-
<br/>
66-
9
67-
<br/>
68-
10
69-
<br/>
70-
one
71-
two
72-
three
73-
four
74-
five
75-
six
76-
seven
77-
eight
78-
nine
79-
ten
80-
</p>
49+
8150
<br/>
8251
</div>
8352
<br/>
84-
<div id="copyright" style="display: table-cell;position: absolute;height: auto;bottom: 0;width: 65%;min-height: 5%;margin-left: 15%;margin-right: 15%;margin-top: 2.5%;padding: 1% 2% 2.5%;border-radius: 25px;background: rgba(0, 0, 0, 0.5);backdrop-filter: blur(5px);">
85-
<p class="chinese" style="text-align: center;">© 2026 红蓝灯 保留所有权利</p>
86-
<p class="english" style="text-align: center;">© 2026 RBL All Rights Reserved</p>
53+
<div id="copyright">
54+
<p class="chinese">© 2026 红蓝灯 保留所有权利</p>
55+
<p class="english">© 2026 RBL All Rights Reserved</p>
8756
</div>
8857
</body>
8958
</html>

0 commit comments

Comments
 (0)