KikiQiQi commited on
Commit
56c266c
1 Parent(s): 1333678

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +53 -17
index.html CHANGED
@@ -1,19 +1,55 @@
1
  <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </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>选择对话框页面</title>
7
+ </head>
8
+ <body>
9
+
10
+ <label for="dialogueSelector">选择对话框:</label>
11
+ <select id="dialogueSelector" onchange="loadDialogue()"></select>
12
+
13
+ <div id="dialogueContainer">
14
+ <!-- 这里将显示选定的对话框页面的内容 -->
15
+ </div>
16
+
17
+ <script>
18
+ // 文件名的前缀和总数
19
+ var prefixes = ["dialogue-"];
20
+ var totalFiles = 19;
21
+ var totalFiles_1 = 6;
22
+ var totalFiles_2 = 2;
23
+ // 获取选择框元素
24
+ var selectElement = document.getElementById('dialogueSelector');
25
+ // 动态生成选项
26
+ for (var j = 0; j < prefixes.length; j++) {
27
+ for (var i = 0; i <= totalFiles; i++) {
28
+ for (var k = 0; k <= totalFiles_1; k++) {
29
+ for (var l = 0; l <= totalFiles_2; l++) {
30
+ var option = document.createElement('option');
31
+ option.value = prefixes[j] + i + "-" + k + "-" + l + '.html';
32
+ option.textContent = prefixes[j] + i + "-" + k + "-" + l;
33
+ selectElement.appendChild(option);
34
+ }
35
+ }
36
+ }
37
+ }
38
+ function loadDialogue() {
39
+ var selectedValue = selectElement.value;
40
+ var dialogueContainer = document.getElementById('dialogueContainer');
41
+ // 使用 Fetch API 异步加载选定的对话框页面
42
+ fetch(selectedValue)
43
+ .then(response => response.text())
44
+ .then(data => {
45
+ // 将页面内容设置为对话框容器的innerHTML
46
+ dialogueContainer.innerHTML = data;
47
+ })
48
+ .catch(error => console.error('Error loading dialogue:', error));
49
+ }
50
+ // 页面加载时默认加载第一个对话框页面
51
+ loadDialogue();
52
+ </script>
53
+
54
+ </body>
55
  </html>