-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
67 lines (55 loc) · 1.32 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://cdn.jsdelivr.net/npm/comfy.js@latest/dist/comfy.min.js"></script>
</head>
<body>
<style>
html, body {
margin: 0;
background-color: white;
}
#chatbox {
width: 500px;
height: 750px;
background-color: tomato;
margin: 10%;
overflow: auto;
display: flex;
flex-direction: column-reverse;
}
#chatbox::-webkit-scrollbar {
display: none;
}
p.mod {
font-weight: bold;
}
</style>
<div id="chatbox">
<ul></ul>
</div>
<script>
const chatbox = document.querySelector('#chatbox ul');
ComfyJS.onChat = (user, command, message, flags, extra) => {
const newMessage = document.createElement('li');
const sender = document.createElement('p');
if (message.mod) {
sender.classList.add('mod');
}
sender.innerText = user;
const messageContents = document.createElement('blockquote');
messageContents.innerText = command;
console.table({user, command, flags});
console.table(message);
console.table(extra);
newMessage.appendChild(sender);
newMessage.appendChild(messageContents);
chatbox.appendChild(newMessage);
}
ComfyJS.Init('gamesdonequick');
</script>
</body>
</html>