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 }}} - \ No newline at end of file + + + + diff --git a/web-assets/background3.png b/web-assets/background3.png new file mode 100644 index 0000000..07b626f Binary files /dev/null and b/web-assets/background3.png differ diff --git a/web-assets/button-big.png b/web-assets/button-big.png new file mode 100644 index 0000000..b35d50e Binary files /dev/null and b/web-assets/button-big.png differ diff --git a/web-assets/checkpoint.gif b/web-assets/checkpoint.gif new file mode 100644 index 0000000..51ca92a Binary files /dev/null and b/web-assets/checkpoint.gif differ diff --git a/web-assets/hamsterplanet.gif b/web-assets/hamsterplanet.gif new file mode 100644 index 0000000..a0a5739 Binary files /dev/null and b/web-assets/hamsterplanet.gif differ diff --git a/web-assets/hamsterplanet.webm b/web-assets/hamsterplanet.webm new file mode 100644 index 0000000..a090e47 Binary files /dev/null and b/web-assets/hamsterplanet.webm differ diff --git a/web-assets/pge2_logo.png b/web-assets/pge2_logo.png new file mode 100644 index 0000000..261ae1b Binary files /dev/null and b/web-assets/pge2_logo.png differ