Skip to content

Commit

Permalink
Big Update - Tower Reponse handling
Browse files Browse the repository at this point in the history
* Improved logging of tower responses to console
* Added Tower Response logging configuration
* Added Tower Response handling scaffolding
* Added Skull drop detection with definable callback
* Added calibration complete definable callback
*
* New Commands:
   > CommandToString - returns readable response code
   > resetTowerSkullCount - resets tower's internal count
  • Loading branch information
ChessMess committed Dec 20, 2023
1 parent 27c445b commit 21edc52
Show file tree
Hide file tree
Showing 11 changed files with 403 additions and 130 deletions.
198 changes: 102 additions & 96 deletions dist/examples/assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,40 @@

/* html is set to 62.5% so that all the REM measurements are based on 10px sizing. So basically 1.5rem = 15px */
html {
font-size: 62.5%;
font-size: 62.5%;
}
body {
font-size: 1.5em; /* currently ems cause chrome bug misinterpreting rems on body element */
line-height: 1.6;
font-weight: 400;
font-family: "Roboto", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial,
sans-serif;
color: #ffffff;
font-size: 1.5em; /* currently ems cause chrome bug misinterpreting rems on body element */
line-height: 1.6;
font-weight: 400;
font-family: "Roboto", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial,
sans-serif;
color: #ffffff;
}

/**
* Links
*/
a {
font-weight: normal;
text-decoration: none;
color: #ef6d3d;
font-weight: normal;
text-decoration: none;
color: #ef6d3d;
}
a:focus {
outline: thin dotted;
outline: thin dotted;
}

small {
font-size: 75%;
font-size: 75%;
}

@font-face {
font-family: "azkols_kerningregular";
src:
url("azkolskerning7-webfont.woff2") format("woff2"),
url("azkolskerning7-webfont.woff") format("woff");
font-weight: normal;
font-style: normal;
font-family: "azkols_kerningregular";
src:
url("azkolskerning7-webfont.woff2") format("woff2"),
url("azkolskerning7-webfont.woff") format("woff");
font-weight: normal;
font-style: normal;
}

/**
Expand All @@ -49,47 +49,47 @@ h3,
h4,
h5,
h6 {
line-height: 1;
text-rendering: optimizeLegibility; /* voodoo to enable ligatures and kerning | https://developer.mozilla.org/en-US/docs/CSS/text-rendering */
margin-top: 0;
margin-bottom: 2rem;
font-weight: 300;
line-height: 1;
text-rendering: optimizeLegibility; /* voodoo to enable ligatures and kerning | https://developer.mozilla.org/en-US/docs/CSS/text-rendering */
margin-top: 0;
margin-bottom: 2rem;
font-weight: 300;
}
h1 {
font-size: 4rem;
line-height: 1.25;
font-family: "azkols_kerningregular";
font-size: 4rem;
line-height: 1.25;
font-family: "azkols_kerningregular";
}
h2 {
font-size: 3rem;
line-height: 1.3;
font-size: 3rem;
line-height: 1.3;
}
h3 {
font-size: 2.4rem;
line-height: 1.35;
letter-spacing: -0.08rem;
font-size: 2.4rem;
line-height: 1.35;
letter-spacing: -0.08rem;
}
h4 {
font-size: 1.8rem;
line-height: 1.5;
letter-spacing: -0.05rem;
font-size: 1.8rem;
line-height: 1.5;
letter-spacing: -0.05rem;
}
h5 {
font-size: 1.5rem;
line-height: 1.6;
letter-spacing: 0;
font-size: 1.5rem;
line-height: 1.6;
letter-spacing: 0;
}
h6 {
font-size: 1.4rem;
line-height: 1.6;
letter-spacing: 0;
font-size: 1.4rem;
line-height: 1.6;
letter-spacing: 0;
}

