Merge branch 'gh-pages' of https://github.com/teamsnowman/hextris into gh-pages
This commit is contained in:
commit
cad6441fcc
5 changed files with 33 additions and 5 deletions
10
index.html
10
index.html
|
@ -7,7 +7,7 @@
|
|||
<link rel="stylesheet" type="text/css" href="style/style.css">
|
||||
<link rel="stylesheet" href="style/fa/css/font-awesome.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<body onload="toggleAudio()">
|
||||
<canvas id="canvas"></canvas>
|
||||
<div id='devtools' style='z-index:3;display:none;position:absolute;left:50%;width:400px;height:400px;top:50%;margin-top:-200px;margin-left:-200px;'>
|
||||
<h2 id = 'clickToExit' style = 'background-color:#fff;color:#000'>Click to exit</h2>
|
||||
|
@ -65,7 +65,15 @@
|
|||
</p>
|
||||
</div>
|
||||
<div onClick="showHelp()" id="openSideBar"><i class="fa fa-info-circle fa-lg"></i><span id ='helpText'> <i class="fa fa-arrow-left"><b> Help</b></span></div>
|
||||
<audio id="intro">
|
||||
<source src="sounds/intro.ogg" type="audio/ogg">
|
||||
</audio >
|
||||
<audio id="loop" autoplay loop="loop">
|
||||
<source src="sounds/loop.ogg" type="audio/ogg">
|
||||
</audio>
|
||||
<div id="overlay" class="faded"></div>
|
||||
<div id = 'pauseBtn'><i class="fa fa-pause fa-2x"></i></div>
|
||||
<div id = 'volumeBtn'><i class="fa fa-volume-up fa-2x"></i></div>
|
||||
<div id = 'restartBtn'><i class="fa fa-refresh fa-2x"></i></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -26,7 +26,7 @@ function drawSide(startVertex,endVertex,fraction,offset){
|
|||
} else {
|
||||
ctx.strokeStyle = MainHex.lastColorScored;
|
||||
}
|
||||
ctx.lineWidth =4;
|
||||
ctx.lineWidth =4*settings.scale;
|
||||
var radius = (settings.rows * settings.blockHeight) * (2/Math.sqrt(3)) + settings.hexWidth + 2;
|
||||
var halfRadius = radius/2;
|
||||
var triHeight = radius *(Math.sqrt(3)/2);
|
||||
|
|
|
@ -104,7 +104,15 @@ $(document).ready(function(){
|
|||
|
||||
return false;
|
||||
});
|
||||
$("#volumeBtn").on('touchstart mousedown', function() {
|
||||
if (toggleAudio()) {
|
||||
$("#volumeBtn").html('<i class="fa fa-volume-off fa-2x"></i>');
|
||||
} else {
|
||||
$("#volumeBtn").html('<i class="fa fa-volume-up fa-2x"></i>');
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
$("#restartBtn").on('touchstart mousedown', function() {
|
||||
if (gameState==2 || gameState==1 || importing == 1) {
|
||||
init(1);
|
||||
|
|
|
@ -171,6 +171,12 @@ function hideUIElements() {
|
|||
$('#restartBtn').hide();
|
||||
$('#startBtn').hide();
|
||||
}
|
||||
function toggleAudio(){
|
||||
var loopAudio = document.getElementById("loop");
|
||||
if(loopAudio.paused) loopAudio.play();
|
||||
else loopAudio.pause()
|
||||
return loopAudio.paused
|
||||
}
|
||||
|
||||
function init(b) {
|
||||
if (b) {
|
||||
|
@ -187,8 +193,7 @@ function init(b) {
|
|||
}, 7000);
|
||||
clearSaveState();
|
||||
}
|
||||
|
||||
hideUIElements();
|
||||
hideUIElements();
|
||||
var saveState = localStorage.getItem("saveState") || "{}";
|
||||
saveState = JSONfn.parse(saveState);
|
||||
document.getElementById("canvas").className = "";
|
||||
|
|
|
@ -59,7 +59,14 @@ button:focus {
|
|||
color:#000;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
#volumeBtn {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
right: 4px;
|
||||
z-index: 3000;
|
||||
color:#000;
|
||||
cursor:pointer;
|
||||
}
|
||||
#pauseBtn {
|
||||
position: absolute;
|
||||
margin-bottom: 3px;
|
||||
|
|
Loading…
Reference in a new issue