Merge branch 'dev' into gh-pages

This commit is contained in:
Garrett Finucane 2014-08-18 14:06:00 -04:00
commit dc222c8a5a
6 changed files with 43 additions and 3 deletions

View file

@ -86,6 +86,7 @@
<div id="openSideBar" class = 'helpText'><i class="fa fa-info-circle fa-lg"></i> <i class="fa fa-arrow-left"><b> Help</b></i></div>
<div id="overlay" class="faded"></div>
<div id = 'pauseBtn'><div id = 'pauseBtnInner'><i class="fa fa-pause fa-2x"></div></i></div>
<div id = 'colorBlindBtn'><b> Color Blind</b></div>
<div id = 'restartBtn'><div id = 'restartBtnInner'><i class="fa fa-refresh fa-2x"></i></div></div>
<div id="bottombar">
<div style="bottom:4px; padding-right:4px;" class="fb-like" data-href="http://hextris.github.io/hextris" data-width="20" data-layout="button_count" data-action="like" data-show-faces="false" data-share="true"></div>

View file

@ -15,6 +15,7 @@ function Hex(sideLength) {
this.x = trueCanvas.width / 2;
this.y = trueCanvas.height / 2;
this.ct = 0;
this.lastUpdate = Date.now();
this.lastCombo = this.ct - settings.comboTime;
this.lastColorScored = "#000";
this.comboTime = 1;

View file

@ -72,6 +72,31 @@ function addKeyListeners() {
pause();
return false;
});
$("#colorBlindBtn").on('touchstart mousedown', function() {
window.colors = ["#8e44ad", "#f1c40f", "#3498db", "#d35400"];
window.hexColorsToTintedColors = {
"#8e44ad": "rgb(229,152,102)",
"#f1c40f": "rgb(246,223,133)",
"#3498db": "rgb(151,201,235)",
"#d35400": "rgb(210,180,222)"
};
window.rgbToHex = {
"rgb(142,68,173)": "#8e44ad",
"rgb(241,196,15)": "#f1c40f",
"rgb(52,152,219)": "#3498db",
"rgb(211,84,0)": "#d35400"
};
window.rgbColorsToTintedColors = {
"rgb(142,68,173)": "rgb(229,152,102)",
"rgb(241,196,15)": "rgb(246,223,133)",
"rgb(52,152,219)": "rgb(151,201,235)",
"rgb(46,204,113)": "rgb(210,180,222)"
};
});
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {

View file

@ -67,6 +67,7 @@ function update() {
i--;
}
}
MainHex.ct++;
if(Date.now()-MainHex.lastUpdate>=17){
MainHex.ct++;
}
}

View file

@ -26,7 +26,7 @@ function waveGen(hex) {
this.dt = 0;
this.update = function() {
this.currentFunction();
this.dt += 16.6666667;
this.dt = MainHex.dt * 17;
this.computeDifficulty();
if ((this.dt - this.lastGen) * settings.creationSpeedModifier > this.nextGen) {
if (this.nextGen > 600) {

View file

@ -123,6 +123,18 @@ button:focus {
background-color:rgba(236,240,241,.7);
}
#colorBlindBtn {
position:absolute;
width:120px;
height:20px;
z-index:9999;
left: 47%;
top:65%;
font-size:15px;
text-align:center;
color:#232323;
cursor:pointer;
}
.instructions_body {
margin-left:3px;
width:calc(100% - 12px) ! important;