-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlgIntroForm.html
209 lines (175 loc) · 4.45 KB
/
lgIntroForm.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
@font-face {
font-family: lgFont;
src: url("./LG Smart Regular.ttf");
}
#biggerText{
margin-left: auto;
margin-right:auto;
width: 320px;
text-align: center;
margin-top: 1rem;
font-weight: bold;
font-size: 1.2rem;
}
#smallerText{
margin-left: auto;
margin-right:auto;
width: 320px;
text-align: center;
margin-top: 0.5rem;
font-size: 1rem;
}
body{
width: 100%;
padding: 0;
height: 100%;
margin: 1rem 0;
font-family: lgFont;
}
.btnDiv{
width: 300px;
background-color: #a50034;
color: #fff;
border-radius: 3px;
margin-left: auto;
margin-right:auto;
margin-top: 1rem;
text-align: center;
padding: 0.5rem;
cursor: pointer;
}
.hidden{
display: none;
}
.visible{
display: block;
}
#disclaimer{
bottom: 3rem;
text-align: center;
padding-left: 20%;
padding-right: 20%;
font-size: 1.2rem;
}
#biggerText2{
margin-left: auto;
margin-right:auto;
width: 320px;
text-align: center;
margin-top: 1rem;
font-size: 1.2rem;
}
.boldText{
font-weight: bold;
}
.smallerText{
font-size: 1rem;
}
</style>
</head>
<body>
<div id="first" class="visible">
<div id="biggerText">
S čím vám můžeme pomoci?
</div>
<div id="smallerText">
Vyberte jednu z kategorií a začněte!
</div>
<div id="tv" class="btnDiv">TV/AUDIO/VIDEO</div>
<div id="spotrebice" class="btnDiv">DOMÁCÍ SPOTŘEBIČE</div>
</div>
<div id="second" class="hidden">
<div id="biggerText2">
V komunikaci s <span class="boldText">LG ASISTENTEM</span> preferujete
</div>
<div id="chat" class="btnDiv">CHAT</div>
<div id="video" class="btnDiv">VIDEO</div>
</div>
<div id="third" class="hidden">
<div id="disclaimer">
Souhlasíte s poskytováním služeb v rozsahu a pouze po dobu komunikace s LG Asistentem <span class="smallerText">(Komunikace bude nahrávána a uchovávána pro účely zlepšení kvality služeb)</span>?
</div>
<div id="consentYes" class="btnDiv">ANO</div>
<div id="consentNo" class="btnDiv">NE</div>
</div>
<script type="text/javascript">
(function()
{
const tv = document.getElementById('tv');
const spotrebice = document.getElementById('spotrebice');
const chat = document.getElementById('chat');
const video = document.getElementById('video');
const first = document.getElementById('first');
const second = document.getElementById('second');
const third = document.getElementById('third');
const consentYes = document.getElementById('consentYes');
const consentNo = document.getElementById('consentNo');
let firstOption = null;
let secondOption = null;
tv.addEventListener("click", function() {
first.classList.remove("visible");
first.classList.add("hidden");
second.classList.remove("hidden");
second.classList.add("visible");
firstOption = 'tv';
});
spotrebice.addEventListener("click", function() {
first.classList.remove("visible");
first.classList.add("hidden");
second.classList.remove("hidden");
second.classList.add("visible");
firstOption = 'spotrebice';
});
chat.addEventListener("click", function() {
window.parent.postMessage({
type: "ADD_CUSTOM_DATA",
name: "kategorie",
value: firstOption
}, "*");
/*window.parent.postMessage({
type: "ENQUEUE"
}, "*");*/
second.classList.remove("visible");
second.classList.add("hidden");
third.classList.remove("hidden");
third.classList.add("visible");
});
video.addEventListener("click", function() {
window.parent.postMessage({
type: "ADD_CUSTOM_DATA",
name: "kategorie",
value: firstOption
}, "*");
window.parent.postMessage({
type: "ADD_CUSTOM_DATA",
name: "entryFormVideo",
value: "ANO"
}, "*");
/*window.parent.postMessage({
type: "ENQUEUE"
}, "*");*/
second.classList.remove("visible");
second.classList.add("hidden");
third.classList.remove("hidden");
third.classList.add("visible");
});
consentYes.addEventListener("click", function() {
window.parent.postMessage({
type: "ENQUEUE"
}, "*");
});
consentNo.addEventListener("click", function() {
window.parent.postMessage({
type: "CLOSE_CHAT"
}, "*");
console.log("event sent", window);
});
}
)();
</script>
</body>
</html>