Skip to content

Commit

Permalink
added run out of sync cue
Browse files Browse the repository at this point in the history
  • Loading branch information
leomcelroy committed Aug 5, 2022
1 parent 568799c commit b2fbcea
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions dispatches/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export function run(args, state) {

state.logs = [];
state.errorInfo = null;
state.staleRun = false;

const cmLines = document.querySelectorAll(".err-line");

Expand Down
3 changes: 2 additions & 1 deletion events.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ export function addEvents(state) {

if (isCM) {
// set code to stale
const rerender = !state.stale;
const rerender = !state.stale || !state.staleRun;
state.stale = true;
state.staleRun = true;

if (rerender) dispatch("RENDER");
}
Expand Down
1 change: 1 addition & 0 deletions global_state.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ export const global_state = {
savedGames: [],
palette,
stale: false,
staleRun: true,
}
16 changes: 12 additions & 4 deletions index.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ body {
color: red;
}

.stale {
background: #ba8722d6;
}

.menu-name {
box-shadow: inset 0 -6px 0 0 var(--pcb-trace);
font-weight: bold;
Expand All @@ -99,6 +95,18 @@ body {
box-shadow: inset 0 -50px 0 0 var(--pcb-lighter);
}

.stale {
background: #ba8722d6;
}

.stale-run {
box-shadow: inset 0 -6px 0 0 #ba8722d6;
}

.stale-run:hover {
box-shadow: inset 0 -50px 0 0 #ba8722d6;
}

.dropdown-list > *:hover {
background: var(--bg-floating);
}
Expand Down
2 changes: 1 addition & 1 deletion view.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ const menu = (state) => html`
${docsOpenClosed()}-help
</div>
<div
class="menu-item run"
class=${["menu-item", "run", state.staleRun ? "stale-run" : ""].join(" ")}
@click=${() => dispatch("RUN")}>
<ion-icon name="play" style="margin-right: 6px;" />
run
Expand Down

0 comments on commit b2fbcea

Please sign in to comment.