File size: 3,425 Bytes
75e9fb9 8dfe269 75e9fb9 6e38ac4 75e9fb9 |
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-app-mocha.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>
To start an OpenAI Agent Builder Chat, click the speech bubble icon on the bottom right of the page.
Type in a subject, and the model will give you an interesting fact on it, then tell you a "dad joke" about it
</p>
</div>
</body>
</html>
|