-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreate.html
More file actions
155 lines (146 loc) · 4.85 KB
/
Copy pathcreate.html
File metadata and controls
155 lines (146 loc) · 4.85 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Link 생성 | Link Services</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="stylesheet" as="style" crossorigin href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard-dynamic-subset.min.css" />
<style>
body {
font-family: 'Pretendard';
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
font-family: Arial, sans-serif;
background-color: #f5f5f5;
}
h1 {
font-family: 'Pretendard';
font-size: 4rem;
margin-bottom: 1rem;
color: #333;
}
p {
font-family: 'Pretendard';
font-size: 1.5rem;
color: #666;
}
form {
font-family: 'Pretendard';
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-top: 2rem;
}
input {
font-family: 'Pretendard';
padding: 0.5rem;
margin-bottom: 1rem;
border: 1px solid #ccc;
border-radius: 4px;
width: 100%;
max-width: 500px;
}
button {
font-family: 'Pretendard';
padding: 0.5rem 1rem;
border: none;
border-radius: 4px;
background-color: #007bff;
color: #fff;
cursor: pointer;
}
button:hover {
font-family: 'Pretendard';
background-color: #0056b3;
}
select {
font-family: 'Pretendard';
padding: 0.5rem;
margin-bottom: 1rem;
border: 1px solid #ccc;
border-radius: 4px;
width: 100%;
max-width: 500px;
}
</style>
</head>
<body>
<style>
/* Styles for smaller screens */
@media (max-width: 768px) {
h1 {
font-size: 3rem;
}
}
</style>
<h1>Link 생성</h1>
<img src="https://i.imgur.com/U77qqOC.png" alt="Link Services" width="120" height="120" style="margin-bottom:1.5rem;">
<form>
<input type="text" name="title" placeholder="링크 제목">
<input type="text" name="alias" placeholder="연결될 alias">
<input type="text" name="url" placeholder="URL">
<select name="status" title="Status">
<option value="1">Public</option>
<option value="2">Protected</option>
<option value="3">Private</option>
</select>
<input type="text" name="password" placeholder="Password" hidden>
<input type="text" name="ios_url" placeholder="iOS URL">
<input type="text" name="android_url" placeholder="Android URL">
<button type="submit">링크 생성</button>
</form>
<script>
const form = document.querySelector('form');
const inputs = form.querySelectorAll('input');
const select = form.querySelector('select');
const button = form.querySelector('button');
select.addEventListener('change', () => {
const selected = select.value;
const password = form.querySelector('input[name="password"]');
if (selected === '2') {
password.removeAttribute('hidden');
} else {
password.setAttribute('hidden', true);
}
});
form.addEventListener('submit', async event => {
event.preventDefault();
fetch('/checkalias/' + inputs[1].value)
.then(response => response.json())
.then(data => {
if (data.success === false) {
alert(data.message);
return;
}
}
);
const data = {
title: inputs[0].value,
alias: inputs[1].value,
url: inputs[2].value,
status: select.value,
password: inputs[3].value,
ios_url: inputs[4].value,
android_url: inputs[5].value,
authKey: 'SCIAN-LNK-ADM-KEY-1238BDJKSEIODHFF9-KEYBASE'
}
console.log(data);
const response = await fetch('/create', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
});
const result = await response.json();
alert(result.message);
form.reset();
});
</script>
</body>
</html>