Skip to content
Snippets Groups Projects
Commit 601f4fd5 authored by baletiballo's avatar baletiballo
Browse files

Initially hide the WebGL Canvas, to prevent empty space if rendering breaks

parent 74ac9733
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,9 @@
</head>
<body>
<canvas id="math-mind-canvas" width="400" height="300"></canvas>
<!-- The canvas is initially hidden, it will be unhidden once the renderer is set up.
So, if that setup fails there is no empty space -->
<canvas id="math-mind-canvas" width="400" height="300" hidden></canvas>
<div id="scrollContainer">
<scroll-description title='DefaultScroll' alt='No scroll loaded yet'>
<div>No scroll selected yet.</div>
......
......@@ -7,8 +7,9 @@ const camera = new THREE.PerspectiveCamera(75, 4/3, 0.1, 1000);
const renderer = new THREE.WebGLRenderer({
canvas: document.querySelector('#math-mind-canvas')
});
// renderer.setSize( window.innerWidth, window.innerHeight );
// document.body.appendChild( renderer.domElement );
// The canvas is initially hidden, in case the three.js import fails
// If we reach this code, it obviously didn't
renderer.domElement.removeAttribute("hidden");
const controls = new OrbitControls( camera, renderer.domElement );
const pointGeo = new THREE.SphereGeometry(0.1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment