fixed code files to match editorconfig rules

This commit is contained in:
e7d 2017-05-14 15:42:13 +02:00
parent fb928898d9
commit af6c61bec5
12 changed files with 228 additions and 206 deletions

View File

@ -3,6 +3,7 @@ body {
overflow: hidden; overflow: hidden;
font-family: sans-serif; font-family: sans-serif;
} }
.debug { .debug {
position: absolute; position: absolute;
top: 0; top: 0;
@ -13,6 +14,7 @@ body {
line-height: 80px; line-height: 80px;
text-align: center; text-align: center;
} }
.no-gamepad { .no-gamepad {
position: absolute; position: absolute;
top: 20px; top: 20px;
@ -21,6 +23,7 @@ body {
line-height: 2em; line-height: 2em;
text-align: center; text-align: center;
} }
.gamepad { .gamepad {
position: absolute; position: absolute;
top: 50%; top: 50%;
@ -30,6 +33,7 @@ body {
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: contain; background-size: contain;
} }
.help { .help {
background: whitesmoke; background: whitesmoke;
border: 1px solid rgba(0, 0, 0, 0.2); border: 1px solid rgba(0, 0, 0, 0.2);
@ -44,16 +48,20 @@ body {
top: 50%; top: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
.help.active { .help.active {
display: block; display: block;
} }
.help h2 { .help h2 {
margin-top: 0; margin-top: 0;
margin-bottom: 1.5em; margin-bottom: 1.5em;
} }
.help h3 { .help h3 {
margin-top: 1.5em; margin-top: 1.5em;
} }
.help p:last-child { .help p:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
@ -69,7 +77,8 @@ body {
text-align: left; text-align: left;
} }
.help th, .help td { .help th,
.help td {
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
line-height: 1.42857143; line-height: 1.42857143;
padding: 8px; padding: 8px;
@ -100,11 +109,14 @@ kbd {
-webkit-user-select: none; -webkit-user-select: none;
user-select: none; user-select: none;
} }
kbd[title], .key[title] {
kbd[title],
.key[title] {
cursor: help; cursor: help;
} }
kbd, kbd.dark { kbd,
kbd.dark {
background: rgb(80, 80, 80); background: rgb(80, 80, 80);
background: -moz-linear-gradient(top, rgb(60, 60, 60), rgb(80, 80, 80)); background: -moz-linear-gradient(top, rgb(60, 60, 60), rgb(80, 80, 80));
background: -webkit-gradient(linear, left top, left bottom, from(rgb(60, 60, 60)), to(rgb(80, 80, 80))); background: -webkit-gradient(linear, left top, left bottom, from(rgb(60, 60, 60)), to(rgb(80, 80, 80)));

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge"> <meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Gamepad Viewer</title> <title>Gamepad Viewer</title>
@ -10,8 +11,9 @@
<link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/main.css">
</head> </head>
<body>
<body>
<div class="no-gamepad">No active gamepad detected. Press <kbd>H</kbd> to read instructions.</div> <div class="no-gamepad">No active gamepad detected. Press <kbd>H</kbd> to read instructions.</div>
<div class="gamepad"></div> <div class="gamepad"></div>
<div class="help"> <div class="help">
@ -65,5 +67,6 @@
<script src="js/urlParam.jquery.js"></script> <script src="js/urlParam.jquery.js"></script>
<script src="js/gamepad.js"></script> <script src="js/gamepad.js"></script>
<script src="js/app.js"></script> <script src="js/app.js"></script>
</body> </body>
</html> </html>

View File

@ -479,16 +479,13 @@ class Gamepad {
if ('0' === zoomLevel) { if ('0' === zoomLevel) {
// "0" means a zoom reset // "0" means a zoom reset
this.activeGamepadZoomLevel = 1; this.activeGamepadZoomLevel = 1;
} } else if ('+' === zoomLevel && this.activeGamepadZoomLevel < 2) {
else if ('+' === zoomLevel && this.activeGamepadZoomLevel < 2) {
// "+" means a zoom in if we still can // "+" means a zoom in if we still can
this.activeGamepadZoomLevel += 0.1; this.activeGamepadZoomLevel += 0.1;
} } else if ('-' === zoomLevel && this.activeGamepadZoomLevel > 0.2) {
else if ('-' === zoomLevel && this.activeGamepadZoomLevel > 0.2) {
// "-" means a zoom out if we still can // "-" means a zoom out if we still can
this.activeGamepadZoomLevel -= 0.1; this.activeGamepadZoomLevel -= 0.1;
} } else if (!isNaN(zoomLevel = parseFloat(zoomLevel))) {
else if (!isNaN(zoomLevel = parseFloat(zoomLevel))) {
// an integer value means a value-based zoom // an integer value means a value-based zoom
this.activeGamepadZoomLevel = zoomLevel; this.activeGamepadZoomLevel = zoomLevel;
} }

View File

@ -12,18 +12,22 @@
line-height: 1; line-height: 1;
box-sizing: border-box; box-sizing: border-box;
} }
.box.small { .box.small {
width: 12.5%; width: 12.5%;
min-width: 50px; min-width: 50px;
} }
.box.medium { .box.medium {
width: 25%; width: 25%;
min-width: 100px; min-width: 100px;
} }
.box.large { .box.large {
width: 50%; width: 50%;
min-width: 200px; min-width: 200px;
} }
.box.extra-large { .box.extra-large {
width: 100%; width: 100%;
min-width: 400px; min-width: 400px;

View File

@ -40,11 +40,11 @@
); );
} }
gamepad.updateButton = function($button) { gamepad.updateButton = function ($button) {
updateElem($button); updateElem($button);
} }
gamepad.updateAxis = function($axis) { gamepad.updateAxis = function ($axis) {
updateElem($axis, 6); updateElem($axis, 6);
} }

View File

@ -112,14 +112,16 @@
left: 227px; left: 227px;
} }
.gamepad .select, .gamepad .start { .gamepad .select,
.gamepad .start {
background: url(start.svg); background: url(start.svg);
width: 28px; width: 28px;
height: 46px; height: 46px;
opacity: 0; opacity: 0;
} }
.gamepad .select[data-pressed="true"], .gamepad .start[data-pressed="true"] { .gamepad .select[data-pressed="true"],
.gamepad .start[data-pressed="true"] {
opacity: 1; opacity: 1;
} }
@ -219,12 +221,14 @@
position: absolute; position: absolute;
} }
.gamepad .face.up, .gamepad .face.down { .gamepad .face.up,
.gamepad .face.down {
width: 36px; width: 36px;
height: 52px; height: 52px;
} }
.gamepad .face.left, .gamepad .face.right { .gamepad .face.left,
.gamepad .face.right {
width: 52px; width: 52px;
height: 36px; height: 36px;
} }

View File

@ -1,4 +1,4 @@
gamepad.updateButton = function($button) { gamepad.updateButton = function ($button) {
const value = parseFloat($button.attr('data-value'), 10); const value = parseFloat($button.attr('data-value'), 10);
if ($button.is('.trigger')) { if ($button.is('.trigger')) {
@ -8,7 +8,7 @@ gamepad.updateButton = function($button) {
} }
} }
gamepad.updateAxis = function($axis) { gamepad.updateAxis = function ($axis) {
const axisX = $axis.attr('data-value-x'); const axisX = $axis.attr('data-value-x');
const axisY = $axis.attr('data-value-y'); const axisY = $axis.attr('data-value-y');
const axisZ = $axis.attr('data-value-z'); const axisZ = $axis.attr('data-value-z');

View File

@ -101,14 +101,16 @@
left: 306px; left: 306px;
} }
.gamepad .select, .gamepad .start { .gamepad .select,
.gamepad .start {
background: url(start-select.svg); background: url(start-select.svg);
width: 33px; width: 33px;
height: 33px; height: 33px;
opacity: 0; opacity: 0;
} }
.gamepad .select[data-pressed="true"], .gamepad .start[data-pressed="true"] { .gamepad .select[data-pressed="true"],
.gamepad .start[data-pressed="true"] {
opacity: 1; opacity: 1;
} }

View File

@ -1,4 +1,4 @@
gamepad.updateButton = function($button) { gamepad.updateButton = function ($button) {
const value = parseFloat($button.attr('data-value'), 10); const value = parseFloat($button.attr('data-value'), 10);
if ($button.is('.trigger')) { if ($button.is('.trigger')) {
@ -8,7 +8,7 @@ gamepad.updateButton = function($button) {
} }
} }
gamepad.updateAxis = function($axis) { gamepad.updateAxis = function ($axis) {
const axisX = $axis.attr('data-value-x'); const axisX = $axis.attr('data-value-x');
const axisY = $axis.attr('data-value-y'); const axisY = $axis.attr('data-value-y');
const axisZ = $axis.attr('data-value-z'); const axisZ = $axis.attr('data-value-z');