-
Notifications
You must be signed in to change notification settings - Fork 0
/
customerly.html
219 lines (210 loc) · 11.1 KB
/
customerly.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
216
217
218
219
<!DOCTYPE html>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel="shortcut icon"
href="https://app.customerly.io/assets/images/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Customerly Custom Mod</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootswatch/4.1.3/cosmo/bootstrap.min.css">
<style>
@media (max-width: 767px) {
#myframe{
height: 560px !important;
}
}
</style>
</head>
<body><div class="navbar navbar-expand-lg fixed-top navbar-dark bg-primary" style="">
<div class="container">
<a href="/" class="navbar-brand navbar-brand-center"><img class="navbar-brand-logo navbar-brand-logo-normal" src="https://app.customerly.io/assets/images/Logo_Customerly_White.svg"/ style="height: 30px;"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="https://www.facebook.com/profile.vue">Help</a>
</li>
</ul>
<ul class="nav navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="https://www.customerly.io/" target="_blank">Go Back To customerly</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container" style="padding-top: 4.5rem !important;">
<div class="alert alert-warning"><center>Missed Customerly Lifetime Deals? just forget it :') contact me <a href="https://fb.me/profile.vue">here</a></center></div>
<div class="row flex-column-reverse flex-lg-row">
<div class="col-md-8">
<form id="formgen">
<fieldset>
<div class="form-group">
<label for="inputText">Button Chat Icon URL</label>
<input type="text" class="form-control" id="inputText" name="form_icon" aria-describedby="textHelp" placeholder="Enter icon URL" value="http://f.cl.ly/items/1t0m1z1R3i1v3O2b2f0O/chato.png">
<small id="textHelp" class="form-text text-muted">Recommended using 60x60 icon image transparent.</small>
</div>
<div class="form-group">
<label for="inputText">Background Image URL</label>
<input type="text" class="form-control" id="inputText" name="form_bg" aria-describedby="textHelp" placeholder="Enter background URL">
<small id="textHelp" class="form-text text-muted">Recommended using white or pattern background image.</small>
</div>
<div class="form-group">
<label for="inputText">Button Color</label>
<input type="text" class="form-control jscolor" id="inputText" name="form_color" aria-describedby="textHelp" placeholder="Enter color">
<small id="textHelp" class="form-text text-muted">Recommended using matching color with button .</small>
</div>
<div class="form-group">
<label for="inputText">Scrollbar Color</label>
<input type="text" class="form-control jscolor" id="inputText" name="form_scrollb" aria-describedby="textHelp" placeholder="Enter color">
<small id="textHelp" class="form-text text-muted">Recommended using darkest color .</small>
</div>
<div class="form-group">
<label for="inputText">Branding Tags</label>
<select class="form-control" name="form_brand">
<option value="1">Enable</option>
<option value="0">Disable</option>
</select>
</div>
<div class="form-group">
<label for="inputText">Chat Button Style</label>
<select class="form-control" name="form_buttons">
<option value="default">Default</option>
<option value="circle">Circle</option>
<option value="cube">Cube</option>
<option value="grave">Grave</option>
<option value="front">Front</option>
<option value="leaf">Leaf</option>
</select>
</div>
<button type="submit" id="generate_it" class="btn btn-success">Generate</button>
<button id="preview_it" class="btn btn-info">Preview</button>
</fieldset><div class="result" style="display: none;"><hr>
<div class="form-group">
<label for="inputText">Copy this CSS into your site before tags head</label>
<textarea class="form-control" id="result-css"></textarea>
</div>
<strong>OR</strong><hr>
<div class="form-group">
<label for="inputText">Copy this Javascript into your site before tags footer</label>
<textarea class="form-control" id="result-js"></textarea>
</div></div>
</form>
</div>
<div class="col-md-4">
<iframe src="http://tautan.co/real.php" id="myframe" scrolling="no" width="100%" height="100%" frameborder=0></iframe>
<center>Love it ? Little Coffee can help me</center>
<a href="https://www.paypal.me/faistech" class="btn btn-primary btn-block" style="color:white"><svg style=" width: 15px; " aria-hidden="true" data-prefix="fab" data-icon="paypal" class="svg-inline--fa fa-paypal fa-w-12" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="currentColor" d="M111.4 295.9c-3.5 19.2-17.4 108.7-21.5 134-.3 1.8-1 2.5-3 2.5H12.3c-7.6 0-13.1-6.6-12.1-13.9L58.8 46.6c1.5-9.6 10.1-16.9 20-16.9 152.3 0 165.1-3.7 204 11.4 60.1 23.3 65.6 79.5 44 140.3-21.5 62.6-72.5 89.5-140.1 90.3-43.4.7-69.5-7-75.3 24.2zM357.1 152c-1.8-1.3-2.5-1.8-3 1.3-2 11.4-5.1 22.5-8.8 33.6-39.9 113.8-150.5 103.9-204.5 103.9-6.1 0-10.1 3.3-10.9 9.4-22.6 140.4-27.1 169.7-27.1 169.7-1 7.1 3.5 12.9 10.6 12.9h63.5c8.6 0 15.7-6.3 17.4-14.9.7-5.4-1.1 6.1 14.4-91.3 4.6-22 14.3-19.7 29.3-19.7 71 0 126.4-28.8 142.9-112.3 6.5-34.8 4.6-71.4-23.8-92.6z"></path></svg> Donate here</a>
</div>
</div>
</div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jscolor/2.0.4/jscolor.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var frm = $('#formgen');
var regexICON = /([a-z\-_0-9\/\:\.]*\.(jpg|jpeg|png|gif|ico))/i;
frm.submit(function (e) {
e.preventDefault();
let array = frm.serializeArray();
if(regexICON.test(array[0].value) != true){
alert('Chat Icon URL invalid or empty');
}else{
var iconurl = array[0].value;
var cl = array[2].value;
var bg = array[1].value;
if(array[3].value){
var scollor = '#'+array[3].value;
}else{
var scollor = '#FF3C2E';
}
if(array[4].value == 0){
var nobranding = '#customerly-livechat-by{ display : none; }#customerly-actions-container { margin: 15px 0px 0px; position: fixed; }';
}else{
var nobranding = '';
}
var style = array[5].value;
}
$('#result-css').val(generate(bg,cl,scollor,iconurl,nobranding,style));
$('#result-js').val(jstemplate(generate(bg,cl,scollor,iconurl,nobranding,style)));
$('.result').show();
});
$('#preview_it').click(function(e){
e.preventDefault();
let array = frm.serializeArray();
if(regexICON.test(array[0].value) != true){
alert('Chat Icon URL invalid or empty');
}else{
var iconurl = array[0].value;
var cl = array[2].value;
var bg = array[1].value;
if(array[3].value){
var scollor = '#'+array[3].value;
}else{
var scollor = '#FF3C2E';
}
if(array[4].value == 0){
var nobranding = '#customerly-livechat-by{ display : none; }#customerly-powered-by{display:none;}#customerly-actions-container { margin: 15px 0px 0px; position: fixed; }';
}else{
var nobranding = '';
}
var style = array[5].value;
loadIframe('myframe','http://tautan.co/real.php?c='+btoa(generate(bg,cl,scollor,iconurl,nobranding,style)))
}
console.log('Previewing')
});
});
function jstemplate(data){
return `(function(c, u, s, l, y) { s[c] = s[c] || function() { (s[c].q = s[c].q || [ ["time", 0, +new Date()] ]).push(arguments) }; y = l.getElementsByTagName(u)[0]; l = l.createElement('style'); l.type = "text/css"; l.innerHTML = atob("`+btoa(data)+`"); y.parentNode.insertBefore(l, y) })("customerly", "script", window, document);`;
}
function loadIframe(iframeName, url) {
var $iframe = $('#' + iframeName);
if ( $iframe.length ) {
$iframe.attr('src',url);
return false;
}
return true;
}
function generate(bg,cl,scollor,iconurl,nobranding,style){
var background = '#customerly-sheet-content{background-image: url('+bg+') !important;}';
var color = '#customerly-launcher-button-background{background-color: #'+cl+' !important; border-color: #'+cl+' !important;}';
var data = background+color+nobranding+'#customerly-launcher-button-icon{ background-repeat: no-repeat; background-size: contain; background-image: url('+iconurl+'); } #customerly-launcher-button-icon svg{ display :none; } #customerly-sheet-content-container::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); background-color: '+scollor+'; } #customerly-sheet-content-container::-webkit-scrollbar { width: 6px; background-color: '+scollor+'; } #customerly-sheet-content-container::-webkit-scrollbar-thumb { background-color: '+shadeColor(scollor,70)+'; }';
var shape_button = '.customerly-bubble-background svg{display:none}#customerly-launcher-button-background{border-radius:25%!important};';
var grave_button = '.customerly-bubble-background svg{display:none}#customerly-launcher-button-background{border-top-left-radius: 35% !important; border-top-right-radius: 35% !important; border-bottom-right-radius: 0% !important; border-bottom-left-radius: 0% !important;};';
var leaf_button = '.customerly-bubble-background svg{display:none}#customerly-launcher-button-background{border-top-left-radius: 0%!important; border-top-right-radius: 50% !important; border-bottom-right-radius: 0%!important; border-bottom-left-radius: 50%!important};';
var circle_button = '.customerly-bubble-background svg{display:none}#customerly-launcher-button-background{border-radius: 50%};';
var front_button = '.customerly-bubble-background svg{display:none}#customerly-launcher-button-background{border-radius: 31px 31px 6px !important};';
if(style == 'leaf'){
var addon = leaf_button;
}else if(style == 'cube'){
var addon = shape_button;
}else if(style == 'grave'){
var addon = grave_button;
}else if(style == 'circle'){
var addon = circle_button;
}else if(style == 'front'){
var addon = front_button;
}else{
var addon = '';
}
return data+addon;
}
function shadeColor(color, percent) {
var R = parseInt(color.substring(1,3),16);
var G = parseInt(color.substring(3,5),16);
var B = parseInt(color.substring(5,7),16);
R = parseInt(R * (100 + percent) / 100);
G = parseInt(G * (100 + percent) / 100);
B = parseInt(B * (100 + percent) / 100);
R = (R<255)?R:255;
G = (G<255)?G:255;
B = (B<255)?B:255;
var RR = ((R.toString(16).length==1)?"0"+R.toString(16):R.toString(16));
var GG = ((G.toString(16).length==1)?"0"+G.toString(16):G.toString(16));
var BB = ((B.toString(16).length==1)?"0"+B.toString(16):B.toString(16));
return "#"+RR+GG+BB;
}
</script>
</html>