dockview/packages/docs/scripts/template.html
2024-04-21 21:31:04 +01:00

96 lines
3.0 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<title>{{title}}</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/img/dockview_logo.ico" data-rh="true" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"
/>
<style media="only screen">
html,
body,
#app {
height: 100%;
width: 100%;
margin: 0;
box-sizing: border-box;
-webkit-overflow-scrolling: touch;
font-family: ui-sans-serif, system-ui, -apple-system,
BlinkMacSystemFont, Segoe UI, Roboto;
}
html {
position: absolute;
top: 0;
left: 0;
padding: 0;
overflow: auto;
}
body {
padding: 16px;
overflow: auto;
}
</style>
<script type="systemjs-importmap">
{
"imports": {
{{importPaths}}
}
}
</script>
<script src="https://cdn.jsdelivr.net/npm/systemjs@6.8.0/dist/system.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/systemjs-babel@0.3.2/dist/systemjs-babel.js"></script>
<script>
async function importCSSStyleSheet(uri) {
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = uri;
document.head.appendChild(link);
}
System.onload = function (err, id, deps, isErrSource) {
console.log(id);
if (id.endsWith('.css') && !err) {
importCSSStyleSheet(id);
}
};
</script>
</head>
<body>
<div id="app">
<script type="systemjs-module" src="import:{{app}}"></script>
</div>
<object
id="loading-spinner"
style="
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) scale(0.75);
"
type="image/svg+xml"
data="https://dockview.dev/img/dockview_logo.svg"
aria-label="loading"
></object>
<script id="loading-script">
(function () {
const cleanupLoading = () => {
if (document.querySelector('.dv-dockview')) {
document.querySelector('#loading-spinner').remove();
document.querySelector('#loading-script').remove();
} else {
requestAnimationFrame(() => cleanupLoading());
}
};
cleanupLoading();
})();
</script>
</body>
</html>