update
This commit is contained in:
39
html/index.html
Normal file
39
html/index.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>opencdn</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
html, body {
|
||||
height: 100%;
|
||||
background: #09090b;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="./bundle.js"></script>
|
||||
<script>
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
const appContainer = document.getElementById('app');
|
||||
const config = window.__OPENCDN_CONFIG__ || {};
|
||||
const path = window.location.pathname;
|
||||
|
||||
let element;
|
||||
if (path.startsWith('/peek')) {
|
||||
element = document.createElement('opencdn-peekpage');
|
||||
element.allowedPackages = config.allowedPackages || [];
|
||||
} else {
|
||||
element = document.createElement('opencdn-mainpage');
|
||||
element.version = config.version || '1.0.0';
|
||||
element.mode = config.mode || 'prod';
|
||||
element.allowedPackages = config.allowedPackages || [];
|
||||
}
|
||||
|
||||
appContainer.appendChild(element);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user