-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClientSide.html
More file actions
81 lines (72 loc) · 2.47 KB
/
ClientSide.html
File metadata and controls
81 lines (72 loc) · 2.47 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
<html>
<head>
<title>Register for your Event</title>
<style type="text/css">
body{
background-image: url("https://www.toptal.com/designers/subtlepatterns/patterns/ignasi_pattern_s.png");
}
h1{
background-color: #818181;
text-align: center;
opacity:0.3;
font-family: impact;
color:white;
font-size: 32px;
margin-top: 100px;
}
input{
background-color: white;
opacity: 0.4;
font-size: 32px;
margin-left: auto;
margin-right: auto;
display: block;
font-family: impact;
}
</style>
</head>
<body>
<h1>Please Enter the <b>Event Code</b> </h1>
<form onsubmit = "return submitForm()">
<input type="text" name="eventId" placeholder="event id" id = "eventId" value="">
</form>
<form onsubmit = "return submitForm()">
<input type="text" name="eventName" placeholder="name" id = "name" value="">
</form>
<form onsubmit = "return submitForm()">
<input type="text" name="eventColor" placeholder="shirtColor" id = "shirtColor" value="">
<input type="submit" value="Submit">
</form>
</body>
<script type="text/javascript" src="./javascript/guests.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="create.js"></script>
<script type="text/javascript">
function submitForm()
{
const eventId = document.getElementById("eventId").value;
const name = document.getElementById("name").value;
const shirtColor = document.getElementById("shirtColor").value;
guestNameList.push(name);
guestShirtColorList.push(shirtColor);
localStorage.setItem("names", JSON.stringify(guestNameList));
localStorage.setItem("shirtColor", JSON.stringify(guestShirtColorList));
alert("Checked in!");
console.log(shirtColor);
checkIn(eventId, name, shirtColor, '3'); // called asynbchronialsicoly
return false;
}
async function checkIn(eid, name, shirtColor, skinColor) {
const data = await checkInToEvent(eid, name, shirtColor, '0');
// if data is false, we didn't find an event...
if (!data) {
alert('Could not find an event with that id, pls try again pls pls');
} else {
// User is logged in or whatever needs local data
console.log(guestNameList);
console.log(data.eventId);
}
console.log(data);
}
</script>
</html>