-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
63 lines (63 loc) · 2.94 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
<!DOCTYPE html>
<html>
<head>
<title>HUD</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="data:image/x-icon;base64,AAABAAEAAQEAAAEAGAAsAAAAFgAAACgAAAABAAAAAgAAAAEAGAAAAAAACAAAACgAAAAoAAAAAAAAAAAAAADwgEEAAAAAAA==">
<script type="text/javascript" src="huds"></script>
<script type="text/javascript" src="@vue/dist/vue.global.prod.js"></script>
<script type="text/javascript" src="@vue3-sfc-loader/dist/vue3-sfc-loader.js"></script>
<script>less = { env: "production", logLevel: 0 };</script>
<script type="text/javascript" src="@less/dist/less.min.js"></script>
<script type="text/javascript" src="@mousetrap/mousetrap.min.js"></script>
<script type="text/javascript" src="@animejs/lib/anime.min.js"></script>
</head>
<body>
<div id="index">
<index></index>
</div>
<style type="text/css">
html { margin: 0; padding: 0; }
body { margin: 0; padding: 0; width: 100vw; height: 100vh; position: relative; }
</style>
<script>
huds = new HUDS()
huds.connect()
let vars = huds.config({ flat: true, sep: "-" })
for (const key of Object.keys(vars))
if (typeof vars[key] === "string")
vars[key] = vars[key].replace(/'/g, "\\'")
Vue.load = (name) => {
return window["vue3-sfc-loader"].loadModule(name, {
moduleCache: {
vue: Vue,
less: less
},
getFile (url) {
return fetch(url).then((res) => res.ok ? res.text() :
Promise.reject(Object.assign(new Error(`${url}: ${res.statusText}`), { res })))
},
addStyle (textContent) {
const style = Object.assign(document.createElement("style"), { textContent })
const ref = document.head.getElementsByTagName("style")[0] || null
document.head.insertBefore(style, ref)
},
log (type, ...args) {
console.log("vue3-sfc-loader", type, ...args)
},
additionalModuleHandlers: {
".css": (source, path, options) => {
return less.render(source, { globalVars: vars }).then((result) => result.css)
}
}
})
}
Vue.loadComponent = (name) =>
Vue.defineAsyncComponent(() => Vue.load(name))
app = Vue.createApp({ components: { "index": Vue.loadComponent("index.vue") }})
app.mount("#index")
console.log("hello world on the client side")
</script>
</body>
</html>