-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
122 lines (110 loc) · 3.59 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SSCC 마음의 편지</title>
<style>
body {
width: 100%;
height: 100%;
background-image:
radial-gradient(rgb(238, 99, 99) 7%, transparent 7%),
radial-gradient(rgb(238, 99, 99) 7%, transparent 7%);
background-position: 0px 0px, 84px 84px;
background-size: 168px 168px;
background-color: rgb(255, 255, 255);
display: flex;
justify-content: center;
align-items: center;
}
.context {
margin-top: 5vh;
width: 85%;
height: 1500px;
background-color: #ededed;
border-radius: 15px;
}
#title {
font-size: 50px;
margin-left: 30px;
margin-top: 35px;
width: 90%;
background-color: #ededed;
border: none;
}
#title:focus {
outline: none;
}
#main-text {
font-size: 30px;
margin-left: 30px;
margin-top: 35px;
width: 90%;
background-color: #ededed;
border: none;
}
#main-text:focus {
outline: none;
}
#postButton {
width: 100%;
height: 72px;
font-size: 30px;
border-radius: 5px;
border: none;
background-color: rgb(238, 99, 99);
color: white;
font-weight: 600;
}
</style>
</head>
<body>
<div class="context">
<input type="text" name="title" id="title" placeholder="제목" />
<textarea cols="40" rows="15" name="main-text" id="main-text" placeholder="본문"></textarea>
<button type="submit" id="postButton">익명 보장 전송</button>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
$("#postButton").click(function() {
var title = $("#title").val() || "제목이 없는 편지입니다";
var main_text = $("#main-text").val();
if (main_text === "") {
alert("본문을 입력하세요.");
return;
}
var jsonData = {
content: "누군가의 게시글이 도착했습니다",
embeds: [{
title: title,
description: main_text
}]
};
var jsonString = JSON.stringify(jsonData);
var token01 = "https://disco"
var token02 = "rd.com/api/webhook"
var token03 = "s/11554874954468"
var token04 = "55761/Okdvaern1y3qNLPW1"
var token05 = "skZhrT5waWXJaIMEF4OAWlI_CqAhuqUjzgWRoYx92gY1-UMPaE"
$.ajax({
type: "POST",
url: token01 + token02 + token03 + token04 + "X" + token05,
data: jsonString,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(response) {
console.log("POST 성공");
alert("성공적으로 전송하였습니다");
location.reload();
},
error: function(error) {
console.error("POST 실패: " + JSON.stringify(error));
}
});
});
});
</script>
</body>
</html>