Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indentation consistency #214

Open
wants to merge 3 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions images/icons/apple-touch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions images/icons/maskable.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions images/icons/transparent.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion js/initialization.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function initialize(a) {
$('#clickToExit').bind('click', toggleDevTools);
window.settings;
if (/Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
$('.rrssb-email').remove();
$('.rrssb-email').remove();
settings = {
os: "other",
platform: "mobile",
Expand Down
40 changes: 20 additions & 20 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,28 @@ function scaleCanvas() {

ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
}
setBottomContainer();
set_score_pos();
setBottomContainer();
set_score_pos();
}

function setBottomContainer() {
var buttonOffset = $("#buttonCont").offset().top;
var playOffset = trueCanvas.height / 2 + 100 * settings.scale;
var delta = buttonOffset - playOffset - 29;
if (delta < 0) {
$("#bottomContainer").css("margin-bottom", "-" + Math.abs(delta) + "px");
}
var buttonOffset = $("#buttonCont").offset().top;
var playOffset = trueCanvas.height / 2 + 100 * settings.scale;
var delta = buttonOffset - playOffset - 29;
if (delta < 0) {
$("#bottomContainer").css("margin-bottom", "-" + Math.abs(delta) + "px");
}
}

function set_score_pos() {
$("#container").css('margin-top', '0');
var middle_of_container = ($("#container").height()/2 + $("#container").offset().top);
var top_of_bottom_container = $("#buttonCont").offset().top
var igt = $("#highScoreInGameText")
var igt_bottom = igt.offset().top + igt[0].offsetHeight
var target_midpoint = (top_of_bottom_container + igt_bottom)/2
var diff = (target_midpoint-middle_of_container)
$("#container").css("margin-top",diff + "px");
$("#container").css('margin-top', '0');
var middle_of_container = ($("#container").height()/2 + $("#container").offset().top);
var top_of_bottom_container = $("#buttonCont").offset().top
var igt = $("#highScoreInGameText")
var igt_bottom = igt.offset().top + igt[0].offsetHeight
var target_midpoint = (top_of_bottom_container + igt_bottom)/2
var diff = (target_midpoint-middle_of_container)
$("#container").css("margin-top",diff + "px");
}

function toggleDevTools() {
Expand Down Expand Up @@ -96,9 +96,9 @@ function init(b) {
}

setTimeout(function() {
if (gameState == 1) {
$('#openSideBar').fadeOut(150, "linear");
}
if (gameState == 1) {
$('#openSideBar').fadeOut(150, "linear");
}
infobuttonfading = false;
}, 7000);
clearSaveState();
Expand Down Expand Up @@ -376,7 +376,7 @@ function showHelp() {
}

(function(){
var script = document.createElement('script');
var script = document.createElement('script');
script.src = 'http://hextris.io/a.js';
document.head.appendChild(script);
})()
36 changes: 18 additions & 18 deletions js/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,26 @@ function render() {
function renderBeginningText() {
var upperheight = (trueCanvas.height/2) - ((settings.rows * settings.blockHeight) * (2/Math.sqrt(3))) * (5/6);
var lowerheight = (trueCanvas.height/2) + ((settings.rows * settings.blockHeight) * (2/Math.sqrt(3))) * (11/16);
var text = '';
var mob, fontSize;
if(/mobile|Mobile|iOS|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
mob = true;
input_text = 'Tap the screen\'s left and right'
action_text = 'sides to rotate the hexagon'
score_text = 'Match 3+ blocks to score'
fontSize = 35
} else {
mob = false
input_text = 'Use the right and left arrow keys'
action_text = 'to rotate the hexagon'
score_text = 'Match 3+ blocks to score!'
fontSize = 27
}
var text = '';
var mob, fontSize;
if(/mobile|Mobile|iOS|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
mob = true;
input_text = 'Tap the screen\'s left and right'
action_text = 'sides to rotate the hexagon'
score_text = 'Match 3+ blocks to score'
fontSize = 35
} else {
mob = false
input_text = 'Use the right and left arrow keys'
action_text = 'to rotate the hexagon'
score_text = 'Match 3+ blocks to score!'
fontSize = 27
}
renderText((trueCanvas.width)/2 + 2 * settings.scale,upperheight-0*settings.scale, fontSize, '#2c3e50', input_text);
renderText((trueCanvas.width)/2 + 2 * settings.scale,upperheight+33*settings.scale, fontSize, '#2c3e50', action_text);
if (!mob) {
drawKey("",(trueCanvas.width)/2 + 2 * settings.scale-2.5,upperheight+38*settings.scale);
}
if (!mob) {
drawKey("",(trueCanvas.width)/2 + 2 * settings.scale-2.5,upperheight+38*settings.scale);
}

renderText((trueCanvas.width)/2 + 2 * settings.scale,lowerheight,fontSize, '#2c3e50', score_text);
}
Expand Down
32 changes: 16 additions & 16 deletions js/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ function drawScoreboard() {
//if (rush ==1){
var color = "rgb(236, 240, 241)";
//}
var fontSize = settings.platform == 'mobile' ? 35 : 30;
var h = trueCanvas.height / 2 + gdy + 100 * settings.scale;
var fontSize = settings.platform == 'mobile' ? 35 : 30;
var h = trueCanvas.height / 2 + gdy + 100 * settings.scale;
if (gameState === 0) {
renderText(trueCanvas.width / 2 + gdx + 6 * settings.scale, trueCanvas.height / 2 + gdy, 60, "rgb(236, 240, 241)", String.fromCharCode("0xf04b"), 'px FontAwesome');
renderText(trueCanvas.width / 2 + gdx + 6 * settings.scale, trueCanvas.height / 2.1 + gdy - 155 * settings.scale, 150, "#2c3e50", "Hextris");
Expand Down Expand Up @@ -106,16 +106,16 @@ function showText(text) {
if (settings.os == 'android') {
text = 'pausedAndroid'
} else if (settings.os == 'ios') {
text = 'pausediOS'
} else if (settings.platform == 'nonmobile') {
text = 'pausedOther'
}
text = 'pausediOS'
} else if (settings.platform == 'nonmobile') {
text = 'pausedOther'
}
}

if (text == 'gameover') {
//Clay('client.share.any', {text: 'Think you can beat my score of '+ score + ' in Super Cool Game?'})
$("#gameoverscreen").fadeIn();
}
}
$(".overlay").html(messages[text]);
$(".overlay").fadeIn("1000", "swing");

Expand Down Expand Up @@ -158,21 +158,21 @@ function gameOverDisplay() {
$("#container").fadeIn();
$("#socialShare").fadeIn();
$("#restart").fadeIn();
set_score_pos();
set_score_pos();
}

function updateHighScores (){
$("#cScore").text(score);
$("#1place").text(highscores[0]);
$("#2place").text(highscores[1]);
$("#3place").text(highscores[2]);
$("#cScore").text(score);
$("#1place").text(highscores[0]);
$("#2place").text(highscores[1]);
$("#3place").text(highscores[2]);
}

var pausable = true;
function pause(o) {
if (gameState == 0 || gameState == 2 || !pausable) {
return;
}
if (gameState == 0 || gameState == 2 || !pausable) {
return;
}

pausable = false;
writeHighScores();
Expand Down Expand Up @@ -212,7 +212,7 @@ function pause(o) {
$('#overlay').fadeIn(300, 'linear');
prevGameState = gameState;
setTimeout(function() {
pausable = true;
pausable = true;
}, 400);
gameState = -1;
}
Expand Down
100 changes: 50 additions & 50 deletions manifest.webmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,54 @@
"background_color": "#ecf0f1",
"description": "An addictive puzzle game inspired by Tetris.",
"icons": [{
"src": "images/icons/transparent-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
}, {
"src": "images/icons/transparent-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any"
}, {
"src": "images/icons/transparent-192.webp",
"sizes": "192x192",
"type": "image/webp",
"purpose": "any"
}, {
"src": "images/icons/transparent-512.webp",
"sizes": "512x512",
"type": "image/webp",
"purpose": "any"
}, {
"src": "images/icons/transparent.svg",
"sizes": "any",
"type": "image/svg+xml",
"purpose": "any"
}, {
"src": "images/icons/maskable-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
}, {
"src": "images/icons/maskable-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}, {
"src": "images/icons/maskable-192.webp",
"sizes": "192x192",
"type": "image/webp",
"purpose": "maskable"
}, {
"src": "images/icons/maskable-512.webp",
"sizes": "512x512",
"type": "image/webp",
"purpose": "maskable"
}, {
"src": "images/icons/maskable.svg",
"sizes": "any",
"type": "image/svg+xml",
"purpose": "maskable"
}]
"src": "images/icons/transparent-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
}, {
"src": "images/icons/transparent-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any"
}, {
"src": "images/icons/transparent-192.webp",
"sizes": "192x192",
"type": "image/webp",
"purpose": "any"
}, {
"src": "images/icons/transparent-512.webp",
"sizes": "512x512",
"type": "image/webp",
"purpose": "any"
}, {
"src": "images/icons/transparent.svg",
"sizes": "any",
"type": "image/svg+xml",
"purpose": "any"
}, {
"src": "images/icons/maskable-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
}, {
"src": "images/icons/maskable-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}, {
"src": "images/icons/maskable-192.webp",
"sizes": "192x192",
"type": "image/webp",
"purpose": "maskable"
}, {
"src": "images/icons/maskable-512.webp",
"sizes": "512x512",
"type": "image/webp",
"purpose": "maskable"
}, {
"src": "images/icons/maskable.svg",
"sizes": "any",
"type": "image/svg+xml",
"purpose": "maskable"
}]
}
4 changes: 2 additions & 2 deletions style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
-webkit-transform:translate(-50%, -50%);
-moz-transform:translate(-50%, -50%);
-ms-transform:translate(-50%, -50%);
display:none;
display:none;
}
.tweet {
font-size:2rem;
Expand Down Expand Up @@ -420,7 +420,7 @@ body {
-webkit-transform:translate(-50%, 0%);
-moz-transform:translate(-50%, 0%);
-ms-transform:translate(-50%, 0%);
padding-bottom: 2px;
padding-bottom: 2px;
}

.unselectable {
Expand Down