-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
83 lines (79 loc) · 2.63 KB
/
index.html
File metadata and controls
83 lines (79 loc) · 2.63 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
<!DOCTYPE html>
<html>
<head>
<title>假新聞清潔劑-國防醫學大學抽獎活動</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<style type="text/css">
.flex_container {
display: flex;
flex-direction: row;
}
.flex_div{
flex: 1;
padding: 10px 10px 10px 0px;
}
#error_msg {
color: red;
}
button {
display: block;
cursor: pointer;
border-radius: 30px;
font-size: 1.5rem;
background: #b5b5b5;
font-size: 40px;
padding: 10px 20px 10px 20px;
}
</style>
</head>
<body style="background: #ffdede; font-size: 50px;">
<div id="loading_div" style="z-index: 9999; background: #ffdede; position: absolute; width: 99%; height: 99%;">
<img style="width: 300px; height: 300px; position: absolute; transform: translate(50%, -50%); top: 50%; right: 50%;" src="https://imgur.com/C5VsFHh.gif">
</div>
<div style="position:absolute; transform:translateY(-50%); top:50%; width: 95%;">
<div class="flex_container">
<div class="flex_div" style="text-align: center;"><h2>假新聞清潔劑-國防醫學大學抽獎活動</h2></div>
</div>
<div class="flex_container">
<div class="flex_div" style="text-align: right;">請輸入抽獎序號:</div>
<div class="flex_div" style="text-align: left;"><input id="serial_num" style="font-size:30px; height:50px; width:300px;"></input></div>
</div>
<div class="flex_container">
<div class="flex_div"></div>
<div class="flex_div" style="text-align: left;" id="error_msg"></div>
</div>
<div class="flex_container" style="margin: 0px auto;">
<div class="flex_div"></div>
<div class="flex_div"><button onclick="send_data()">送出</button></div>
</div>
</div>
<img src="https://imgur.com/QpPu89K.png" style="position: absolute; bottom: 10px; right: 10px;">
<script type="text/javascript">
$('#loading_div').hide();
function send_data()
{
var serial_num = $("#serial_num").val();
$('#loading_div').fadeIn(500);
$('button').prop('disabled', false);
$.ajax({
url: "https://ndmc2021-api.fnc.tw/api?serial="+serial_num
}).done(function(data) {
$('button').prop('disabled', false);
$('#loading_div').hide();
console.log(data);
console.log(data.isError);
console.log(data.isPass);
console.log(data.message);
if(data.isPass && !data.isError)
{
location.href = "https://docs.google.com/forms/d/e/1FAIpQLSc8dzMgbSg4PjivwTVjoSJ0vV5IFNLzk2tXQwKaMg6oGd20lg/viewform?usp=pp_url&entry.1619151144="+serial_num;
}
else
{
$("#error_msg").html(data.message);
}
});
}
</script>
</body>
</html>