Spaces:
Sleeping
Sleeping
File size: 10,805 Bytes
c32cdfb | 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 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HR Chatbot Widget - Bottom Right Corner</title>
<style>
/* Demo page styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: #f8fafc;
min-height: 100vh;
padding: 40px;
}
.demo-content {
max-width: 800px;
margin: 0 auto;
}
.demo-content h1 {
font-size: 2rem;
color: #1e293b;
margin-bottom: 20px;
}
.demo-content p {
color: #64748b;
line-height: 1.8;
margin-bottom: 15px;
}
.demo-content .note {
background: #fef3c7;
border-left: 4px solid #f59e0b;
padding: 16px 20px;
border-radius: 0 8px 8px 0;
margin: 30px 0;
}
.demo-content .note strong {
color: #92400e;
}
/* ============================================
CHATBOT WIDGET STYLES - COPY FROM HERE
============================================ */
/* Chat Toggle Button */
.chat-widget-button {
position: fixed;
bottom: 24px;
right: 24px;
width: 64px;
height: 64px;
border-radius: 50%;
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
border: none;
cursor: pointer;
box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
z-index: 9998;
}
.chat-widget-button:hover {
transform: scale(1.1);
box-shadow: 0 12px 40px rgba(99, 102, 241, 0.5);
}
.chat-widget-button svg {
width: 28px;
height: 28px;
fill: white;
transition: transform 0.3s ease;
}
.chat-widget-button.active svg {
transform: rotate(90deg);
}
/* Notification Badge */
.chat-widget-badge {
position: absolute;
top: -4px;
right: -4px;
width: 20px;
height: 20px;
background: #ef4444;
border-radius: 50%;
color: white;
font-size: 12px;
font-weight: 600;
display: flex;
align-items: center;
justify-content: center;
animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.1); }
}
/* Chat Window */
.chat-widget-window {
position: fixed;
bottom: 100px;
right: 24px;
width: 400px;
height: 600px;
background: white;
border-radius: 20px;
box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
overflow: hidden;
z-index: 9999;
opacity: 0;
visibility: hidden;
transform: translateY(20px) scale(0.95);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.chat-widget-window.open {
opacity: 1;
visibility: visible;
transform: translateY(0) scale(1);
}
/* Chat Header */
.chat-widget-header {
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
padding: 18px 20px;
display: flex;
align-items: center;
justify-content: space-between;
}
.chat-widget-header-info {
display: flex;
align-items: center;
gap: 12px;
}
.chat-widget-avatar {
width: 44px;
height: 44px;
background: rgba(255, 255, 255, 0.2);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
}
.chat-widget-title {
color: white;
}
.chat-widget-title h3 {
font-size: 1rem;
font-weight: 600;
margin-bottom: 2px;
}
.chat-widget-title span {
font-size: 0.8rem;
opacity: 0.9;
display: flex;
align-items: center;
gap: 6px;
}
.chat-widget-title .status-dot {
width: 8px;
height: 8px;
background: #4ade80;
border-radius: 50%;
}
.chat-widget-close {
background: rgba(255, 255, 255, 0.2);
border: none;
width: 32px;
height: 32px;
border-radius: 50%;
color: white;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.2s;
}
.chat-widget-close:hover {
background: rgba(255, 255, 255, 0.3);
}
/* Chat Body (iframe container) */
.chat-widget-body {
flex: 1;
overflow: hidden;
}
.chat-widget-body iframe {
width: 100%;
height: 100%;
border: none;
}
/* Mobile Responsive */
@media (max-width: 480px) {
.chat-widget-window {
width: calc(100% - 20px);
height: calc(100% - 120px);
right: 10px;
bottom: 90px;
border-radius: 16px;
}
.chat-widget-button {
width: 56px;
height: 56px;
bottom: 20px;
right: 20px;
}
}
/* ============================================
END OF CHATBOT WIDGET STYLES
============================================ */
</style>
</head>
<body>
<!-- Demo Page Content -->
<div class="demo-content">
<h1>Your Website Content Here</h1>
<p>This is a demo page showing how the HR Chatbot widget appears in the bottom right corner. The chatbot is always accessible to visitors while they browse your website.</p>
<p>Our HR Assistant is powered by advanced AI technology, providing instant answers to your human resources questions. Whether you need guidance on policies, hiring practices, or workplace regulations, our chatbot is here to help.</p>
<p>The widget is designed to be non-intrusive while remaining easily accessible. It works seamlessly on both desktop and mobile devices.</p>
<div class="note">
<strong>👉 Click the chat button in the bottom right corner to open the HR Assistant!</strong>
</div>
<p>Get instant support for common HR inquiries including employee onboarding, benefits information, leave policies, and workplace compliance. Our AI assistant is available 24/7 to provide helpful guidance.</p>
<p>Please note that while our chatbot provides general HR information, it should not replace professional legal or HR advice for important decisions.</p>
</div>
<!-- ============================================
CHATBOT WIDGET HTML - COPY FROM HERE
============================================ -->
<!-- Chat Toggle Button -->
<button class="chat-widget-button" id="chatWidgetButton" onclick="toggleChat()">
<span class="chat-widget-badge">1</span>
<svg viewBox="0 0 24 24" id="chatIcon">
<path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/>
</svg>
<svg viewBox="0 0 24 24" id="closeIcon" style="display: none;">
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
</svg>
</button>
<!-- Chat Window -->
<div class="chat-widget-window" id="chatWidgetWindow">
<div class="chat-widget-header">
<div class="chat-widget-header-info">
<div class="chat-widget-avatar">🤖</div>
<div class="chat-widget-title">
<h3>HR Assistant</h3>
<span><span class="status-dot"></span> Online</span>
</div>
</div>
<button class="chat-widget-close" onclick="toggleChat()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
</svg>
</button>
</div>
<div class="chat-widget-body">
<iframe
src="https://pikamomo-hr-intervals-chatbot.hf.space"
title="HR Chatbot"
loading="lazy">
</iframe>
</div>
</div>
<!-- ============================================
CHATBOT WIDGET JAVASCRIPT - COPY THIS TOO
============================================ -->
<script>
let isOpen = false;
const button = document.getElementById('chatWidgetButton');
const window_el = document.getElementById('chatWidgetWindow');
const chatIcon = document.getElementById('chatIcon');
const closeIcon = document.getElementById('closeIcon');
const badge = document.querySelector('.chat-widget-badge');
function toggleChat() {
isOpen = !isOpen;
if (isOpen) {
window_el.classList.add('open');
button.classList.add('active');
chatIcon.style.display = 'none';
closeIcon.style.display = 'block';
badge.style.display = 'none';
} else {
window_el.classList.remove('open');
button.classList.remove('active');
chatIcon.style.display = 'block';
closeIcon.style.display = 'none';
}
}
// Close on escape key
document.addEventListener('keydown', function(e) {
if (e.key === 'Escape' && isOpen) {
toggleChat();
}
});
</script>
</body>
</html>
|