parent
fe44570d52
commit
8b2aa8f905
@ -0,0 +1,138 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/style.css">
|
||||||
|
<script src="https://unpkg.com/konva@6.0.0/konva.min.js"></script>
|
||||||
|
<script src="js/const.js"></script>
|
||||||
|
<script src="js/func.js"></script>
|
||||||
|
<script src="js/logique.js"></script>
|
||||||
|
<script src="js/init.js"></script>
|
||||||
|
<script src="js/createElement.js"></script>
|
||||||
|
<script src="js/easytimer.min.js"></script>
|
||||||
|
<script src="js/timer.js"></script>
|
||||||
|
<script src="js/creator.js"></script>
|
||||||
|
<link href="https://use.fontawesome.com/releases/v5.0.4/css/all.css" rel="stylesheet">
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Bitter:wght@700&display=swap" rel="stylesheet">
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>Make It True</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<!-- The Modal -->
|
||||||
|
<div id="myModal" class="modal">
|
||||||
|
|
||||||
|
<!-- Modal content -->
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header" align=center>
|
||||||
|
<br>
|
||||||
|
<h1>Game Over</h1>
|
||||||
|
<br>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body" align=center>
|
||||||
|
<br>
|
||||||
|
<p>Temps total : 13 m 40 s</p>
|
||||||
|
<p>Temps moyen par niveau : 20.5s</p>
|
||||||
|
<p>Score moyen par niveau : 4.5</p>
|
||||||
|
<br>
|
||||||
|
<h2>Score total : 140</h2>
|
||||||
|
<br>
|
||||||
|
<input type="text" placeholder="Pseudo">
|
||||||
|
<button>Envoyer son score</button>
|
||||||
|
<br><br><br>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<br>
|
||||||
|
<button onclick="window.location.href='index.html'">Home</button>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="header-container">
|
||||||
|
<h1 align=center>Niveau <a id="niveau">0</a></h1>
|
||||||
|
<div align=center>
|
||||||
|
<a>Temps :</a>
|
||||||
|
<a id="timer">0 m 0 s</a>
|
||||||
|
<a id="timerend">20</a>
|
||||||
|
</div>
|
||||||
|
<div id="progressBar"></div>
|
||||||
|
</div>
|
||||||
|
<div id="play-container"></div>
|
||||||
|
<script>
|
||||||
|
var mobile = false;
|
||||||
|
var switchs = [], lineCount = [], logiques = [],lines = [], endLines = [],end, switchsInfo= [], switchsInfoCopy = [],lineRemove = [];
|
||||||
|
|
||||||
|
var niveauActuel = localStorage.getItem("niveau");
|
||||||
|
if(niveauActuel == null){
|
||||||
|
niveauActuel = 1;
|
||||||
|
}
|
||||||
|
let niveauhtml = document.getElementById('niveau');
|
||||||
|
niveauhtml.innerHTML = niveauActuel;
|
||||||
|
|
||||||
|
var layer = new Konva.Layer();
|
||||||
|
let container = document.getElementById('play-container');
|
||||||
|
container.style.height = innerHeight /100*80 + "px";
|
||||||
|
var width = container.offsetWidth;
|
||||||
|
var height = container.offsetHeight;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var stage = new Konva.Stage({
|
||||||
|
container: 'play-container',
|
||||||
|
/*rotation: -90,
|
||||||
|
x: 20,
|
||||||
|
y: 1000,*/
|
||||||
|
width: width,
|
||||||
|
height: height,
|
||||||
|
});
|
||||||
|
stage.add(layer);
|
||||||
|
|
||||||
|
initLayer();
|
||||||
|
|
||||||
|
creatorRandomPyramid();
|
||||||
|
|
||||||
|
checkAllSortieLogique();
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
var modal = document.getElementById("myModal");
|
||||||
|
window.onclick = function(event) {
|
||||||
|
if (event.target == modal) {
|
||||||
|
modal.style.display = "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fitStageIntoParentContainer();
|
||||||
|
|
||||||
|
function fitStageIntoParentContainer() {
|
||||||
|
if(window.innerWidth < window.innerHeight && mobile == false){
|
||||||
|
stage.rotate(90);
|
||||||
|
stage.x(stage.getX() + stage.height());
|
||||||
|
stage.draw();
|
||||||
|
mobile=true;
|
||||||
|
}else if(mobile){
|
||||||
|
stage.rotate(0);
|
||||||
|
stage.draw();
|
||||||
|
mobile=true;
|
||||||
|
}
|
||||||
|
var container = document.querySelector('#play-container');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// now we need to fit stage into parent
|
||||||
|
var containerWidth = container.offsetWidth;
|
||||||
|
// to do this we need to scale the stage
|
||||||
|
var scale = containerWidth / width;
|
||||||
|
|
||||||
|
stage.width(width * scale);
|
||||||
|
stage.height(height * scale);
|
||||||
|
stage.scale({ x: scale, y: scale });
|
||||||
|
stage.draw();
|
||||||
|
}
|
||||||
|
window.addEventListener('resize', fitStageIntoParentContainer);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in new issue