From 5d263ecadf4d96c1bf80051feb29cd6eed43f8e5 Mon Sep 17 00:00:00 2001 From: "PolicyChanges1@gmail.com" Date: Sun, 28 Feb 2021 12:06:23 -0500 Subject: [PATCH] ui cleanup --- css/styles.css | 48 +++++++++++++++++++++++++++++------------------- dist/tetrion.js | 14 ++++++++------ index.html | 37 +++++++++++++++++++++---------------- src/input.js | 6 ++++-- src/main.js | 6 +++--- src/views.js | 2 +- 6 files changed, 66 insertions(+), 47 deletions(-) diff --git a/css/styles.css b/css/styles.css index 663cded..3911f15 100644 --- a/css/styles.css +++ b/css/styles.css @@ -24,6 +24,7 @@ body{ position: absolute; background: #555; background:rgba(1,1,1,.10); + width:560px; } @@ -37,9 +38,9 @@ body{ #leftSide { + top:10px; height:100%; position: absolute; - top:0px; left:0px; width:210px; text-align: left; @@ -52,19 +53,21 @@ body{ height:200px; width:200px; margin:0 auto; - background:rgba(255,255,255,.20); + background: rgba(30,30,30,.70); + border: 1px solid black; } #leftInfo ul {padding:2%;} #hold{ + left:50px; text-align:right; position:relative; width:80px; height:435px; background: #2f2f2f; margin:10px auto; - background:rgba(5,5,5,.60); + background:rgba(0,0,0,.80); } #gameOver{ @@ -89,24 +92,25 @@ body{ } #gameOver h3{ - color:AliceBlue; + color:DimGrey; } #side{ height:100%; position: absolute; - top:0; + top:-10px; right:0; left:560px; text-align: center; - background:rgba(.9,.9,.9,.70); + background:rgba(1,1,1,.30); } #info{ + height:700px; width:210px; left:210px; margin:0 auto; - background:rgba(.9,.9,.9,.70); + background:rgba(1,1,1,.30); } #preview{ @@ -116,39 +120,41 @@ body{ background: #ffffff; margin:10px auto; - background:rgba(.9,.9,.9,.90); + background:rgba(0,0,0,.80); } #levelInfo{ - color:#fff; + color:DimGrey; font-size:18px; margin:10px 0; - background:rgba(.9,.9,.9,.70); + background:rgba(0,0,0,0); } #level{ color:dodgerblue; - font-size:32px; - background:rgba(.9,.9,.9,.70); + font-size:18px; + background:rgba(0,0,0,0); } #scoreInfo{ - color:#fff; + color:DimGrey; font-size: 18px; margin-top:0; - background:rgba(.9,.9,.9,.70); + background:rgba(0,0,0,0); } #score{ color:dodgerblue; font-family: 'Arial'; - background:rgba(.9,.9,.9,.70); + background:rgba(0,0,0,0); -}#linesInfo{ - color:#fff; - font-size: 18px; +} + +#linesInfo{ + margin-top:0; - background:rgba(.9,.9,.9,.70);c + + visibility: collapse; } 100% { @@ -162,4 +168,8 @@ body{ .fadeOutUp { -webkit-animation-name: fadeOutUp; animation-name: fadeOutUp; +} +#bg { + -webkit-filter: blur(3px); + filter: blur(3px); } \ No newline at end of file diff --git a/dist/tetrion.js b/dist/tetrion.js index 2566997..caf90cd 100644 --- a/dist/tetrion.js +++ b/dist/tetrion.js @@ -602,7 +602,9 @@ var UserInputs = { var DAS = parseInt(this.settingsMap.get("Keyboard DAS")); //65.0; var ARR = parseInt(this.settingsMap.get("Keyboard ARR")); //20.0; - + if(key == 75) + console.log("keyboard key: " + key); + if(this.prevKeyboardKeys[key] != this.keyboardKeys[key]) { this.isDirectionArrowDown = false; if(this.keyboardKeys[key] == true) @@ -693,7 +695,7 @@ var UserInputs = { "50.0", "16.0", "RB", "LB", "DPad-Left", "DPad-Right", "A", "B", "DPad-Down", "DPad-Up", "Back", "", - "=/"], + "=/",""], settingsMap: [] }; @@ -836,7 +838,7 @@ var calcIntervalByLevel = function(level) { // Default max scene size var defaults = { maxHeight: 700, - maxWidth: 600 + maxWidth: 560 }; /** @@ -860,7 +862,7 @@ Tetris.prototype = { inputs.init(); this.createSettings(); // if true no openers. just random tetrinos - this.isFreePlay = true;1 + this.isFreePlay = true; this.isTimerOn = false; this.currentOpener = 0; this.doTest = false; @@ -1036,7 +1038,7 @@ Tetris.prototype = { if(this.isTimerOn) { var besttime = document.getElementById("besttime").value; var deltaTime = new Date().getTime() - this.sequencePrevTime; - if(besttime == "" || deltaTime/1000.0 < parseInt(besttime)) { + if(besttime == "" || deltaTime/1000.0 < parseFloat(besttime)) { document.getElementById("besttime").value = (deltaTime/1000.0).toString(); } this.isSequenceCompleted = true; @@ -3053,7 +3055,7 @@ var tetrisView = { }, // Update the extra reward score setLines:function(setlines){ - lines.innerHTML = setlines; + //lines.innerHTML = setlines; }, setReward:function(rewardScore){ diff --git a/index.html b/index.html index c33a46a..710fb6a 100644 --- a/index.html +++ b/index.html @@ -38,12 +38,17 @@
- - - + + + + + + + - + +