-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
53 lines (51 loc) · 1.64 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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>暂无标题</title>
<link rel="stylesheet" href="style.css">
<style>
/* 确保html和body元素占满整个屏幕 */
html, body {
height: 100%;
margin: 0;
overflow: hidden; /* 隐藏滚动条 */
}
/* 使容器和Ruffle播放器全屏和自适应 */
#container {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
#container ruffle-player {
flex-shrink: 0; /* 防止播放器被压缩 */
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="container"></div>
<script src="path/to/ruffle.js"></script>
<script src="path/ruffle/rufset.js"></script>
<script>
window.addEventListener('load', async () => {
window.RufflePlayer.config = {
/*fontSources: ["https://cdn.wzhecnu.cn/adventure/myfont.swf"], // load up fonts here
defaultFonts: {
sans: ["站酷快乐体2016修订版"], // then replace them here.
},*/
scale: "showAll",
forceScale: true,
}
const ruffle = window.RufflePlayer.newest();
const player = ruffle.createPlayer();
const container = document.getElementById('container');
container.appendChild(player);
player.load('');
});
</script>
</body>
</html>