-
Notifications
You must be signed in to change notification settings - Fork 1
/
chatbot.html
221 lines (200 loc) · 7 KB
/
chatbot.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
220
221
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Job Recommendation Chatbot</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
/* General styles */
body, html {
margin: 0;
padding: 0;
font-family: 'Cursive', sans-serif;
height: 100%;
background-image: url('https://files.123freevectors.com/wp-content/original/202641-light-color-plain-background.jpg');
background-size: cover;
display: flex;
justify-content: center;
align-items: center;
}
/* Circular buttons on the left side */
.side-buttons {
position: absolute;
top: 50%;
left: 255px;
transform: translateY(-50%);
display: flex;
flex-direction: column;
gap: 20px;
}
.side-button {
width: 50px;
height: 50px;
background-color: rgb(137, 79, 31);
border: none;
border-radius: 50%;
color: white;
font-size: 20px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
transition: background-color 0.3s, transform 0.3s;
}
.side-button:hover {
background-color: #3b89a1;
transform: scale(1.1);
}
.chatbot-app {
position: relative;
width: 100%;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.chatbot-container {
width: 900px;
height: 96%; /* Set the height to 80% of the viewport */
background-color: transparent;
border-radius: 0px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
overflow: hidden;
display: flex;
flex-direction: column;
position: relative;
}
.chat-header {
padding: 20px;
color: rgb(137, 79, 31);
font-size: 40px;
text-align: center;
font-family: 'Cursive';
flex: 0 1 10%; /* Takes up 10% of the container height */
}
.chat-body {
padding: 20px;
flex-grow: 1;
overflow-y: auto;
background-color: transparent;
}
.chat-footer {
padding: 10px;
background-color: gray;
display: flex;
align-items: center;
justify-content: space-between;
}
.chat-footer input {
width: 80%;
padding: 10px;
border: none;
border-radius: 20px;
outline: none;
background-color: #f1f1f1;
}
.chat-footer button {
background-color: rgb(137, 79, 31);
color: white;
border: none;
border-radius: 50%;
padding: 10px;
cursor: pointer;
transition: background-color 0.3s, transform 0.3s;
}
.chat-footer button:hover {
background-color: #3b89a1;
transform: scale(1.1);
}
/* Iframe styling for chatbot */
.iframe-container {
width: 100%;
height: 90%; /* Takes up 90% of the chatbot-container */
overflow: hidden;
border: none;
}
.image-button {
position: fixed;
bottom: 20px;
left: 20px;
background-color: transparent;
border: none;
border-radius: 50%;
padding: 0;
cursor: pointer;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
transition: transform 0.3s ease;
z-index: 1000;
}
.image-button:hover {
transform: scale(1.1);
}
.image-icon {
width: 120px;
height: 120px;
border-radius: 50%;
border: 3px solid white;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
z-index: 2;
position: relative;
}
</style>
</head>
<body>
<!-- Side buttons -->
<div class="side-buttons">
<a href="./index.html" class="side-button" data-target="home">
<i class="fas fa-home"></i>
</a>
<a href="./contact.html" class="side-button" data-target="contact">
<i class="fas fa-comment-alt"></i>
</a>
<a href="https://public.tableau.com/views/RecruitmentAnalysisFinalNew/RecruitmentStats?:showVizHome=no" class="side-button" data-target="info">
<i class="fa-solid fa-chart-line"></i>
</a>
<a href="./resume.html" class="side-button" data-target="resume">
<i class="fa-solid fa-pen-nib"></i>
</a>
</div>
<div class="chatbot-app">
<!-- Chatbot UI -->
<div class="chatbot-container">
<div class="chat-header">
<i class="fas fa-robot" style="margin-right: 10px;"></i>
Ajivika's Virtual Assistant
<i class="fas fa-headset" style="margin-left: 10px;"></i>
</div>
<!-- Iframe container for chatbot -->
<div class="iframe-container" id="iframe-container">
<iframe src="https://cdn.botpress.cloud/webchat/v2.2/shareable.html?configUrl=https://files.bpcontent.cloud/2024/12/23/07/20241223075256-8E9BNGRI.json"
width="100%" height="100%" style="border: none;"></iframe>
</div>
</div>
</div>
<!-- Floating Image Button -->
<button class="image-button">
<img src="./image.png" alt="Image Button" class="image-icon">
</button>
<script>
// JavaScript logic for iframe control
document.getElementById("send-btn").addEventListener("click", function() {
var iframeContainer = document.getElementById("iframe-container");
// If iframe already exists, remove it
if (iframeContainer.querySelector("iframe")) {
iframeContainer.removeChild(iframeContainer.querySelector("iframe"));
} else {
// Otherwise, create a new iframe
var iframe = document.createElement("iframe");
iframe.src = "https://cdn.botpress.cloud/webchat/v2.2/shareable.html?configUrl=https://files.bpcontent.cloud/2024/12/23/07/20241223075256-8E9BNGRI.json";
iframe.width = "100%";
iframe.height = "100%"; // Adjust the height to 100%
iframe.style.border = "none";
// Append the iframe to the container
iframeContainer.appendChild(iframe);
}
});
</script>
</body>
</html>