Skip to content

Commit

Permalink
refactor(event-setup): improve disabled style design
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieuher committed Feb 8, 2024
1 parent c244df2 commit 837fb87
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/scenes/event-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Game } from '../game';
import { TrackStyles } from '../models/track-styles.enum';
import { Config } from '../config';

import { Subject, debounceTime, takeUntil, tap } from 'rxjs';
import { Subject, debounceTime, tap } from 'rxjs';

export class EventSetup extends Scene {
private raceSetupUi = document.getElementById('event-setup')!;
Expand Down Expand Up @@ -58,7 +58,7 @@ export class EventSetup extends Scene {
private listenTrackInput(): void {
this.trackNameChanged
.pipe(
debounceTime(300),
debounceTime(200),
tap(trackName => this.selectTrack(trackName)),
)
.subscribe();
Expand Down Expand Up @@ -102,7 +102,6 @@ export class EventSetup extends Scene {
const track = (this.engine as Game).trackManager.getTrackFromLocalStorage(trackName);

if (track) {
console.log('fond track ', track.name);
this.trackStyleSelect.value = track.style;
this.trackStyleSelect.disabled = true;
} else {
Expand Down
4 changes: 4 additions & 0 deletions src/scss/game.scss
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ html body {
select {
appearance: none;
background-color: $primary;

&:disabled {
opacity: 0.3;
}
}

}
Expand Down

0 comments on commit 837fb87

Please sign in to comment.