Spaces:
Running

File size: 3,320 Bytes
41ab366
 
 
 
 
 
 
d02d46e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b1e4c17
d02d46e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41ab366
 
 
 
 
 
 
 
 
 
 
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
<!doctype html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width" />
		<title>My static Space</title>
		<link rel="stylesheet" href="style.css" />
<!-- Chatbot Embed --> 
<style> 
 .chat-fab { 
   position: fixed; 
   right: 20px; 
   bottom: 20px; 
   width: 56px; 
   height: 56px; 
   border-radius: 50%; 
   border: none; 
   cursor: pointer; 
   background: #111; 
   color: #fff; 
   font-size: 24px; 
   box-shadow: 0 6px 15px rgba(0,0,0,0.25); 
   z-index: 10000; 
 } 
 
 .chat-panel { 
   position: fixed; 
   right: 20px; 
   bottom: 90px; 
   width: 400px; 
   height: 600px; 
   max-width: calc(100% - 40px); 
   transform: translateY(20px); 
   opacity: 0; 
   pointer-events: none; 
   transition: opacity .2s ease, transform .2s ease; 
   border-radius: 12px; 
   overflow: hidden; 
   box-shadow: 0 12px 30px rgba(0,0,0,.25); 
   background: #fff; 
   z-index: 10000; 
 } 
 
 .chat-panel.open { 
   opacity: 1; 
   transform: translateY(0); 
   pointer-events: auto; 
 } 
 
 .chat-header { 
   height: 44px; 
   display: flex; 
   align-items: center; 
   justify-content: space-between; 
   padding: 0 12px; 
   background: #111; 
   color: #fff; 
   font: 14px/1.2 system-ui, sans-serif; 
 } 
 
 .chat-iframe { 
   border: 0; 
   width: 100%; 
   height: calc(100% - 44px); 
   display: block; 
 } 
 
 .chat-close { 
   background: none; 
   border: 0; 
   color: #fff; 
   font-size: 18px; 
   cursor: pointer; 
 } 
</style> 
 
<script> 
 document.addEventListener('DOMContentLoaded', function () { 
   const fab = document.createElement('button'); 
   fab.className = 'chat-fab'; 
   fab.textContent = '💬'; 
   fab.setAttribute('aria-label', 'Open chat'); 
 
   const panel = document.createElement('div'); 
   panel.className = 'chat-panel'; 
   panel.setAttribute('aria-hidden', 'true'); 
 
   const header = document.createElement('div'); 
   header.className = 'chat-header'; 
   header.innerHTML = `<span>Chatbot</span>`; 
 
   const closeBtn = document.createElement('button'); 
   closeBtn.className = 'chat-close'; 
   closeBtn.textContent = '✕'; 
   closeBtn.setAttribute('aria-label', 'Close chat'); 
 
   closeBtn.addEventListener('click', () => { 
     panel.classList.remove('open'); 
     panel.setAttribute('aria-hidden', 'true'); 
   }); 
 
   const iframe = document.createElement('iframe'); 
   iframe.className = 'chat-iframe'; 
   iframe.src = 'https://openai-chatkit-starter-app2-one.vercel.app'; 
   iframe.allow = 'clipboard-write; microphone; camera'; 
   iframe.referrerPolicy = 'strict-origin-when-cross-origin'; 
 
   header.appendChild(closeBtn); 
   panel.appendChild(header); 
   panel.appendChild(iframe); 
   document.body.appendChild(fab); 
   document.body.appendChild(panel); 
 
   fab.addEventListener('click', () => { 
     panel.classList.add('open'); 
     panel.setAttribute('aria-hidden', 'false'); 
   }); 
 }); 
</script> 
<!-- End Chatbot Embed -->
    </head>
	<body>
		<div class="card">
			<h1>Welcome to your static Space!</h1>
			<p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
			<p>
				Also don't forget to check the
				<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
			</p>
		</div>
	</body>
</html>