-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchat.php
More file actions
129 lines (114 loc) · 3.73 KB
/
Copy pathchat.php
File metadata and controls
129 lines (114 loc) · 3.73 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Kenai Chama - Support Chat Interface</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<link rel="stylesheet" href="css/main.css">
<style>
#chatPanel {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 400px;
height: 500px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
z-index: 9999;
overflow: hidden;
transition: opacity 0.3s ease;
}
#chatPanel iframe {
width: 100%;
height: 100%;
border: none;
}
.closeChatBtn {
position: absolute;
top: 10px;
right: 10px;
background-color: #f44336;
color: white;
border: none;
padding: 10px;
cursor: pointer;
border-radius: 50%;
}
.closeChatBtn:hover {
background-color: #d32f2f;
}
#overlay {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 9998;
}
#sidebarLink {
display: inline-block;
padding: 10px;
background-color: #4CAF50;
color: white;
text-decoration: none;
border-radius: 5px;
cursor: pointer;
}
#sidebarLink:hover {
background-color: #45a049;
}
</style>
</head>
<body>
<!-- Sidebar link to open the chat -->
<div id="sidebarLink" onclick="openChat()">Start Live Chat</div>
<!-- Overlay background when chat is open -->
<div id="overlay" onclick="closeChat()"></div>
<!-- Chat Panel -->
<div id="chatPanel">
<button class="closeChatBtn" onclick="closeChat()">X</button>
<iframe id="tawkFrame" src="about:blank"></iframe>
</div>
<script>
// Function to open chat panel and load Tawk.to
function openChat() {
document.getElementById('overlay').style.display = 'block';
document.getElementById('chatPanel').style.display = 'block';
// Load Tawk.to live chat script dynamically
var Tawk_API = Tawk_API || {}, Tawk_LoadStart = new Date();
(function(){
var s1 = document.createElement("script"), s0 = document.getElementsByTagName("script")[0];
s1.async = true;
s1.src = 'https://embed.tawk.to/your_tawk_id/default';
s1.charset = 'UTF-8';
s1.setAttribute('crossorigin', '*');
s0.parentNode.insertBefore(s1, s0);
})();
}
// Function to close chat panel
function closeChat() {
document.getElementById('overlay').style.display = 'none';
document.getElementById('chatPanel').style.display = 'none';
}
</script>
</body>
</html>
<!--Start of Tawk.to Script-->
<script type="text/javascript">
var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
(function(){
var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
s1.async=true;
s1.src='https://embed.tawk.to/673683482480f5b4f59e2c5f/1icmf1kun';
s1.charset='UTF-8';
s1.setAttribute('crossorigin','*');
s0.parentNode.insertBefore(s1,s0);
})();
</script>
<!--End of Tawk.to Script-->