travail sur les nouveaux graphismes, mode sombre, changemenet de langues, police pour dys ...

master
pisouvigne 5 years ago
parent f79028266e
commit 2eb6e91a1f

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before

Width:  |  Height:  |  Size: 980 B

After

Width:  |  Height:  |  Size: 980 B

Before

Width:  |  Height:  |  Size: 2.7 MiB

After

Width:  |  Height:  |  Size: 2.7 MiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 2.4 MiB

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 2.4 MiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before

Width:  |  Height:  |  Size: 934 B

After

Width:  |  Height:  |  Size: 934 B

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 3.0 MiB

After

Width:  |  Height:  |  Size: 3.0 MiB

Before

Width:  |  Height:  |  Size: 930 B

After

Width:  |  Height:  |  Size: 930 B

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Before

Width:  |  Height:  |  Size: 899 B

After

Width:  |  Height:  |  Size: 899 B

Before

Width:  |  Height:  |  Size: 925 B

After

Width:  |  Height:  |  Size: 925 B

Before

Width:  |  Height:  |  Size: 1012 B

After

Width:  |  Height:  |  Size: 1012 B

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 241 KiB

After

Width:  |  Height:  |  Size: 241 KiB

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Before

Width:  |  Height:  |  Size: 2.5 MiB

After

Width:  |  Height:  |  Size: 2.5 MiB

@ -3,6 +3,9 @@ var imageHeight = 70;
var imageWidth = 75;
var imageRotation = 0;
//couleur
const blackColor = "#444442";
//Image
const pathImg = "../img/";
const imageLogiqueEt = "eee.png";

@ -0,0 +1,156 @@
@font-face {
font-family: main;
src: url(../font/main.ttf);
}
@font-face {
font-family: dys;
src: url(../font/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;
margin: auto;
padding: 0;
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
}
.modal-body{
border:5px solid #D3D3CE;
border-radius: 15px;
}
@-webkit-keyframes animatetop {
from {
top: -200px;
opacity: 0
}
to {
top: 0;
opacity: 1
}
}
@keyframes animatetop {
from {
top: -200px;
opacity: 0
}
to {
top: 0;
opacity: 1
}
}
img {
height: 50px;
transition: .5s;
}
img:hover {
height: 60px;
cursor: pointer;
}
hr{
border : 3px solid #D3D3CE;
}
.img_france{
margin-right:50px;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

@ -0,0 +1,78 @@
<!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">
<link href="css/style.css" rel="stylesheet">
<title>Make It True | Menu</title>
</head>
<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 id="setting_int" class="modal-body" align=center>
<h1 class="txt" id="settingTitle">Parametres</h1>
<hr id="hr">
<br>
<p>
<a class="txt" id="themeDark">Theme dark</a>
<input id="darkcheck" type="checkbox" onclick="darkMode()" checked></p>
<p>
<a class="txt" id="dysfont">DYSLEXIE</a>
<input id="dyscheckbox" type="checkbox" onclick="dysFont()"></p>
<br>
<br><img onclick="setLang('fr')" class="img_france" src="img/france.png" />
<img onclick="setLang('en')" src="img/usa.png" /><br><br>
<hr id="hr">
<p id="setting_title_perso" class="txt">Personnalisation du jeu</p>
<p><a class="txt" id="active_line_setting">Couleur ligne active : </a><input type="color" id="head" name="head"
value="#e66465"></p>
<p><a class="txt" id="inactive_line_setting">Couleur ligne innactive : </a><input type="color" id="head" name="head"
value="#e66465"></p>
<br>
<hr id="hr">
<p><a>Previsualisation</a></p>
<hr id="hr">
<div class="setting_play" id="setting_container">
</div>
<br>
</div>
</div>
</div>
</body>
<script src="js/const.js"></script>
<script src="js/lang.js"></script>
<script src="js/func.js"></script>
<script src="js/main.js"></script>
<script>
function play(){
//document.location.href="jeu2.html";
}
initAll();
</script>
</html>

@ -0,0 +1,40 @@
//Portes Logiques
var imageHeight = 70;
var imageWidth = 75;
var imageRotation = 0;
//couleur
const blackColor = "#444442";
const whiteColor = "#D7CCC8";
//Image
const pathImg = "../img/";
const imageLogiqueEt = "eee.png";
const imageLogiqueOu = "zzz.png";
const imageLogiqueEtNon = "nand.png";
const imageLogiqueInv = "not_test.png";
const imageLogiqueNonOu = "aaa.png";
const imageEnd = "idea_white.png";
//line
const colorLineInnactive = "black";
const colorLineActive = "#4CFEFE";//FFF033
const lineStroke = 4;
const pourcentageBreak = 15;
//switch
const SwitchHeight = 25;
const SwitchWidth = 50;
const colorSwitchBorder = "black";
const colorSwitchInnactiveBackground = "red";
const colorSwitchActiveBackground = "green";
//timer
var timeEnd = 70;
//switch
var numberOfSwitch = 0;
//grid
var colonneTot = 4;
var numberPerColonne = [];
var liveColonneNumber = [];

@ -0,0 +1,82 @@
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 = whiteColor;
document.getElementById("body").style.backgroundColor = blackColor;
document.getElementById("setting_int").style.color = whiteColor;
document.getElementById("setting_int").style.backgroundColor = blackColor;
var hr = document.querySelectorAll("#hr");
hr.forEach(function(item){
console.log(item);
hr.style.border = "3px solid " + blackColor;
});
} else {
document.body.style.color = blackColor;
document.getElementById("body").style.backgroundColor = whiteColor;
document.getElementById("setting_int").style.color = blackColor;
document.getElementById("setting_int").style.backgroundColor = whiteColor;
var hr = document.querySelectorAll("#hr");
hr.forEach(function(item){
hr.style.border = "3px solid " + whiteColor;
});
}
}
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];
})
}
}

@ -0,0 +1,28 @@
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 :",
setting_title_perso: "Personnalisation du jeu",
active_line_setting : "Couleur ligne active : ",
inactive_line_setting : "Couleur ligne innactive : ",
},
en: {
titleGame: "Make It True",
settingTitle: "Settings",
playSelection: "I want to play ",
mode1: "Random",
mode2: "Perso Level",
themeDark: "Dark Theme :",
retour: "Back",
dysfont:"Dyslexia :",
setting_title_perso: "Game customization",
active_line_setting : "Color active line : ",
inactive_line_setting : "Color inactive line : ",
}
}

@ -0,0 +1,5 @@
function initAll(){
darkMode();
setLang("fr");
dysFont();
}

@ -1,338 +0,0 @@
<!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>
Loading…
Cancel
Save