-
Notifications
You must be signed in to change notification settings - Fork 0
/
chat-widget.html
215 lines (208 loc) · 9.12 KB
/
chat-widget.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
210
211
212
213
214
215
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<form>
<select id="obj-animation">
<option value="barFlip">barFlip</option>
<option value="barGlow">barGlow</option>
</select>
<button id="animator">Animate by object</button>
</form>
<form>
<select class="input input--dropdown js--animations">
<optgroup label="Apexchat specific">
<option value="glow">glow</option>
<option value="rotary">rotary</option>
</optgroup>
<optgroup label="Attention Seekers">
<option value="bounce">bounce</option>
<option value="flash">flash</option>
<option value="pulse">pulse</option>
<option value="rubberBand">rubberBand</option>
<option value="shake">shake</option>
<option value="swing">swing</option>
<option value="tada">tada</option>
<option value="wobble">wobble</option>
<option value="jello">jello</option>
<option value="heartBeat">heartBeat</option>
</optgroup>
<optgroup label="Bouncing Entrances">
<option value="bounceIn">bounceIn</option>
<option value="bounceInDown">bounceInDown</option>
<option value="bounceInLeft">bounceInLeft</option>
<option value="bounceInRight">bounceInRight</option>
<option value="bounceInUp">bounceInUp</option>
</optgroup>
<optgroup label="Bouncing Exits">
<option value="bounceOut">bounceOut</option>
<option value="bounceOutDown">bounceOutDown</option>
<option value="bounceOutLeft">bounceOutLeft</option>
<option value="bounceOutRight">bounceOutRight</option>
<option value="bounceOutUp">bounceOutUp</option>
</optgroup>
<optgroup label="Fading Entrances">
<option value="fadeIn">fadeIn</option>
<option value="fadeInDown">fadeInDown</option>
<option value="fadeInDownBig">fadeInDownBig</option>
<option value="fadeInLeft">fadeInLeft</option>
<option value="fadeInLeftBig">fadeInLeftBig</option>
<option value="fadeInRight">fadeInRight</option>
<option value="fadeInRightBig">fadeInRightBig</option>
<option value="fadeInUp">fadeInUp</option>
<option value="fadeInUpBig">fadeInUpBig</option>
</optgroup>
<optgroup label="Fading Exits">
<option value="fadeOut">fadeOut</option>
<option value="fadeOutDown">fadeOutDown</option>
<option value="fadeOutDownBig">fadeOutDownBig</option>
<option value="fadeOutLeft">fadeOutLeft</option>
<option value="fadeOutLeftBig">fadeOutLeftBig</option>
<option value="fadeOutRight">fadeOutRight</option>
<option value="fadeOutRightBig">fadeOutRightBig</option>
<option value="fadeOutUp">fadeOutUp</option>
<option value="fadeOutUpBig">fadeOutUpBig</option>
</optgroup>
<optgroup label="Flippers">
<option value="flip">flip</option>
<option value="flipInX">flipInX</option>
<option value="flipInY">flipInY</option>
<option value="flipOutX">flipOutX</option>
<option value="flipOutY">flipOutY</option>
</optgroup>
<optgroup label="Lightspeed">
<option value="lightSpeedIn">lightSpeedIn</option>
<option value="lightSpeedOut">lightSpeedOut</option>
</optgroup>
<optgroup label="Rotating Entrances">
<option value="rotateIn">rotateIn</option>
<option value="rotateInDownLeft">rotateInDownLeft</option>
<option value="rotateInDownRight">rotateInDownRight</option>
<option value="rotateInUpLeft">rotateInUpLeft</option>
<option value="rotateInUpRight">rotateInUpRight</option>
</optgroup>
<optgroup label="Rotating Exits">
<option value="rotateOut">rotateOut</option>
<option value="rotateOutDownLeft">rotateOutDownLeft</option>
<option value="rotateOutDownRight">rotateOutDownRight</option>
<option value="rotateOutUpLeft">rotateOutUpLeft</option>
<option value="rotateOutUpRight">rotateOutUpRight</option>
</optgroup>
<optgroup label="Sliding Entrances">
<option value="slideInUp">slideInUp</option>
<option value="slideInDown">slideInDown</option>
<option value="slideInLeft">slideInLeft</option>
<option value="slideInRight">slideInRight</option>
</optgroup>
<optgroup label="Sliding Exits">
<option value="slideOutUp">slideOutUp</option>
<option value="slideOutDown">slideOutDown</option>
<option value="slideOutLeft">slideOutLeft</option>
<option value="slideOutRight">slideOutRight</option>
</optgroup>
<optgroup label="Zoom Entrances">
<option value="zoomIn">zoomIn</option>
<option value="zoomInDown">zoomInDown</option>
<option value="zoomInLeft">zoomInLeft</option>
<option value="zoomInRight">zoomInRight</option>
<option value="zoomInUp">zoomInUp</option>
</optgroup>
<optgroup label="Zoom Exits">
<option value="zoomOut">zoomOut</option>
<option value="zoomOutDown">zoomOutDown</option>
<option value="zoomOutLeft">zoomOutLeft</option>
<option value="zoomOutRight">zoomOutRight</option>
<option value="zoomOutUp">zoomOutUp</option>
</optgroup>
<optgroup label="Specials">
<option value="hinge">hinge</option>
<option value="jackInTheBox">jackInTheBox</option>
<option value="rollIn">rollIn</option>
<option value="rollOut">rollOut</option>
</optgroup>
</select>
<button class="butt js--triggerAnimation">Animate it</button>
</form>
<div id="apexchat_invitation_container_wrapper" class="apexchat_rd_maximized_invitation_iframe_distance_right alpha">
<div id="apexchat_rd_invitation_bg" class="apexchat_rd_cursor_pointer livechat apexchat_rd_invitation_bg animated">
<div class="apexchat_rd_green" id="apexchat_rd_green"></div>
<div tabindex="0" id="apexchat_rd_agent_image_start_chat" class="apexchat_rd_agent_image_wrapper apexchat_rd_cursor_pointer">
<div class="apexchat_rd_agent_icon_dots apexchat_rd_agent_icon_wrapper">
<div class="apexchat_rd_invitation_animation" style="display: block;"> <span class="apexchat_rd_rect"></span> <span class="apexchat_rd_rect"></span> <span class="apexchat_rd_rect"></span> <span class="apexchat_rd_glider" style="display: none;"></span> </div>
</div>
<img class="apexchat_rd_agent_img" src="img/_5122.png" alt="Chat Representative" title="Chat Representative"> </div>
<div id="apexchat_rd_invitation_bubble" class="apexchat_rd_invitation_bubble apexchat_rd_invitation_bubble_right apexchat_rd_bubble_btm_right" style="display:none;">
<div class="apexchat_rd_talktext">
<div class="apexchat_rd_notification_area" id="apexchat_rd_notification_area">
<div id="apexchat_rd_invitation_typing" class="apexchat_rd_invitation_typing" style="display:none;">
<div class="apexchat_rd_rect1 apexchat_rd_invitation_typing_dots"></div>
<div class="apexchat_rd_rect2 apexchat_rd_invitation_typing_dots"></div>
<div class="apexchat_rd_rect3 apexchat_rd_invitation_typing_dots"></div>
<div class="apexchat_rd_rect4 apexchat_rd_invitation_typing_dots"></div>
</div>
<div id="apexchat_rd_notification_count" style="display:none;"></div>
</div>
</div>
</div>
<div tabindex="0" id="apexchat_rd_invitation_close" alt="Close" class="apexchat_rd_invitation_close apexchat_rd_cursor_pointer"></div>
<div tabindex="0" class="apexchat_rd_invitation_title" id="apexchat_rd_invitation_title"> Hey! Need help?
<p class="apexchat_rd_invitation_subtitle"> Let's have a quick chat </p>
</div>
</div>
</div>
<script
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
<script>
/* These objects will be dynamic objects in production.*/
var animationObj = {
"barFlip" : {
"animation" :"rotary",
"itrationCount" :3,
"delayBy" :1.3,
"targetElement" : "#apexchat_invitation_container_wrapper"
},
"barGlow": {
"animation" :"glow",
"itrationCount" :5,
"delayBy" :1.5,
"targetElement" : "#apexchat_rd_invitation_bg"
}
}
/******** No need of the functions below in prodction, just some demo functions. *******/
$("#animator").click(function(e){
e.preventDefault();
var animObj = $('#obj-animation').val();
/* How to trigger animation using animation object from an array of animation objects*/
applyAnimation(animationObj[animObj]);
});
function testAnim(x) {
var tempAnimObj = {
"animation" : x,
"itrationCount" : 1,
"delayBy" : 0,
"targetElement" : "#apexchat_rd_invitation_bg"
}
/* How to trigger animation using animation object*/
applyAnimation(tempAnimObj);
};
$(document).ready(function(){
$('.js--triggerAnimation').click(function(e){
e.preventDefault();
var anim = $('.js--animations').val();
testAnim(anim);
});
$('.js--animations').change(function(){
var anim = $(this).val();
testAnim(anim);
});
});
</script>
<script src="functions.js"></script>
</body>
</html>