forked from Lucas-Eliel/dragonboarding-1
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
86 lines (81 loc) · 2.12 KB
/
index.html
File metadata and controls
86 lines (81 loc) · 2.12 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dragonboarding</title>
<style>
* {
padding: 0;
margin: 0;
}
.form {
width: 100%;
text-align: center;
padding: 10px;
background: #ff9800;
border: 5px solid #ef6c00;
box-sizing: border-box;
}
.result {
width: 100%;
background: #ff9800;
text-align: center;
padding: 20px;
border: 5px solid #ef6c00;
box-sizing: border-box;
}
.result img {
width: 50%;
border: 5px solid #ef6c00;
}
</style>
</head>
<body>
<div class="form">
Username:
<input type="text" id="username" />
<button id="send">Send</button>
</div>
<div class="result">
<img src="https://www.emaisgoias.com.br/wp-content/uploads/2020/06/aa3a69b92d6a4f09b2ed1695b54f01d4_md-1200x900.jpg" />
</div>
<script>
var usernameInput = document.getElementById("username")
var sendButton = document.getElementById("send")
var cirlcleMatcherURL = "https://charles-prod-demos.continuousplatform.com/charlescd-circle-matcher/identify"
sendButton.addEventListener("click", function() {
var value = usernameInput.value
var payload = {
workspaceId: "4a7b9ec7-82f9-4b87-abd0-f4d6334dd1e3",
requestData: {
username: value
}
}
var myHeaders = new Headers({
"Content-Type": "application/json",
"Accept": "application/json"
})
fetch(cirlcleMatcherURL, {
method: "POST",
headers: {
'Accept': 'application/json, text/plain, */*',
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
})
.then(res => res.json())
.then(res => {
document.cookie = ""
document.cookie = "x-circle-id="+res.circles[0].id
window.location.reload(true)
})
.catch(err => {
console.log(err)
document.cookie = "x-circle-id=UNMATCHED"
window.location.reload(true)
})
})
</script>
</body>
</html>