Skip to content

Commit 3ef36d6

Browse files
jggoebelJan-Gerrit Göbel
andauthored
Add Arcade (hobbyfarm#204)
* First version of bashbrawl * some game logic * More functionality * clock positioning * main game logic * Store leaderboard in localStorage * storing leaderboard works * Cleanup * Small fixes with names longer than 20 chars * Correct mistake where brawl is always active on new users * remove unused imports * Remove reviver and replacer * Confirm begin game modal * Run prettier * Small fixes with name input * Linting * prettier * fix input * Move local placement leaderboard to server * Enclose with group * Remove console log * complete the kubectl commands * Added LICENSE for languages and readme in the bashbrawl folder --------- Co-authored-by: Jan-Gerrit Göbel <[email protected]>
1 parent a3fec97 commit 3ef36d6

28 files changed

+6631
-79
lines changed

src/app/app.component.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,24 @@ <h3 class="modal-title">Settings</h3>
559559
</clr-tab-content>
560560
<clr-tab-content> </clr-tab-content>
561561
</clr-tab>
562+
<clr-tab>
563+
<button clrTabLink>BashBrawl</button>
564+
<clr-tab-content>
565+
<clr-checkbox-container>
566+
<label class="clr-col-md-4">Enabled</label>
567+
<clr-checkbox-wrapper>
568+
<input
569+
class="clr-col-md-8"
570+
type="checkbox"
571+
clrCheckbox
572+
name="bashbrawl_enabled"
573+
formControlName="bashbrawl_enabled"
574+
/>
575+
</clr-checkbox-wrapper>
576+
</clr-checkbox-container>
577+
</clr-tab-content>
578+
<clr-tab-content> </clr-tab-content>
579+
</clr-tab>
562580
</clr-tabs>
563581
</form>
564582
</ng-container>

src/app/app.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ export class AppComponent implements OnInit {
146146
theme: new FormControl<'light' | 'dark' | 'system' | null>(null, [
147147
Validators.required,
148148
]),
149+
bashbrawl_enabled: new FormControl<boolean>(false),
149150
});
150151

151152
ngOnInit() {
@@ -280,13 +281,15 @@ export class AppComponent implements OnInit {
280281
ctr_enabled = true,
281282
theme = 'light',
282283
divider_position = 40,
284+
bashbrawl_enabled = false,
283285
}) => {
284286
this.settingsForm.setValue({
285287
terminal_theme,
286288
terminal_fontSize,
287289
ctr_enabled,
288290
theme,
289291
divider_position,
292+
bashbrawl_enabled,
290293
});
291294
this.fetchingSettings = false;
292295
},

src/app/app.module.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { RootComponent } from './root.component';
88
import { HomeComponent } from './home.component';
99
import { ScenarioComponent } from './scenario/scenario.component';
1010
import { TerminalComponent } from './scenario/terminal.component';
11+
import { BashbrawlterminalComponent } from './scenario/bashbrawl/bashbrawlterminal.component';
1112
import { JwtModule, JWT_OPTIONS } from '@auth0/angular-jwt';
1213
import { HttpClientModule } from '@angular/common/http';
1314
import { LoginComponent } from './login/login.component';
@@ -44,6 +45,8 @@ import { GuacTerminalComponent } from './scenario/guacTerminal.component';
4445
import { IdeWindowComponent } from './scenario/ideWindow.component';
4546
import { ContextService } from './services/context.service';
4647
import { TypedSettingsService } from './services/typedSettings.service';
48+
import { LanguageCommandService } from './scenario/bashbrawl/languages/language-command.service';
49+
import { ScoreService } from './services/score.service';
4750
import { VerificationService } from './services/verification.service';
4851
import { TaskProgressComponent } from './scenario/task-progress/task-progress.component';
4952
import { TaskModalComponent } from './scenario/task-modal/task-modal.component';
@@ -80,6 +83,7 @@ import {
8083
eyeHideIcon,
8184
clockIcon,
8285
copyIcon,
86+
terminalIcon,
8387
} from '@cds/core/icon';
8488
import { QuizLabelComponent } from './quiz/quiz-label.component';
8589

@@ -112,6 +116,7 @@ ClarityIcons.addIcons(
112116
eyeHideIcon,
113117
clockIcon,
114118
copyIcon,
119+
terminalIcon,
115120
);
116121

117122
export function tokenGetter() {
@@ -153,6 +158,7 @@ export function jwtOptionsFactory() {
153158
HomeComponent,
154159
ScenarioComponent,
155160
TerminalComponent,
161+
BashbrawlterminalComponent,
156162
GuacTerminalComponent,
157163
LoginComponent,
158164
ScenarioCardComponent,
@@ -222,6 +228,8 @@ export function jwtOptionsFactory() {
222228
ContextService,
223229
TypedSettingsService,
224230
VerificationService,
231+
LanguageCommandService,
232+
ScoreService,
225233
{
226234
provide: APP_INITIALIZER,
227235
useFactory: appInitializerFn,

src/app/scenario/bashbrawl/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Bashbrawl
2+
3+
## BashBrawl Standalone
4+
5+
github.com/jggoebel/bashbrawl
6+
7+
## original idea
8+
9+
Thanks to [clh-bash](https://github.com/CommandLineHeroes/clh-bash/) for giving me the idea. Some language files were taken from there, the other code was newly written.
10+
11+
Language files are (as the LICENSE file indicates) under
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div class="terminal-div" #terminal></div>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.terminal-div {
2+
height: calc(100% - 1.8rem);
3+
width: 100%;
4+
}
5+
6+
.xterm {
7+
padding-bottom: 84px;
8+
}
9+
10+
.xterm-viewport {
11+
overflow: hidden !important;
12+
}

0 commit comments

Comments
 (0)