-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwriteup.html
More file actions
136 lines (123 loc) · 3.74 KB
/
Copy pathwriteup.html
File metadata and controls
136 lines (123 loc) · 3.74 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Writeup信息表单</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 20px;
}
h1, h2 {
color: #333;
}
form {
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
max-width: 600px;
margin: auto;
}
label {
display: block;
margin-bottom: 5px;
}
input[type="text"], textarea {
width: 100%;
padding: 10px;
margin-bottom: 20px;
border: 1px solid #ddd;
border-radius: 4px;
box-sizing: border-box;
}
textarea {
resize: vertical;
}
button {
padding: 10px 20px;
background-color: #5cb85c;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
}
button:hover {
background-color: #4cae4c;
}
pre {
background-color: #eee;
border: 1px solid #ddd;
border-left: 3px solid #f39c12;
color: #333;
page-break-inside: avoid;
font-family: monospace;
white-space: pre-wrap;
word-wrap: break-word;
padding: 20px;
margin-top: 20px;
}
</style>
<script>
function generateJSON() {
var eventName = document.getElementById('event-name').value;
var year = document.getElementById('year').value;
var writeauthor = document.getElementById('writeup-author').value;
var writeuplink = document.getElementById('writeup-link').value;
var writeupother = document.getElementById('writeup-other').value;
var eventInfo = {
name: eventName,
year: year,
writeauthor: writeauthor,
writeuplink: writeuplink,
writeupother: writeupother
};
var jsonString = JSON.stringify(eventInfo, null, 2);
document.getElementById('json-output').textContent = jsonString;
}
function copyJSON() {
var jsonOutput = document.getElementById('json-output');
if (jsonOutput.textContent) {
navigator.clipboard.writeText(jsonOutput.textContent).then(function() {
alert('JSON已复制到剪贴板!');
}).catch(function(err) {
alert('复制失败:' + err);
});
} else {
alert('请先生成JSON!');
}
}
</script>
</head>
<body>
<h1>Writeup信息输入</h1>
<form id="event-form">
<label for="event-name">赛事名称:</label>
<input type="text" id="event-name" name="event-name"><br><br>
<label for="year">赛事年份:</label>
<select id="year" name="year">
<option value="2018">2018</option>
<option value="2019">2019</option>
<option value="2020">2020</option>
<option value="2021">2021</option>
<option value="2022">2022</option>
<option value="2023">2023</option>
<option value="2024">2024</option>
<option value="2025">2025</option>
</select><br><br>
<label for="writeup-author">作者:</label>
<input type="text" id="writeup-author" name="writeup-author"><br><br>
<label for="writeup-link">Writeup链接:</label>
<input type="text" id="writeup-link" name="writeup-link"><br><br>
<label for="writeup-other">备注信息:</label>
<input type="text" id="writeup-other" name="writeup-other"><br><br>
<button type="button" onclick="generateJSON()">生成JSON</button>
</form>
<h2>生成的JSON:</h2>
<pre id="json-output"></pre>
<button type="button" onclick="copyJSON()">复制JSON</button>
</body>
</html>