-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebwizard.html
120 lines (105 loc) · 3.19 KB
/
webwizard.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link href="https://fonts.googleapis.com/css2?family=Raleway:wght@900&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" />
<style>
body {
background: black;
}
button {
font-size: 20px;
}
.font {
font-family: "Raleway", sans-serif;
text-align: center;
font-weight: 900;
padding: 16px;
color: white;
}
video {
width: 30vw;
}
.border-me {
border: 2px solid white;
}
</style>
</head>
<body>
<h1 class="font">Choose your memoji</h1>
<div class="row justify-content-center">
<div class="col">
<video id="memoji1">
<source src="./memoji1.mp4" />
</video>
</div>
<div class="col">
<video id="memoji2">
<source src="./memoji2.mp4" />
</video>
</div>
<div class="col">
<video id="memoji3">
<source src="./memoji3.mp4" />
</video>
</div>
<div class="col">
<video id="memoji4">
<source src="./memoji4.mp4" />
</video>
</div>
<div class="col">
<video id="memoji5">
<source src="./memoji5.mp4" />
</video>
</div>
<div class="col">
<video id="memoj6">
<source src="./memoji6.mp4" />
</video>
</div>
</div>
<button id="build" class="btn btn-default font" style="background: white; color: black; width: 100%">
Start building!
</button>
<script>
var lastSelected;
Array.from(document.querySelectorAll("video")).forEach((x) => {
x.muted = true;
x.addEventListener("mouseover", (e) => {
e.target.play();
});
x.addEventListener("click", (e) => {
if (lastSelected != null) {
if (lastSelected.classList.contains("border-me")) {
lastSelected.classList.remove("border-me");
}
}
console.log("click");
e.target.classList.toggle("border-me");
lastSelected = e.target;
});
});
function createPost(opts) {
fetch("/build", {
method: "post",
body: JSON.stringify(opts),
headers: {
"Content-Type": "application/json",
},
}).then(function (response) {
build.innerHTML = "CLI Build initiated, You can now close this tab!";
});
}
build.addEventListener("click", function (e) {
e.target.innerHTML = " Started.... 🚀 ";
createPost({
memoji: lastSelected.id,
});
});
</script>
</body>
</html>