-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
88 lines (82 loc) · 2.65 KB
/
index.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Whatsapp API Hit</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<style>
.doc {
overflow-x: scroll;
height: 600px;
}
.doc::-webkit-scrollbar {
-webkit-appearance: none;
width: 7px;
}
.doc::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: rgba(0, 0, 0, .5);
box-shadow: 0 0 1px rgba(255, 255, 255, .5);
}
</style>
</head>
<body>
<div class="container-fluid" >
<div class="row">
<div class="col-md-12">
<div id="app" style="display: flex;justify-content: center;align-items: center;overflow: hidden;">
<div class="status" style="display:none">
<div class="alert alert-warning" role="alert" style="display: none;">
Connecting, Please wait...!
</div>
</div>
<img style="flex-shrink: 0;min-width: 100%;min-height: 100%;" src="http://ajaxloadingimages.net/gif/image?imageid=simplebar&forecolor=000000&backcolor=ffffff" alt="QR Code" id="qrcode">
<textarea style="display: none;" cols="30" rows="10" class="form-control logs"></textarea>
</div>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script>
$(document).ready(function() {
var socket = io();
socket.on('message', function(msg) {
$('.logs').append(msg+' ');
if (!(msg == 'Connecting...' || msg =='Whatsapp is ready!')) {
$('.status').empty().append(
'<div class="alert alert-info" role="alert">\n' +
msg +
'</div>'
);
}
});
socket.on('qr', function(src) {
$('.status').empty().append(
'<div class="alert alert-info" role="alert">\n' +
' Scan QR Code Here :' +
'</div>'
);
$('#qrcode').attr('src', src);
$('#qrcode').show();
});
socket.on('ready', function(data) {
$('#qrcode').hide();
$('.status').empty().append(
'<div class="alert alert-success" role="alert">\n' +
' Whatsapp is ready!' +
'</div>'
);
});
socket.on('authenticated', function(data) {
$('#qrcode').hide();
});
});
</script>
</body>
</html>