-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
207 lines (178 loc) · 6.01 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<!DOCTYPE html>
<html lang="zh">
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/crypto-js.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/all.min.js"></script>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MichelaBassaSciocca</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
<style>
body {
font-family: "Roboto", sans-serif;
background-color: #f9fafb;
color: #333;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.container {
background-color: #fff;
padding: 30px;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 500px;
text-align: center;
}
h1 {
font-size: 24px;
color: #2c3e50;
margin-bottom: 20px;
}
p {
margin: 10px 0;
}
select {
appearance: none;
background-color: #fff;
border: 1px solid #ccc;
padding: 12px;
border-radius: 8px;
font-size: 16px;
width: 100%;
margin: 10px 0;
transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}
select:focus {
border-color: #3498db;
box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
outline: none;
}
select option {
padding: 10px;
}
textarea {
resize: none;
}
button:hover {
background-color: #2980b9;
}
input,
select,
textarea,
button {
width: 100%;
padding: 12px;
margin: 10px 0;
border-radius: 8px;
font-size: 16px;
box-sizing: border-box;
border: 1px solid #ccc;
/* 统一背景色 */
transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}
input:focus,
select:focus,
textarea:focus,
button:focus {
outline: none;
border-color: #3498db;
/* 焦点时统一边框颜色 */
box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
}
input[type="number"] {
-moz-appearance: textfield;
/* 去除 Firefox 上数字输入框的默认样式 */
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
/* 去除 Chrome 上数字输入框的默认样式 */
}
/* select 和 input 统一样式 */
select,
input {
appearance: none;
background-color: #fff;
padding: 12px;
border: 1px solid #ccc;
border-radius: 8px;
font-size: 16px;
width: 100%;
margin: 10px 0;
}
select:focus,
input:focus {
border-color: #3498db;
box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
outline: none;
}
.caesarShiftDiv {
display: none;
}
.caesarShiftDiv.active {
display: block;
}
textarea {
resize: none;
}
.result {
background-color: #ecf0f1;
}
#togglePassword {
width: 20px;
height: 20px;
padding: 0;
}
button {
background-color: #3498db;
color: white;
border: none;
cursor: pointer;
transition: background-color 0.3s ease;
padding: 12px;
border-radius: 8px;
font-size: 16px;
}
</style>
</head>
<body>
<div class="container">
<h1>加密解密工具</h1>
<p>请选择操作模式</p>
<select id="operation">
<option value="1">加密</option>
<option value="2">解密</option>
</select>
<p>请选择加解密方式</p>
<select id="method" onchange="toggleCaesarShift()">
<option value="aes">AES加密(推荐!)</option>
<option value="base64">Base64</option>
<option value="element">化学元素加解密(Michelaの杰作,已支持中文)</option>
<option value="caesar">凯撒密码(仅支持字母)</option>
<option value="rot13">ROT13(仅支持字母)</option>
<option value="morse">摩斯密码(仅支持字母)</option>
</select>
<div id="caesarShiftDiv" class="caesarShiftDiv">
<p>请输入凯撒密码的偏移量</p>
<input type="number" id="caesarShift" value="3" />
</div>
<div id="aesPasswordDiv" style="display: block; position: relative;">
<p>请输入AES加密密码</p>
<input type="password" id="aesPassword" placeholder="请输入密码(不输入默认为MichelaBassa)" style="padding-right: 40px;" />
<button id="togglePassword" type="button" onclick="togglePasswordVisibility()"
style="position: absolute; right: 10px; top: 44px; background: none; border: none; cursor: pointer;">
<img id="passwordIcon" src="eye-blind-icon.svg"
alt="Show/Hide Password" style="width: 20px; height: 20px;" />
</button>
</div>
<textarea id="inputText" rows="4" placeholder="请输入要加密或解密的内容"></textarea>
<button onclick="processText()">提交</button>
<textarea id="result" class="result" rows="4" placeholder="结果将在这里显示" readonly></textarea>
</div>
<script src="script.js"></script>
</body>
</html>