-
Notifications
You must be signed in to change notification settings - Fork 729
/
index.html
341 lines (307 loc) · 11.8 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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="favicon.ico">
<title>Serv00 JSON Generator -- Serv00.com</title>
<meta name="keywords" content="JSON Generator, Serv00, Serv00.com">
<meta name="description" content="Serv00 JSON Generator is a tool for generating JSON data. It provides various options to customize the generated JSON.">
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/atom-one-dark.min.css">
<style>
body, html {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
font-family: Arial, sans-serif;
position: relative;
}
.app-container {
max-width: 960px;
margin: 0 auto;
padding: 20px;
height: 100%;
box-sizing: border-box;
position: relative;
}
/* .left-align {
display: flex;
align-items: center;
flex: 1;
flex-direction: row;
}
.right-align {
display: flex;
align-items: center;
justify-content: flex-end;
flex: 1;
} */
.user-row {
margin-bottom: 20px; /* 可选:为每行用户信息之间添加一些间距 */
}
.left-align {
float: left;
display: flex;
align-items: center; /* 垂直居中对齐 */
justify-content: flex-start; /* 水平平铺对齐 */
flex-wrap: nowrap; /* 防止换行 */
}
.form-item {
float: left;
flex: 1;
margin-right: 20px;
}
.form-item:last-child {
margin-right: 0;
}
.right-align {
float: right;
text-align: right;
}
.button-row {
margin-top: 20px;
display: flex;
justify-content: space-between;
}
.json-output {
white-space: pre-wrap;
word-wrap: break-word;
background-color: #282c34;
color: #abb2bf;
padding: 10px;
border-radius: 4px;
overflow-x: auto;
position: relative;
}
.copy-button {
position: absolute;
top: 10px;
right: 10px;
background-color: #3b4048;
color: #abb2bf;
border: none;
padding: 5px 10px;
cursor: pointer;
border-radius: 4px;
}
.copy-button:hover {
background-color: #4e5460;
}
.watermark {
position: absolute;
top: 0;
left: 0;
pointer-events: none;
z-index: 9999;
opacity: 0.5;
font-size: 100px;
color: rgba(0, 0, 0, 0.2);
transform: rotate(-45deg);
display: flex;
align-items: center;
justify-content: center;
}
@media (max-width: 768px) {
.el-form-item__content {
width: 100%;
}
.remove-button {
text-align: left;
}
}
</style>
</head>
<body>
<div class="app-container" id="app">
<el-container>
<el-header style="text-align: center;">
<h1>{{ currentLang.title }}</h1>
</el-header>
<el-main>
<el-form ref="userDataForm" :model="users" label-width="auto">
<el-row v-for="(user, index) in users" :key="index" class="user-row">
<el-col :span="20" class="left-align">
<el-form-item :label="currentLang.username" class="form-item">
<el-input v-model="user.username"></el-input>
</el-form-item>
<el-form-item :label="currentLang.password" class="form-item">
<el-input v-model="user.password" type="password"></el-input>
</el-form-item>
<el-form-item :label="currentLang.panelnum" class="form-item">
<el-input v-model="user.panelnum"></el-input>
</el-form-item>
</el-col>
<el-col :span="2" class="right-align">
<el-button @click="removeUser(index)">{{ currentLang.remove }}</el-button>
</el-col>
</el-row>
<el-row class="button-row" :gutter="20">
<el-col :span="12">
<el-button @click="addUser" style="width: 100%;">{{ currentLang.add }}</el-button>
</el-col>
<el-col :span="12">
<el-button @click="generateJson" style="width: 100%;">{{ currentLang.generate }}</el-button>
</el-col>
</el-row>
</el-form>
</el-main>
<el-footer>
<pre class="json-output" id="jsonOutput">
<button class="copy-button" @click="copyToClipboard" v-if="jsonOutput">{{ currentLang.copy }}</button>
<code class="hljs json" v-html="highlightedJson"></code>
</pre>
</el-footer>
</el-container>
</div>
<div class="watermark" id="watermark">DO NOT RECORD</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
hljs.highlightAll();
// 全屏模式
function requestFullScreen() {
const elem = document.documentElement;
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.mozRequestFullScreen) { // Firefox
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) { // Chrome, Safari and Opera
elem.webkitRequestFullscreen();
} else if (elem.msRequestFullscreen) { // IE/Edge
elem.msRequestFullscreen();
}
}
// 检测录屏工具
function detectScreenRecording() {
const mediaRecorder = MediaRecorder && MediaRecorder.isTypeSupported;
if (mediaRecorder) {
setInterval(() => {
if (MediaRecorder.state === 'recording') {
alert('Screen recording detected! Please stop recording.');
// 可以在这里隐藏敏感内容或采取其他措施
}
}, 1000);
}
}
// 水印反弹动画
function animateWatermark() {
const watermark = document.getElementById('watermark');
const viewportWidth = window.innerWidth;
const viewportHeight = window.innerHeight;
const watermarkWidth = watermark.offsetWidth;
const watermarkHeight = watermark.offsetHeight;
let x = 0;
let y = 0;
let dx = 2; // 水平速度
let dy = 2; // 垂直速度
function updatePosition() {
x += dx;
y += dy;
if (x + watermarkWidth >= viewportWidth || x <= 0) {
dx = -dx;
}
if (y + watermarkHeight >= viewportHeight || y <= 0) {
dy = -dy;
}
watermark.style.transform = `translate(${x}px, ${y}px) rotate(-45deg)`;
requestAnimationFrame(updatePosition);
}
updatePosition();
}
requestFullScreen();
detectScreenRecording();
animateWatermark();
});
const LANGUAGES = {
en: {
title: 'Input Panel Data',
username: 'Username:',
password: 'Password:',
panelnum: 'Panel No:',
add: 'Add User',
remove: 'Remove',
generate: 'Generate JSON',
copy: 'Copy',
emptyFieldsWarning: 'Please fill in all required fields.',
copiedToClipboard: 'JSON copied to clipboard!'
},
zh: {
title: '输入面板数据',
username: '用 户 名:',
password: '账号密码:',
panelnum: '面板编号:',
add: '添加用户',
remove: '移除',
generate: '生成 JSON',
copy: '复制',
emptyFieldsWarning: '请填写所有必填项。',
copiedToClipboard: 'JSON 已复制到剪贴板!'
}
};
let language = (navigator.language || navigator.userLanguage).toLowerCase().substr(0, 2);
if (!LANGUAGES[language]) {
language = 'en'; // Default to English
}
new Vue({
el: '#app',
data() {
return {
users: [
{ username: '', password: '', panelnum: '' }
],
jsonOutput: '',
highlightedJson: '',
language: language
};
},
computed: {
currentLang() {
return LANGUAGES[this.language];
}
},
methods: {
addUser() {
this.users.push({ username: '', password: '', panelnum: '' });
},
removeUser(index) {
this.users.splice(index, 1);
},
generateJson() {
// Check for empty fields
const hasEmptyFields = this.users.some(user => !user.username || !user.password || !user.panelnum);
if (hasEmptyFields) {
this.$message({
message: this.currentLang.emptyFieldsWarning,
type: 'warning'
});
return;
}
const data = this.users.map(user => ({
username: user.username,
password: user.password,
panelnum: user.panelnum
}));
this.jsonOutput = JSON.stringify(data, null, 4);
this.highlightedJson = hljs.highlight('json', this.jsonOutput).value;
},
copyToClipboard() {
const tempTextarea = document.createElement('textarea');
tempTextarea.value = this.jsonOutput;
document.body.appendChild(tempTextarea);
tempTextarea.select();
document.execCommand('copy');
document.body.removeChild(tempTextarea);
this.$message({
message: this.currentLang.copiedToClipboard,
type: 'success'
});
}
}
});
</script>
</body>
</html>