Update cubzh.html
Browse files- cubzh.html +22 -49
cubzh.html
CHANGED
@@ -1,61 +1,34 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
<html lang="en">
|
3 |
-
|
4 |
<head>
|
5 |
<meta charset="UTF-8">
|
6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7 |
-
<title>
|
8 |
-
<style>
|
9 |
-
body,
|
10 |
-
html {
|
11 |
-
margin: 0;
|
12 |
-
padding: 0;
|
13 |
-
height: 100%;
|
14 |
-
overflow: hidden;
|
15 |
-
}
|
16 |
-
|
17 |
-
.fullscreen-iframe {
|
18 |
-
position: absolute;
|
19 |
-
top: 0;
|
20 |
-
left: 0;
|
21 |
-
width: 100%;
|
22 |
-
height: 100%;
|
23 |
-
}
|
24 |
-
|
25 |
-
iframe {
|
26 |
-
width: 100%;
|
27 |
-
height: 100%;
|
28 |
-
}
|
29 |
-
</style>
|
30 |
</head>
|
31 |
-
|
32 |
<body>
|
33 |
-
<div
|
34 |
-
<
|
|
|
|
|
35 |
</div>
|
36 |
|
37 |
<script>
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
}
|
55 |
-
}
|
56 |
-
document.addEventListener("DOMContentLoaded", onDOMContentLoaded);
|
57 |
-
|
58 |
</script>
|
59 |
</body>
|
60 |
-
|
61 |
-
</html>
|
|
|
1 |
<!DOCTYPE html>
|
2 |
<html lang="en">
|
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>NPC Chat Interface</title>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
</head>
|
|
|
8 |
<body>
|
9 |
+
<div id="npc-chat-container">
|
10 |
+
<p id="npc-response">NPC is waiting...</p>
|
11 |
+
<input type="text" id="player-input" placeholder="Type your message here..." />
|
12 |
+
<button id="send-button">Send</button>
|
13 |
</div>
|
14 |
|
15 |
<script>
|
16 |
+
document.getElementById('send-button').addEventListener('click', async function () {
|
17 |
+
const playerInput = document.getElementById('player-input').value;
|
18 |
+
const npcResponseElement = document.getElementById('npc-response');
|
19 |
+
|
20 |
+
// Call the LLM API
|
21 |
+
const response = await fetch('https://api.your-llm.com/inference', {
|
22 |
+
method: 'POST',
|
23 |
+
headers: {
|
24 |
+
'Content-Type': 'application/json',
|
25 |
+
},
|
26 |
+
body: JSON.stringify({ prompt: playerInput }),
|
27 |
+
});
|
28 |
+
|
29 |
+
const data = await response.json();
|
30 |
+
npcResponseElement.textContent = data.response; // Assuming the LLM response is in data.response
|
31 |
+
});
|
|
|
|
|
|
|
|
|
32 |
</script>
|
33 |
</body>
|
34 |
+
</html>
|
|