/**
* Paragraphs
*/
p {
margin: 0 auto 1.5em auto; /* bottom margin for paragraphs */
margin: 0 auto 1.5em auto; /* bottom margin for paragraphs */
}
p + p {
}
Expand All @@ -98,24 +98,30 @@ p + p {
* Quotes & Blockquotes
*/
q {
quotes: "\00201C" "\00201D";
quotes: "\00201C" "\00201D";
}
q:before {
content: open-quote;
content: open-quote;
}
q:after {
content: close-quote;
content: close-quote;
}

blockquote {
/*background-color: #F8F8F8;*/
border-left: 2px solid #afc0d2;
margin: 1.6em 10%;
padding: 0.75em 1em;
font-size: 1.8rem;
/*background-color: #F8F8F8;*/
border-left: 2px solid #afc0d2;
margin: 1.6em 10%;
padding: 0.75em 1em;
font-size: 1.8rem;
}
blockquote p:last-child {
margin-bottom: 0;
margin-bottom: 0;
}
.skull-count {
border: 1px solid white;
border-radius: 4px;
padding: 5px 8px;
vertical-align: center;
}

/**
Expand All @@ -126,85 +132,85 @@ blockquote p:last-child {
html,
#container,
.inner {
background-color: transparent;
background-color: transparent;
}
html {
background: url(background.jpg) center center no-repeat fixed;
background-size: cover;
background: url(background.jpg) center center no-repeat fixed;
background-size: cover;
}
.tower-controller-html {
background: url(background.jpeg) center center no-repeat fixed;
background-size: cover;
background: url(background.jpeg) center center no-repeat fixed;
background-size: cover;
}
.example-game-html {
background: url(rtdtlogo.png) center center no-repeat fixed;
background-size: cover;
background: url(rtdtlogo.png) center center no-repeat fixed;
background-size: cover;
}
body {
max-width: 640px;
margin: 25px auto;
border: 2px gold solid;
max-width: 640px;
margin: 25px auto;
border: 2px gold solid;
}
header,
#content,
footer {
background: rgba(0, 0, 0, 0.6);
color: #ffffff;
background: rgba(0, 0, 0, 0.6);
color: #ffffff;
}

/* Menu Links */
ul.main-menu {
margin: 0;
padding: 0;
display: flex;
flex-wrap: wrap;
justify-content: left;
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-wrap: wrap;
justify-content: left;
list-style: none;
}
ul.main-menu li a {
margin-right: 20px;
font-size: 2rem;
border-bottom: solid transparent 3px;
color: #cfd2da;
margin-right: 20px;
font-size: 2rem;
border-bottom: solid transparent 3px;
color: #cfd2da;
}
ul.main-menu li a:hover {
color: #ffffff;
color: #ffffff;
}
ul.main-menu li a.active {
color: #ffffff;
border-bottom-color: #ef6d3d;
color: #ffffff;
border-bottom-color: #ef6d3d;
}
area {
cursor: pointer;
display: block;
cursor: pointer;
display: block;
}

/* Utility classes */
.hide {
display: none;
display: none;
}
.show {
display: block;
display: block;
}

button {
border-radius: 5px;
position: relative;
background: #444;
color: #fff;
text-transform: uppercase;
letter-spacing: 0.1rem;
font-size: 1.05rem;
padding: 0.75rem 2rem;
max-height: 33px;
border-radius: 5px;
position: relative;
background: #444;
color: #fff;
text-transform: uppercase;
letter-spacing: 0.1rem;
font-size: 1.05rem;
padding: 0.75rem 2rem;
max-height: 33px;
}
select {
border-radius: 5px;
position: relative;
background: rgba(68, 68, 68, 0.6);
color: #fff;
text-transform: uppercase;
letter-spacing: 0.1rem;
font-size: 1.05rem;
padding: 0.75rem 2rem;
border-radius: 5px;
position: relative;
background: rgba(68, 68, 68, 0.6);
color: #fff;
text-transform: uppercase;
letter-spacing: 0.1rem;
font-size: 1.05rem;
padding: 0.75rem 2rem;
}
13 changes: 10 additions & 3 deletions dist/examples/controller/TowerController.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,18 @@ <h3 style="text-align: center;">
<hr />
<br />
<div style="padding-left: 40px;">

<button id="connectButton" onclick="connectToTower()">Connect</button>
&nbsp;&nbsp;&nbsp;&nbsp;
<button id="disconnectButton" onclick="Tower.disconnect()">Disconnect</button>
&nbsp;&nbsp;&nbsp;&nbsp;
<button id="calibrate" onclick="Tower.calibrate()">Calibrate</button>
<button id="calibrate" onclick="calibrate()">Calibrate</button>
&nbsp;&nbsp;
<span class="hide" id="calibrating-message">calibrating...</span>
<br /><br />
<button id="disconnectButton" onclick="resetSkullCount()">Reset Skull Drop Count</button>
&nbsp;&nbsp;&nbsp;&nbsp;
<span class="skull-count">Skulls Dropped:&nbsp;&nbsp;<span id="skull-count">0</span></span>
<br /><br />
<button id="soundButton" onclick="playSound()">Play Sound</button>
&nbsp;
Expand Down Expand Up @@ -267,9 +274,9 @@ <h3 style="text-align: center;">
];

dropDowns.forEach(item => {
const el = Object.keys(item)[0];
const id = Object.keys(item)[0];
const data = Object.keys(Object.values(item)[0]);
let dropDown = document.getElementById(el);
let dropDown = document.getElementById(id);
data.forEach((value, index) => {
var el = document.createElement("option");
el.textContent = item.sounds ? `${index + 1}. ${value}` : value;
Expand Down
20 changes: 20 additions & 0 deletions dist/examples/controller/TowerController.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/examples/controller/TowerController.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 21edc52

Please sign in to comment.