diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4d6b5b0..55c1a7b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -278,6 +278,21 @@ if (EMSCRIPTEN)
COMMAND ${CMAKE_COMMAND}
ARGS -E rename ${CMAKE_BINARY_DIR}/bin/${OutputExecutable}.html ${CMAKE_BINARY_DIR}/bin/index.html
)
+
+ add_custom_command(
+ TARGET ${OutputExecutable}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E make_directory ${CMAKE_BINARY_DIR}/bin/web-assets
+ )
+
+ add_custom_command(
+ TARGET ${OutputExecutable}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/web-assets/*.* ${CMAKE_BINARY_DIR}/bin/web-assets/
+ )
+
endif() # Emscripten
######################################################################
diff --git a/emscripten_shell.html b/emscripten_shell.html
index ddbfb82..e483016 100644
--- a/emscripten_shell.html
+++ b/emscripten_shell.html
@@ -3,7 +3,8 @@
- Hamster
+ Hamster Planet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
+
+ })(),
+ canvas: (() => {
+ var canvas = document.getElementById('canvas');
+
+ // As a default initial behavior, pop up an alert when webgl context is lost. To make your
+ // application robust, you may want to override this behavior before shipping!
+ // See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
+ canvas.addEventListener("webglcontextlost", (e) => { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false);
+
+ return canvas;
+ })(),
+ setStatus: (text) => {},
+ totalDependencies: 0,
+ monitorRunDependencies: (left) => {},
+
+ preRun: [
+ function()
+ {
+ document.body.classList.toggle("start", true);
+ Module["addRunDependency"]("click-to-start");
+
+ document.getElementById("start-button").addEventListener("click", (event) =>
+ {
+ document.body.classList.toggle("loading", true);
+ document.body.classList.toggle("start", false);
+
+ document.getElementById('canvas').focus();
+ setTimeout(() => Module["removeRunDependency"]("click-to-start"), 50);
+ });
+ },
+ ],
+
+ onRuntimeInitialized: function()
+ {
+ document.body.classList.toggle("loading", false);
+ document.body.classList.toggle("loaded", true);
+ },
+};
+
{{{ SCRIPT }}}
-