-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.html
More file actions
52 lines (50 loc) · 1.77 KB
/
demo.html
File metadata and controls
52 lines (50 loc) · 1.77 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GoChatX Widget Demo</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 2rem;
background: #f5f5f5;
color: #333;
}
h1 { margin-bottom: 1rem; }
p { max-width: 600px; line-height: 1.6; }
code {
background: #e0e0e0;
padding: 0.15em 0.4em;
border-radius: 3px;
font-size: 0.9em;
}
</style>
</head>
<body>
<h1>GoChatX Widget Demo</h1>
<p>This is a plain HTML page with GoChatX embedded via a single script tag.
The floating bubble should appear in the bottom-right corner.</p>
<p>Click it to open the chat. Everything is end-to-end encrypted via Matrix.</p>
<h2>Console Commands</h2>
<ul>
<li><code>GoChatX.open()</code> - Open the chat panel</li>
<li><code>GoChatX.close()</code> - Close the chat panel</li>
<li><code>GoChatX.toggle()</code> - Toggle open/close</li>
<li><code>GoChatX.isOpen()</code> - Check if panel is open</li>
<li><code>GoChatX.addMessage('Hello!', 'incoming')</code> - Add a message</li>
<li><code>GoChatX.reset()</code> - Reset the chat</li>
</ul>
<!-- For dev: points to dist/. Production copy lives in dist/demo.html (auto-built). -->
<script type="module" src="./dist/gochatx.js"
data-homeserver="https://matrix.simplego.dev"
data-registration-url="http://localhost:3001/api/token"
data-operator="@sash710:simplego.dev"
data-name="GoChatX Support"
data-color="#45bdd1"
data-bubble-animation="shimmer-flip"
data-welcome="Welcome! This chat is end-to-end encrypted via Matrix."
data-lang="en"></script>
</body>
</html>