diff --git a/index.html b/index.html index 94e112b..0a84a3b 100644 --- a/index.html +++ b/index.html @@ -143,7 +143,7 @@
- Libre ! + diff --git a/main.js b/main.js index 0599017..28cdecb 100644 --- a/main.js +++ b/main.js @@ -35,7 +35,18 @@ piano.loop = false const loadMngr = new THREE.LoadingManager(); const loader = new THREE.TextureLoader(loadMngr); +loadMngr.onStart = function (url, itemsLoaded, itemsTotal) { + message.innerHTML = 'Chargement : 0%...' +} +loadMngr.onProgress = function (url, itemsLoaded, itemsTotal) { + message.innerHTML = 'Chargement : ' + 100 * itemsLoaded / itemsTotal + '%...' +} +loadMngr.onError = function (url) { + message.innerHTML = 'Erreur de chargement' +} loadMngr.onLoad = () => { + message.innerHTML = "" + message.className = "" animate(); }; @@ -503,6 +514,7 @@ function playerCollisions() { function gameEnd() { escaped = true; + message.innerHTML = 'Libre !'; message.className = "escaped"; piano.play(); diff --git a/style.css b/style.css index 71a9677..078095c 100644 --- a/style.css +++ b/style.css @@ -30,21 +30,28 @@ body { position: absolute; left: 0; width: 100%; - font-size: 10vh; font-family: Georgia, serif; background: transparent; justify-content: center; z-index: 1; + color: gray; +} + +#message.loading { + display: flex; + top: 30vh; + font-size: 4vh; } #message a { - color: gray; text-decoration: none; + color: inherit; } #message.escaped { display: flex; opacity: 100%; + font-size: 10vh; top: 30vh; animation: escaped 5s; }