Files
cadhub/web/src/index.html
Kurt Hutten 4fefee073c Update logo around the website
updated the favicon with a webpack plugin, as will as on the MainLayout
Plus some other tweaks to the main layout while I was there

resolves #107
2020-11-18 07:56:09 +11:00

52 lines
2.0 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CadHub</title> <!-- to be replaced by react helmet -->
<script>
// Install Cascade Studio as a Progressive Web App for Offline Access
// This needs to be put before ANY HTTP Requests are made, so it can cache them.
var messageHandlers = {};
var threejsViewport = {};
messageHandlers["resetWorking"] = () => { workerWorking = false; }
var cascadeStudioWorker
var workerWorking = false
var galleryProject = undefined
function initCascadeStudio() {
// if ('serviceWorker' in navigator) {
// navigator.serviceWorker.register('service-worker.js').then(function(registration) {
// registration.update(); // Always update the registration for the latest assets
// }, function() {
// console.log('Could not register Cascade Studio for offline use!');
// });
// } else {
// console.log('Browser does not support offline access!');
// }
// Begins loading the CAD Kernel Web Worker
if (window.Worker) {
cascadeStudioWorker = new Worker('/CADWorker/CascadeStudioMainWorker.js');
// Ping Pong Messages Back and Forth based on their registration in messageHandlers
// var messageHandlers = {};
cascadeStudioWorker.onmessage = function (e) {
if(e.data.type in messageHandlers){
let response = messageHandlers[e.data.type](e.data.payload);
if (response) { cascadeStudioWorker.postMessage({ "type": e.data.type, payload: response }) };
}
}
}
}
initCascadeStudio()
</script>
</head>
<body>
<div id="redwood-app"></div>
<div
id="cascade-container"
style="opacity: 0; overflow: hidden; height: calc(100vh - 8rem)"
></div>
</body>
</html>