You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

338 lines
8.3 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://use.fontawesome.com/releases/v5.0.4/css/all.css" rel="stylesheet">
<title>Make It True | Menu</title>
</head>
<style>
@font-face {
font-family: main;
src: url(../css/main.ttf);
}
@font-face {
font-family: dys;
src: url(../css/dys.otf);
}
*{
transition: .01s;
}
body{
font-family: main;
}
body {
background-color: #D7CCC8;
}
.title {
width: 100%;
text-align: center;
font-size: 8vh;
}
#menu-selection {
position: absolute;
left: 0;
right: 0;
bottom: 0;
margin: 25vh auto;
text-align: center;
}
.fa-play-circle {
font-size: 15vh;
}
.message {
font-size: 3vh;
margin-bottom: 7vh;
}
#jeu-select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
cursor: pointer;
font-size: 3vh;
background-color: transparent;
border: none;
color: #fe8a71;
}
#jeu-select:focus {
outline: none;
}
#jeu-select option {
background-color: lightgray;
border: none;
}
.btn_play ul {
text-align: center;
list-style: none;
}
.fa-cog {
font-size: 5vh;
position: absolute;
right: 0;
bottom: 0;
margin: 4vh;
transition: .5s;
}
.fa-cog:hover {
font-size: 6vh;
}
i:hover {
cursor: pointer;
}
.modal {
display: none;
position: fixed;
z-index: 1;
padding-top: 100px;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0, 0, 0);
background-color: rgba(0, 0, 0, 0.4);
}
.modal-content {
position: relative;
background-color: #fefefe;
margin: auto;
padding: 0;
border: 1px solid #888;
width: 80%;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
-webkit-animation-name: animatetop;
-webkit-animation-duration: 0.4s;
animation-name: animatetop;
animation-duration: 0.4s
}
@-webkit-keyframes animatetop {
from {
top: -300px;
opacity: 0
}
to {
top: 0;
opacity: 1
}
}
@keyframes animatetop {
from {
top: -300px;
opacity: 0
}
to {
top: 0;
opacity: 1
}
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
.modal-header {
padding: 2px 16px;
background-color: lightgrey;
color: black;
}
.modal-body {
padding: 2px 16px;
}
.modal-footer {
padding: 2px 16px;
background-color: lightgrey;
color: black;
}
img {
height: 50px;
transition: .5s;
}
img:hover {
height: 60px;
cursor: pointer;
}
</style>
<body id="body">
<div id="menu">
<p id="titleGame" class="title txt">Make It True</p>
</div>
<div class="btn_play" id="menu-selection">
<ul>
<li>
<div class="message">
<a class="txt" id="playSelection">Je veux jouer a </a>
<select id="jeu-select">
<option value="aleatoire" class="txt" id="mode1">Aleatoire</option>
<option value="perso" class="txt" id="mode2">Niveau Perso</option>
</select>
</div>
</li>
<li>
<a onclick="play()"><i class="far fa-play-circle"></i></a>
</li>
</ul>
</div>
<a onclick="setting();"><i class="fa fa-cog" id="setting" aria-hidden="true"></i></a>
<div id="myModal" class="modal">
<div class="modal-content">
<div class="modal-header" align=center>
<br>
<h1 class="txt" id="settingTitle">Parametres</h1>
<br>
</div>
<div id="setting_int" class="modal-body" align=center>
<br>
<p>
<a class="txt" id="themeDark">Theme dark</a>
<input id="darkcheck" type="checkbox" onclick="darkMode()"></p>
<p>
<a class="txt" id="dysfont">DYSLEXIE</a>
<input id="dyscheckbox" type="checkbox" onclick="dysFont()"></p>
<br>
<br><img onclick="setLang('fr')" style="margin-right:50px" src="../img/france.png" />
<img onclick="setLang('en')" src="../img/usa.png" /><br><br>
</div>
<div class="modal-footer">
<br>
<button onclick="modal.style.display = 'none';" class="txt" id="retour">Retour</button>
<br>
<br>
</div>
</div>
</div>
</body>
<script>
function play(){
//document.location.href="jeu2.html";
}
var modal = document.getElementById("myModal");
function setting() {
var modal = document.getElementById("myModal");
modal.style.display = "block";
}
function closeSetting() {
var modal = document.getElementById("myModal");
if (event.target == modal) {
modal.style.display = "none";
}
}
window.onclick = function (event) {
closeSetting();
}
function darkMode() {
var checkbox = document.getElementById("darkcheck");
if (checkbox.checked == true) {
setColor("black");
}
else {
setColor("white");
}
}
function dysFont() {
var checkbox = document.getElementById("dyscheckbox");
var textToChange = document.querySelectorAll(".txt");
var font;
if (checkbox.checked == true) {
font = "dys";
}
else {
font = "main";
}
textToChange.forEach(function (item) {
let currText = item.id;
document.getElementById(currText).style.fontFamily = font;
})
document.getElementById("jeu-select").style.fontFamily = font;
}
function setColor(color) {
if (color == "black") {
document.body.style.color = "white";
document.getElementById("body").style.backgroundColor = "black";
document.getElementById("setting_int").style.color = "white";
document.getElementById("setting_int").style.backgroundColor = "black";
} else {
document.body.style.color = "black";
document.getElementById("body").style.backgroundColor = "#D7CCC8";
document.getElementById("setting_int").style.color = "black";
document.getElementById("setting_int").style.backgroundColor = "white";
}
}
const lang = {
fr: {
titleGame: "Make It True",
settingTitle: "Parametres",
playSelection: "Je veux jouer a",
mode1: "Aleatoire",
mode2: "Niveau Perso",
themeDark: "Theme Dark :",
retour: "Retour",
dysfont: "Dyslexie :",
},
en: {
titleGame: "Make It True",
settingTitle: "Settings",
playSelection: "I want to play ",
mode1: "Random",
mode2: "Perso Level",
themeDark: "Dark Theme :",
retour: "Back",
dysfont:"Dyslexia :"
}
}
function setLang(newLang) {
var textToChange = document.querySelectorAll(".txt");
if (newLang === "fr") {
textToChange.forEach(function (item) {
let currText = item.id;
document.getElementById(currText).innerHTML = lang.fr[currText];
})
}
else {
textToChange.forEach(function (item) {
let currText = item.id;
document.getElementById(currText).innerHTML = lang.en[currText];
})
}
}
setLang("fr");
dysFont();
</script>
</html>