diff --git a/View/src/CSS/Enigme.css b/View/src/CSS/Enigme.css index 39c12373..d5cf406d 100644 --- a/View/src/CSS/Enigme.css +++ b/View/src/CSS/Enigme.css @@ -31,10 +31,20 @@ ul { a{ color: white; + cursor: pointer; text-decoration: none !important; font-family: Equinox, sans-serif; } +a:hover{ + color: #44fff6; + transition: all 0.4s ease-in-out; + -webkit-transition: all 0.4s ease-in-out; + -moz-transition: all 0.4s ease-in-out; + -ms-transition: all 0.4s ease-in-out; + -o-transition: all 0.4s ease-in-out; +} + /***** Text CSS *****/ p{ @@ -80,7 +90,7 @@ h1, h2, h3, h4, h5, h6 { .btn{ position: relative; - width: 120px; + width: 130px; height: 60px; background: transparent; } diff --git a/View/src/JS/baseMulti.js b/View/src/JS/baseMulti.js index 25bb5d75..93b34ab5 100644 --- a/View/src/JS/baseMulti.js +++ b/View/src/JS/baseMulti.js @@ -1,131 +1,135 @@ function run() { - const terminal = document.getElementById("console"); - const runner = new BrythonRunner({ - stdout: { - write(content) { - terminal.innerHTML += content; - terminal.scrollTop = terminal.scrollHeight; - }, - flush() {}, + const terminal = document.getElementById("console"); + const runner = new BrythonRunner({ + stdout: { + write(content) { + terminal.innerHTML += content; + terminal.scrollTop = terminal.scrollHeight; }, - stderr: { - write(content) { - terminal.innerHTML += content; - terminal.scrollTop = terminal.scrollHeight; - }, - flush() {}, + flush() {}, + }, + stderr: { + write(content) { + terminal.innerHTML += content; + terminal.scrollTop = terminal.scrollHeight; }, - stdin: { - async readline() { - terminal.innerHTML += "\n"; - terminal.scrollTop = terminal.scrollHeight; - var userInput = prompt(); - return userInput; - }, - flush() {}, + flush() {}, + }, + stdin: { + async readline() { + terminal.innerHTML += "\n"; + terminal.scrollTop = terminal.scrollHeight; + var userInput = prompt(); + return userInput; }, - }); - var code = editor.getValue(); - runner.runCode(code); - setTimeout(() => { - runner.stopRunning(); - }, 10 * 1000); - } - - function run_init() { - if (document.getElementById("console") != "") { - document.getElementById("console").innerHTML = ""; - } - run(); - } - - var editor = ace.edit("editor"); - editor.container.style.opacity = 0.85; - editor.setTheme("ace/theme/vibrant_ink"); - editor.getSession().setMode("ace/mode/python"); - editor.setFontSize("16px"); - editor.setOptions({ - enableLiveAutocompletion: true, - copyWithEmptySelection: true, - showGutter: true, - useWrapMode: true, // wrap text to view - indentedSoftWrap: false, + flush() {}, + }, }); - - //Function that execute given code and return the result in a given element by id - - function exec(code, id) { - const terminal = document.getElementById("console"); - terminal.innerHTML = ""; - const runner = new BrythonRunner({ - stdout: { - write(content) { - if (id == "code") { - retourCode = content; - } - if (id == "solution") { - retourSolution = content; - } - }, - flush() {}, + var code = editor.getValue(); + runner.runCode(code); + setTimeout(() => { + runner.stopRunning(); + }, 10 * 1000); +} + +function run_init() { + if (document.getElementById("console") != "") { + document.getElementById("console").innerHTML = ""; + } + run(); +} + +var editor = ace.edit("editor"); +editor.container.style.opacity = 0.85; +editor.setTheme("ace/theme/vibrant_ink"); +editor.getSession().setMode("ace/mode/python"); +editor.setFontSize("16px"); +editor.setOptions({ + enableLiveAutocompletion: true, + copyWithEmptySelection: true, + showGutter: true, + useWrapMode: true, // wrap text to view + indentedSoftWrap: false, +}); + +//Function that execute given code and return the result in a given element by id + +function exec(code, id) { + const terminal = document.getElementById("console"); + terminal.innerHTML = ""; + const runner = new BrythonRunner({ + stdout: { + write(content) { + if (id == "code") { + retourCode = content; + } + if (id == "solution") { + retourSolution = content; + } }, - stderr: { - write(content) { - if (id == "solution") { - retourSolution = "ERROR"; - } - terminal.innerHTML += content; - terminal.scrollTop = terminal.scrollHeight; - }, - flush() {}, + flush() {}, + }, + stderr: { + write(content) { + if (id == "solution") { + retourSolution = "ERROR"; + } + terminal.innerHTML += content; + terminal.scrollTop = terminal.scrollHeight; }, - stdin: { - async readline() { - terminal.innerHTML += "\n"; - terminal.scrollTop = terminal.scrollHeight; - var userInput = prompt(); - return userInput; - }, - flush() {}, + flush() {}, + }, + stdin: { + async readline() { + terminal.innerHTML += "\n"; + terminal.scrollTop = terminal.scrollHeight; + var userInput = prompt(); + return userInput; }, - }); - runner.runCode(code); - setTimeout(() => { - runner.stopRunning(); - }, 10 * 1000); - } - - /** - * It checks if the code in the editor as the same result as the solution. - */ - function check() { - if (retourSolution == "ERROR") { - result.innerHTML = "Il semblerait qu'il y a une erreur dans ton code :/"; - } else if (retourSolution == retourCode) { - result.innerHTML = "Bien joué"; - document.getElementById("next").style.display = "flex"; - } else { - result.innerHTML = "Mauvaise réponse"; - } + flush() {}, + }, + }); + runner.runCode(code); + setTimeout(() => { + runner.stopRunning(); + }, 10 * 1000); +} + +/** + * It checks if the code in the editor as the same result as the solution. + */ +function check() { + if (retourSolution == "ERROR") { + result.innerHTML = "Il semblerait qu'il y a une erreur dans ton code :/"; + } else if (retourSolution == retourCode) { + result.innerHTML = "Bien joué"; + document.getElementById("next").style.display = "flex"; + } else { + result.innerHTML = "Mauvaise réponse"; } - - - - /** - * If the help is displayed, hide it. Otherwise, display it. - */ - function displayHelp() { - var help = document.getElementsByClassName("help"); - - if (help[0].style.display == "block") { - for (var i = 0; i < help.length; i++) { - help[i].style.display = "none"; - } - return; - } - +} + +/** + * If the help is displayed, hide it. Otherwise, display it. + */ +function displayHelp() { + var help = document.getElementsByClassName("help"); + + if (help[0].style.display == "block") { for (var i = 0; i < help.length; i++) { - help[i].style.display = "block"; + help[i].style.display = "none"; } + return; + } + + for (var i = 0; i < help.length; i++) { + help[i].style.display = "block"; } - \ No newline at end of file +} + +/** + * It opens a new window with the name dashboard.html and the size of 1000x450. + */ +function dashboard() { + window.open("dashboard.html", "", "width=1000, height=450"); +} \ No newline at end of file diff --git a/View/src/pages/Multijoueur/Partie.html b/View/src/pages/Multijoueur/Partie.html index c2f7f066..b0bc6856 100644 --- a/View/src/pages/Multijoueur/Partie.html +++ b/View/src/pages/Multijoueur/Partie.html @@ -26,34 +26,23 @@