Skip to content

Commit 0bde138

Browse files
committed
docs(tools): 将 Base64 工具提示转换为正式章节并内联 BMI 样式
将 Base64 工具页面的提示信息从块引用转换为正式的“了解 Base64”章节,以提高内容的正式性和可读性。 同时,将 BMI 计算工具的 CSS 样式从 SCSS 文件移至 JavaScript 模板中,以实现样式的组件化封装,避免全局样式污染。
1 parent 7001524 commit 0bde138

4 files changed

Lines changed: 51 additions & 67 deletions

File tree

assets/js/tools/bmi.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,53 @@
3434
const t = i18n[lang] || i18n['en'];
3535

3636
container.innerHTML = `
37+
<style>
38+
#tool-bmi .tool-container { display: flex; flex-direction: column; gap: 1rem; max-width: 400px; margin: 0 auto; }
39+
#tool-bmi .input-group { display: flex; flex-direction: column; gap: 0.5rem; }
40+
#tool-bmi .input-group label { font-weight: bold; font-size: 1.8rem; color: var(--card-text-color-main); }
41+
#tool-bmi .input-group input {
42+
padding: 1.5rem;
43+
border: 1px solid var(--border-color);
44+
border-radius: 4px;
45+
background: var(--body-background);
46+
color: var(--card-text-color-main);
47+
font-size: 1.2rem;
48+
outline: none;
49+
transition: border-color 0.2s;
50+
}
51+
#tool-bmi .input-group input:focus { border-color: var(--accent-color); }
52+
#tool-bmi .btn-calc {
53+
margin-top: 1rem;
54+
padding: 0.8rem;
55+
background: var(--accent-color);
56+
color: #fff;
57+
border: none;
58+
border-radius: 4px;
59+
cursor: pointer;
60+
font-weight: bold;
61+
font-size: 2rem;
62+
transition: opacity 0.2s;
63+
}
64+
#tool-bmi .btn-calc:hover { opacity: 0.9; }
65+
#tool-bmi .result-box {
66+
margin-top: 1rem;
67+
padding: 1.5rem;
68+
text-align: center;
69+
border-radius: 8px;
70+
background: var(--body-background);
71+
border: 1px dashed var(--border-color);
72+
}
73+
#tool-bmi .bmi-value { font-size: 2rem; font-weight: bold; display: block; color: var(--accent-color); }
74+
#tool-bmi .bmi-status {
75+
display: inline-block;
76+
margin-top: 0.8rem;
77+
padding: 0.3rem 1.2rem;
78+
border-radius: 20px;
79+
color: #fff;
80+
font-size: 1.5rem;
81+
font-weight: bold;
82+
}
83+
</style>
3784
<div class="tool-container">
3885
<div class="input-group">
3986
<label>${t.labelHeight}</label>

assets/scss/tools.scss

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -119,69 +119,4 @@
119119
background: var(--card-background);
120120
border-radius: var(--card-border-radius);
121121
box-shadow: var(--shadow-l1);
122-
123-
.tool-container {
124-
display: flex;
125-
flex-direction: column;
126-
gap: 1rem;
127-
max-width: 400px;
128-
margin: 0 auto;
129-
130-
.input-group {
131-
display: flex;
132-
flex-direction: column;
133-
gap: 0.5rem;
134-
135-
label { font-weight: bold; font-size: 1.8rem; color: var(--card-text-color-main); }
136-
input {
137-
padding: 1.5rem;
138-
border: 1px solid var(--border-color);
139-
border-radius: 4px;
140-
background: var(--body-background);
141-
color: var(--card-text-color-main);
142-
font-size: 1.2rem;
143-
outline: none;
144-
&:focus { border-color: var(--accent-color); }
145-
}
146-
}
147-
148-
.btn-calc {
149-
margin-top: 1rem;
150-
padding: 0.8rem;
151-
background: var(--accent-color);
152-
color: #fff;
153-
border: none;
154-
border-radius: 4px;
155-
cursor: pointer;
156-
font-weight: bold;
157-
font-size: 2rem;
158-
transition: opacity 0.2s;
159-
&:hover { opacity: 0.9; }
160-
}
161-
162-
.result-box {
163-
margin-top: 1rem;
164-
padding: 1.5rem;
165-
text-align: center;
166-
border-radius: 8px;
167-
background: var(--body-background);
168-
border: 1px dashed var(--border-color);
169-
170-
.bmi-value {
171-
font-size: 2rem;
172-
font-weight: bold;
173-
display: block;
174-
color: var(--accent-color);
175-
}
176-
.bmi-status {
177-
display: inline-block;
178-
margin-top: 0.8rem;
179-
padding: 0.3rem 1.2rem;
180-
border-radius: 20px;
181-
color: #fff;
182-
font-size: 1.5rem;
183-
font-weight: bold;
184-
}
185-
}
186-
}
187122
}

content/en/tools/base64/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ Base64 is an encoding scheme used to represent binary data in an ASCII string fo
1313
- **To Encode**: Paste your plain text into the input box and click the **Encode** button.
1414
- **To Decode**: Paste your Base64 encoded string into the input box and click the **Decode** button.
1515

16-
> **Note**: Base64 is not encryption. It's a way to represent data in a format that's safe for transport.
16+
### Understanding Base64
17+
Base64 is not encryption. It's a way to represent data in a format that's safe for transport.

content/zh-cn/tools/base64/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ Base64 是一种基于 64 个可打印字符来表示二进制数据的表示方
1313
- **编码**:在输入框中输入普通文本,点击 **编码 (Encode)** 按钮即可。
1414
- **解码**:在输入框中输入 Base64 编码后的字符串,点击 **解码 (Decode)** 按钮即可。
1515

16-
> **提示**:Base64 编码并不是加密。它只是一种数据格式转换方式,旨在确保数据在传输过程中的完整性。
16+
### 了解 Base64
17+
Base64 编码并不是加密。它只是一种数据格式转换方式,旨在确保数据在传输过程中的完整性。

0 commit comments

Comments
 (0)