btn dashboard new window

ServeurDeTest
nathan boileau 2 years ago
parent 16d0209313
commit a113854bd0

@ -31,10 +31,20 @@ ul {
a{ a{
color: white; color: white;
cursor: pointer;
text-decoration: none !important; text-decoration: none !important;
font-family: Equinox, sans-serif; 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 *****/ /***** Text CSS *****/
p{ p{
@ -80,7 +90,7 @@ h1, h2, h3, h4, h5, h6 {
.btn{ .btn{
position: relative; position: relative;
width: 120px; width: 130px;
height: 60px; height: 60px;
background: transparent; background: transparent;
} }

@ -30,31 +30,31 @@ function run() {
setTimeout(() => { setTimeout(() => {
runner.stopRunning(); runner.stopRunning();
}, 10 * 1000); }, 10 * 1000);
} }
function run_init() { function run_init() {
if (document.getElementById("console") != "") { if (document.getElementById("console") != "") {
document.getElementById("console").innerHTML = ""; document.getElementById("console").innerHTML = "";
} }
run(); run();
} }
var editor = ace.edit("editor"); var editor = ace.edit("editor");
editor.container.style.opacity = 0.85; editor.container.style.opacity = 0.85;
editor.setTheme("ace/theme/vibrant_ink"); editor.setTheme("ace/theme/vibrant_ink");
editor.getSession().setMode("ace/mode/python"); editor.getSession().setMode("ace/mode/python");
editor.setFontSize("16px"); editor.setFontSize("16px");
editor.setOptions({ editor.setOptions({
enableLiveAutocompletion: true, enableLiveAutocompletion: true,
copyWithEmptySelection: true, copyWithEmptySelection: true,
showGutter: true, showGutter: true,
useWrapMode: true, // wrap text to view useWrapMode: true, // wrap text to view
indentedSoftWrap: false, indentedSoftWrap: false,
}); });
//Function that execute given code and return the result in a given element by id //Function that execute given code and return the result in a given element by id
function exec(code, id) { function exec(code, id) {
const terminal = document.getElementById("console"); const terminal = document.getElementById("console");
terminal.innerHTML = ""; terminal.innerHTML = "";
const runner = new BrythonRunner({ const runner = new BrythonRunner({
@ -93,12 +93,12 @@ function run() {
setTimeout(() => { setTimeout(() => {
runner.stopRunning(); runner.stopRunning();
}, 10 * 1000); }, 10 * 1000);
} }
/** /**
* It checks if the code in the editor as the same result as the solution. * It checks if the code in the editor as the same result as the solution.
*/ */
function check() { function check() {
if (retourSolution == "ERROR") { if (retourSolution == "ERROR") {
result.innerHTML = "Il semblerait qu'il y a une erreur dans ton code :/"; result.innerHTML = "Il semblerait qu'il y a une erreur dans ton code :/";
} else if (retourSolution == retourCode) { } else if (retourSolution == retourCode) {
@ -107,14 +107,12 @@ function run() {
} else { } else {
result.innerHTML = "Mauvaise réponse"; result.innerHTML = "Mauvaise réponse";
} }
} }
/**
/**
* If the help is displayed, hide it. Otherwise, display it. * If the help is displayed, hide it. Otherwise, display it.
*/ */
function displayHelp() { function displayHelp() {
var help = document.getElementsByClassName("help"); var help = document.getElementsByClassName("help");
if (help[0].style.display == "block") { if (help[0].style.display == "block") {
@ -127,5 +125,11 @@ function run() {
for (var i = 0; i < help.length; i++) { for (var i = 0; i < help.length; i++) {
help[i].style.display = "block"; help[i].style.display = "block";
} }
} }
/**
* 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");
}

@ -26,34 +26,23 @@
<!-- First Row --> <!-- First Row -->
<div class="row py-4 d-flex justify-content-between user-select-none"> <div class="row py-4 d-flex justify-content-between user-select-none">
<div class="col d-flex align-items-center px-0"> <div class="col d-flex align-items-center px-0">
<a class="material-icons pl-0" id="home" href="index.php?action=goToHome" <a class="material-icons pl-0" id="home" href="index.php?action=quitGame"
style="font-size: 40px; color: white">home</a> style="font-size: 40px; color: white">home</a>
</div> </div>
<div class="col-4 d-flex align-items-center justify-content-center px-0"> <div class="col-4 d-flex align-items-center justify-content-center px-0">
<button>Next</button> <a class="px-3 py-2"><b>Passer l'énigme</b></a>
</div> </div>
<!-- <div class="col-1 d-flex align-items-center justify-content-end px-0">
<a class="material-icons pl-0" id="backArrow" <div class="col-4 d-flex align-items-center justify-content-center px-0">
href="index.php?action=goToEnigme&ordre=<?php <p>Temps restant : </p>
if ($enigme->getOrdre() == 1) <div id="countdown"></div>
{ </div>
echo $enigme->getOrdre();
}
else
{
echo $enigme->getOrdre() - 1;
}?>"
style="font-size: 40px; color: white">< &nbsp;</a>
</div>
<div class="col-1 d-flex align-items-center px-0">
<a class="material-icons pl-0" id="nextArrow"
href="index.php?action=goToEnigme&ordre=<?php echo $enigme->getOrdre() + 1; ?>"
style="font-size: 40px; color: white">&nbsp; ></a>
</div> -->
<button style="background-color: transparent; border: none; outline: none;" onclick="displayHelp()" <button style="background-color: transparent; border: none; outline: none;" onclick="displayHelp()"
class="col d-flex align-items-center"> class="col d-flex align-items-center">
<div class="col text-right px-2"> <div class="col"></div>
<p class="" style="font-size: 14px; color: white"><b>Besoin d'aide ?</b></p> <div class="col-3 d-flex justify-content-end px-2" style="width:fit-content">
<p class="mr-3" style="font-size: 16px; font-family: Equinox; color: white;"><b>Besoin d'aide ?</b></p>
</div> </div>
<div class="col-1 text-right"> <div class="col-1 text-right">
<img src="View/assets/img/Foxy.png" alt="Logo" class="rounded-circle moving-fox" <img src="View/assets/img/Foxy.png" alt="Logo" class="rounded-circle moving-fox"
@ -117,16 +106,21 @@
class="p-3 rounded"></textarea> class="p-3 rounded"></textarea>
<div class="row pt-5 text-center" style="cursor: pointer"> <div class="row pt-5 text-center" style="cursor: pointer">
<div class="col-6"> <div class="col-4">
<a onclick="run_init()" class="btn"> <a onclick="run_init()" class="btn">
<span>Run</span> <span>Run</span>
</a> </a>
</div> </div>
<div class="col-6"> <div class="col-4">
<button onclick="submit()" class="btn" data-toggle="modal" data-target="#modal"> <button onclick="submit()" class="btn" data-toggle="modal" data-target="#modal">
<span>Submit</span> <span>Submit</span>
</button> </button>
</div> </div>
<div class="col-4">
<a onclick="dashboard()" class="btn">
<span>Dashboard</span>
</a>
</div>
</div> </div>
</div> </div>
<!-- End Third Column --> <!-- End Third Column -->
@ -152,7 +146,9 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<a <a
href="index.php?action=enigmeMultiEnded&index=' . $index .'" <?php
echo 'href="index.php?action=enigmeMultiEnded&index=' . $index .'"';
?>
class="btn" style="display: none" id="next" class="btn" style="display: none" id="next"
> >
<span>NEXT</span> <span>NEXT</span>
@ -167,7 +163,8 @@
charset="utf-8"></script> charset="utf-8"></script>
<script src="https://raw.githack.com/pythonpad/brython-runner/master/lib/brython-runner.bundle.js" <script src="https://raw.githack.com/pythonpad/brython-runner/master/lib/brython-runner.bundle.js"
type="text/javascript" charset="utf-8"></script> type="text/javascript" charset="utf-8"></script>
<script src="View/src/JS/baseMulti.js"></script> <script src="../../JS/baseMulti.js">
</script>
</body> </body>
</html> </html>

@ -112,16 +112,21 @@
class="p-3 rounded"></textarea> class="p-3 rounded"></textarea>
<div class="row pt-5 text-center" style="cursor: pointer"> <div class="row pt-5 text-center" style="cursor: pointer">
<div class="col-6"> <div class="col-4">
<a onclick="run_init()" class="btn"> <a onclick="run_init()" class="btn">
<span>Run</span> <span>Run</span>
</a> </a>
</div> </div>
<div class="col-6"> <div class="col-4">
<button onclick="submit()" class="btn" data-toggle="modal" data-target="#modal"> <button onclick="submit()" class="btn" data-toggle="modal" data-target="#modal">
<span>Submit</span> <span>Submit</span>
</button> </button>
</div> </div>
<div class="col-4">
<a onclick="dashboard()" class="btn">
<span>Dashboard</span>
</a>
</div>
</div> </div>
</div> </div>
<!-- End Third Column --> <!-- End Third Column -->

Loading…
Cancel
Save