diff --git a/assets/textures/banner.png b/assets/textures/banner.png new file mode 100644 index 0000000000000000000000000000000000000000..ce1d06154c0f61fe3c6a8170a2a9b437af933a01 Binary files /dev/null and b/assets/textures/banner.png differ diff --git a/css/gui.css b/css/gui.css index 7ae8de45e59919e60ca0dabb74a991122eef816c..d3330b612efb1a37b14050327f6b2f76e8ecbcb9 100644 --- a/css/gui.css +++ b/css/gui.css @@ -4,10 +4,47 @@ button { font-size: 16px; border-radius: 8px; padding: 5px 12px; - border: 2px solid #ffd587; + border: 2px solid blue; } .disabled { opacity: 0.5; cursor: not-allowed; } + +input { + background-color: rgba(173, 216, 230, 0.7); + border: 5px solid; + border-color: lightblue; + border-radius: 15px; + + padding-top: 10px; + padding-left: 10px; + padding-bottom: 65px; +} + +.banner { + margin: 0; + padding: 0; + width: 100%; + height: 100%; + position: fixed; + top: 0; + left: 0; + z-index: 3; + display: -ms-flexbox; + display: flex; + -ms-flex-direction: column; + flex-direction: column; + -ms-flex-pack: center; + justify-content: center; + -ms-flex-align: center; + align-items: center; + background: url("../assets/textures/banner.png") no-repeat center center fixed; + background-size: cover; + pointer-events: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} \ No newline at end of file diff --git a/js/initScene.js b/js/initScene.js index 3ed32530c4e987d84120946482ff82e6b06564fb..eb7a076e06ba88764e810e34fe72879c3d9bd3e4 100644 --- a/js/initScene.js +++ b/js/initScene.js @@ -58,6 +58,7 @@ window.onload = function () { if (!isSimulationRunning) { let simBtn = document.getElementById("simBtn") simBtn.disabled = true + // showWinnerBanner() } } }); @@ -258,7 +259,8 @@ var addUI = function () { simBtn.style.zIndex = "2" simBtn.disabled = true document.body.appendChild(simBtn); - simBtn.style.right = `${20 + input.getBoundingClientRect().width - simBtn.getBoundingClientRect().width}px` + simBtn.style.right = `${5 + input.getBoundingClientRect().width - simBtn.getBoundingClientRect().width}px` + simBtn.style.top = `${simBtn.getBoundingClientRect().top + 20}px` } simBtn.addEventListener("click", function () { @@ -343,4 +345,17 @@ var cleanSimulation = function () { vehicules[i].vehicule = null } vehicules = [] +} + + +var showWinnerBanner = function () { + console.log("SHOW WINNER BANNER") + let winnerBanner = document.getElementById("banner") + if (!winnerBanner) { + winnerBanner = document.createElement("p"); + winnerBanner.id = "banner" + winnerBanner.className = "banner" + winnerBanner.textContent = "I AM A WINNER" + document.body.appendChild(winnerBanner); + } } \ No newline at end of file