@vladkrutenyuk/three-kvy-core
Version:
Everything you need to create any-complexity 3D apps with Three.js. Empower Three.js with a modular, lifecycle-managed context that seamlessly propagates through objects via reusable features providing structured logic.
47 lines (41 loc) • 1.41 kB
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ThreeKvyCore Example</title>
<link rel="stylesheet" href="./styles.css">
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/three@0.174.0/build/three.module.js",
"three/addons/": "https://unpkg.com/three@0.174.0/examples/jsm/",
"eventemitter3": "https://unpkg.com/eventemitter3@5.0.1/dist/eventemitter3.esm.min.js",
"@vladkrutenyuk/three-kvy-core": "../dist/esm/index.min.js"
}
}
</script>
</head>
<body>
<div id="canvas-container"></div>
<div id="state">Loading...</div>
<script type="module">
const state = document.querySelector("#state");
const params = new URLSearchParams(window.location.search);
const exampleName = params.get("name");
if (!exampleName) {
state.textContent = "Bad request";
}
const examplePath = `./${exampleName}/index.js`;
import(examplePath)
.then(() => {
state.classList.add("hide")
})
.catch((error) => {
console.error(error);
state.textContent = "Error";
});
</script>
</script>
</body>
</html>