-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
60 lines (53 loc) · 1.82 KB
/
index.html
File metadata and controls
60 lines (53 loc) · 1.82 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
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SHEENCITY DIVA DEMO</title>
<link rel="stylesheet" type="text/css" href="https://diva.sheencity.cn/docs/_lib/diva-light-style.css" />
</head>
<body>
<div class="backend-container" id="container"></div>
<main>
<!-- 标题区域 -->
<header>
<hgroup>
<h1>光辉城市数据智能可视化分析接口演示</h1>
<h2>SHEENCITY DIVA (Data Intelligent Visual API) DEMO</h2>
</hgroup>
</header>
<!-- 左侧区域 -->
<aside class="aside-left">
<section>
<button onclick="window.location.href='./chapters/001/index.html'">第一课</button>
<button onclick="window.location.href='./chapters/002/index.html'">第二课</button>
<button onclick="window.location.href='./chapters/003/index.html'">第三课</button>
</section>
</aside>
</main>
<script src="https://diva.sheencity.cn/docs/_lib/diva-sdk-1.0.0.min.js"></script>
<!-- 初始化客户端,本段落代码无需修改 -->
<script>
let client = null;
async function run() {
let diva = null;
// 通过 UA 判断是否嵌入页面模式
if (globalThis.navigator.userAgent.includes('Mars')) {
diva = new sheencity.divaSdk.Diva({
mode: "embedded",
container: document.getElementById('container')
});
} else {
diva = new sheencity.divaSdk.Diva({
mode: "cloud",
container: document.getElementById('container'),
url: new URL('ws://127.0.0.1:3000'), // 信令服务器地址
});
}
client = await diva.init();
}
run().catch(err => console.error(err));
</script>
</body>
</html>