Browse Source

Meters shake when full. Fixed undefined-many appearing

tags/v0.7.0
Fen Dweller 7 years ago
parent
commit
795650b17d
4 changed files with 40 additions and 18 deletions
  1. +9
    -0
      game.js
  2. +14
    -12
      stroll.html
  3. +16
    -5
      style.css
  4. +1
    -1
      units.js

+ 9
- 0
game.js View File

@@ -3148,6 +3148,13 @@ function update(lines = [])
function applyPercentage(name, meterPos) {
meterPos = meterPos < 0 ? 0 : meterPos;
document.querySelector("#" + name + "Meter .fill").style.setProperty("transform", "translate(0px, " + Math.round(meterPos) + "px)");

let meter = document.querySelector("#" + name + "Meter");
if (meterPos == 0) {
meter.classList.add("shaking");
} else {
meter.classList.remove("shaking");
}
}

function stylePercentage(name, storage) {
@@ -3465,6 +3472,8 @@ function startGame(e) {
document.getElementById("custom-species").style.display = 'none';
document.getElementById("action-panel").style.display = 'flex';

enable_panel("options");

enable_panel("body");
enable_button("feed");
enable_button("stomp");


+ 14
- 12
stroll.html View File

@@ -192,18 +192,6 @@
<th><button class="growth-amount" id="button-amount-100">100x</button></th>
</tr>
</table>
<div class="stat-container">
<button class="stat-button" id="button-look">Look Around</button>
<button class="stat-button" id="button-arousal">Arousal On</button>
<button class="stat-button" id="button-stroll">Status: Standing</button>
<button class="stat-button" id="button-numbers">Numbers: Full</button>
<button class="stat-button" id="button-units">Units: Metric</button>
<button class="stat-button" id="button-verbose">Verbose Text</button>
<button class="stat-button" id="button-grow-lots">SUPER BIG</button>
<button class="stat-button" id="button-dark-mode-game">Toggle Dark Mode</button>
<button class="stat-button" id="button-stats">Stats</button>
<button class="stat-button" id="button-debug-log">Debug Log</button>
</div>
</div>
<div id="log-area">
<div id="log">
@@ -225,6 +213,7 @@
<button class="action-part-button" id="action-part-waste">Waste</button>
<button class="action-part-button" id="action-part-goo">Goo</button>
<button class="action-part-button" id="action-part-misc">Misc</button>
<button class="action-part-button" id="action-part-options">Options</button>
</div>

<div class="action-tab" id="actions-body">
@@ -315,6 +304,19 @@
<button class="action-button" id="button-action-pouch_eat">Eat From Pouch</button>
<button class="action-button" id="button-action-pouch_absorb">Absorb Pouch</button>
</div>

<div class="action-tab" id="actions-options">
<button class="stat-button" id="button-look">Look Around</button>
<button class="stat-button" id="button-arousal">Arousal On</button>
<button class="stat-button" id="button-stroll">Status: Standing</button>
<button class="stat-button" id="button-numbers">Numbers: Full</button>
<button class="stat-button" id="button-units">Units: Metric</button>
<button class="stat-button" id="button-verbose">Verbose Text</button>
<button class="stat-button" id="button-grow-lots">SUPER BIG</button>
<button class="stat-button" id="button-dark-mode-game">Toggle Dark Mode</button>
<button class="stat-button" id="button-stats">Stats</button>
<button class="stat-button" id="button-debug-log">Debug Log</button>
</div>
</div>
</div>
<div class="character-build">


+ 16
- 5
style.css View File

@@ -474,15 +474,11 @@ ul {
border: 1px;
font-size: 30px;
width: 50%;
height: 100px;
height: 70px;
display: none;
}

.action-part-button.active {
border: 1px;
font-size: 30px;
width: 50%;
height: 100px;
background: #555;
}

@@ -604,3 +600,18 @@ body.dark .meterLabel {
transform: translate(0, 0);
}
}

/* stolen directly from w3schools lol */

.shaking {
animation: shake 1s;
animation-iteration-count: infinite;
}

@keyframes shake {
0% { transform: translate(0px, 0px); }
10% { transform: translate(0px, -2px); }
25% { transform: translate(0px, 0px); }
100% { transform: translate(0px, 0px); }

}

+ 1
- 1
units.js View File

@@ -25,7 +25,7 @@ function numberRough(value,suffix="") {
case 2: return prefix + "millions " + suffix;
case 3: return prefix + "billions " + suffix;
case 4: return prefix + "trillions " + suffix;
case 5: return "uncountably many";
default: return "uncountably many";
}
}
}


Loading…
Cancel
Save