diff --git a/js/main.js b/js/main.js index f25327f..33edd96 100644 --- a/js/main.js +++ b/js/main.js @@ -723,7 +723,6 @@ const GAME_UI_HTML = ` -
@@ -898,17 +897,6 @@ class Game { } }); - // Populate demo scrubber - let scrubber_el = this.container.querySelector('.demo-scrubber'); - let scrubber_elements = {}; - for (let [action, label] of Object.entries(ACTION_LABELS)) { - let el = mk('li'); - scrubber_el.append(el); - scrubber_elements[action] = el; - } - this.demo_scrubber_marker = mk('div.demo-scrubber-marker'); - scrubber_el.append(this.demo_scrubber_marker); - // Populate input debugger this.input_el = this.container.querySelector('.input'); this.input_action_elements = {}; @@ -921,30 +909,7 @@ class Game { // Done with UI, now we can load a level this.load_level(0); - // Fill in the scrubber if (false && this.level.stored_level.demo) { - let input_starts = {}; - for (let action of Object.keys(ACTION_LABELS)) { - input_starts[action] = null; - } - let t = 0; - for (let input of this.level.stored_level.demo) { - for (let [action, t0] of Object.entries(input_starts)) { - if (input.has(action)) { - if (t0 === null) { - input_starts[action] = t; - } - } - else if (t0 !== null) { - let bar = mk('span.demo-scrubber-bar'); - bar.style.setProperty('--start-time', t0); - bar.style.setProperty('--end-time', t); - scrubber_elements[action].append(bar); - input_starts[action] = null; - } - } - t += 1; - } this.demo = this.level.stored_level.demo[Symbol.iterator](); // FIXME should probably start playback on first input this.set_state('playing'); @@ -1106,11 +1071,6 @@ class Game { } } - if (this.demo) { - this.demo_scrubber_marker.style.setProperty('--time', this.tic); - this.demo_scrubber_marker.scrollIntoView({inline: 'center'}); - } - for (let action of Object.keys(ACTION_LABELS)) { this.input_action_elements[action].classList.toggle('--pressed', this.previous_input.has(action)); } diff --git a/style.css b/style.css index 7a51852..fc96404 100644 --- a/style.css +++ b/style.css @@ -252,37 +252,6 @@ dl.score-chart .-sum { grid-area: demo; } -.demo-scrubber { - position: relative; - overflow-x: auto; - padding: 0; - margin: 1em 0; - list-style: none; -} -.demo-scrubber li { - position: relative; - height: 1em; - margin: 2px 0; - background: #303030; -} -.demo-scrubber li .demo-scrubber-bar { - position: absolute; - height: 1em; - left: calc(var(--start-time) * 3px); - width: calc((var(--end-time) - var(--start-time)) * 3px); - background: #606060; -} -.demo-scrubber .demo-scrubber-marker { - position: absolute; - top: 0; - bottom: 0; - left: calc(var(--time) * 3px); - width: 2px; - margin-left: -1px; - background: darkred; - --time: 0; -} - /* Debug stuff */ .input { display: grid;