Skip to content

Commit

Permalink
Merged main branch into deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
SameerKhurd committed May 13, 2024
2 parents bddf544 + dc585cb commit 5e51109
Show file tree
Hide file tree
Showing 21 changed files with 723 additions and 176 deletions.
73 changes: 72 additions & 1 deletion frontend/algo-blitz-web-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/algo-blitz-web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@angular/router": "^16.2.0",
"@materia-ui/ngx-monaco-editor": "^6.0.0",
"bootstrap": "^5.3.3",
"ng2-charts": "^5.0.3",
"primeicons": "^7.0.0",
"primeng": "^16.9.1",
"rxjs": "~7.8.0",
Expand Down
132 changes: 72 additions & 60 deletions frontend/algo-blitz-web-app/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,64 +1,20 @@
<!-- <button
type="button"
class="btn icon"
(click)="changeTheme()"
>
<i class="fas fa-moon"></i> Dark
</button>
<button
type="button"
class="btn icon"
(click)="changeTheme()"
>
<i class="fas fa-sun"></i> Light
</button> -->

<nav
id="main-navbar"
class="navbar navbar-expand-lg sticky-top bg-cl shadow-sm custom-font"
>
<div class="container py-0 my-0">
<a class="navbar-brand text-secondary" href="#" title="Go to home"
><span>
<img
class="border border-2 me-2 rounded-pill shadow-lg"
style="height: 40px; width: 40px"
src="./assets/images/profile-picture.png"
alt=""
/><strong> Algo Blitz </strong></span
></a
>

<div class="collapse navbar-collapse ps-5" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0 text-secondary">
<li class="nav-item px-1">
<a
class="nav-link active"
aria-current="page"
title="Go to home"
href="#"
>Home</a
>
</li>
<li class="nav-item px-1">
<a class="nav-link" title="Go to experience" href="/problems"
>Problems</a
>
</li>

<li class="nav-item px-1">
<a class="nav-link" title="Go to contact & references" href="#contact"
>References</a
>
</li>
</ul>
</div>
<nav class="navbar navbar-expand-lg navbar-dark bgs-dark border-bottom">
<div class="container-fluid">
<a
class="btn btn-outline-success"
title="Go to Contact & References"
(click)="changeTheme()"
class="navbar-brand text-secondary"
routerLink="/problems"
title="Go to home"
>
Toggle
<span class="h6">
<i
class="pi pi-angle-double-up text-warning align-middle pe-1"
style="font-size: 1.5rem"
></i>
<span class="title-algo text-light fw-light">algo</span>
<span class="title-blitz text-warning fwbold">
{{ "{" }}Bytes{{ "}" }}
</span>
</span>
</a>
<button
class="navbar-toggler"
Expand All @@ -71,6 +27,62 @@
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item ps-4">
<a
class="nav-link active"
aria-current="page"
title="Go to all problems"
routerLink="/problems"
>
<span class="font-sm">Problems</span>
</a>
</li>
<li class="nav-item ps-2">
<a
class="nav-link"
aria-current="page"
title="Go to all problems"
routerLink="/problems"
>
<span class="font-sm"> Top 10 Problems</span>
</a>
</li>
<li class="nav-item ps-2">
<a
class="nav-link"
aria-current="page"
title="Go to all problems"
routerLink="/problems"
>
<span class="font-sm"> Top 25 Problems</span>
</a>
</li>
</ul>
<form class="d-flex">
<a class="align-middle pe-3 me-3 text-light border-end" href="#">
<i class="pi align-middle pi-github" style="font-size: 1rem"></i
></a>

<a
class="align-middle text-light pe-3 me-3 border-end"
target="_blank"
href="https://www.linkedin.com/in/sameer-khurd"
>
<i class="pi align-middle pi-linkedin" style="font-size: 1rem"></i
></a>

<div class="font-sm align-middle">
<small>
Logged in as <strong>{{ dataService.user.username }}</strong>
</small>
</div>
</form>
</div>
</div>
</nav>
<router-outlet></router-outlet>

<div>
<router-outlet></router-outlet>
</div>
4 changes: 3 additions & 1 deletion frontend/algo-blitz-web-app/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component } from '@angular/core';
import { ThemeService } from './services/theme.service';
import { AuthService } from './services/auth.service';
import { DataService } from 'src/app/services/data.service';

@Component({
selector: 'app-root',
Expand All @@ -12,7 +13,8 @@ export class AppComponent {

constructor(
private themeService: ThemeService,
private authService: AuthService
private authService: AuthService,
public dataService: DataService
) {
this.authService.getUser();
}
Expand Down
6 changes: 6 additions & 0 deletions frontend/algo-blitz-web-app/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { ChipsModule } from 'primeng/chips';

import { MonacoEditorModule, MONACO_PATH } from '@materia-ui/ngx-monaco-editor';
import { EditorComponent } from './pages/problem/layout/editor/editor.component';
import { NgChartsModule } from 'ng2-charts';

import { ResultComponent } from './pages/problem/layout/result/result.component';
import { ListboxModule } from 'primeng/listbox';
Expand All @@ -37,6 +38,8 @@ import { SubmissionService } from './services/http-services/submission.service';
import { SubmissionsComponent } from './pages/problem/layout/submissions/submissions.component';
import { ProblemsComponent } from './pages/problems/problems.component';
import { RippleModule } from 'primeng/ripple';
import { ProgressBarModule } from 'primeng/progressbar';
import { StatsComponent } from './pages/problems/layout/stats/stats.component';

@NgModule({
declarations: [
Expand All @@ -47,6 +50,7 @@ import { RippleModule } from 'primeng/ripple';
ResultComponent,
SubmissionsComponent,
ProblemsComponent,
StatsComponent,
],
imports: [
BrowserModule,
Expand All @@ -57,6 +61,7 @@ import { RippleModule } from 'primeng/ripple';
ButtonModule,
MonacoEditorModule,
SkeletonModule,
NgChartsModule,
// Prime NG
ListboxModule,
RippleModule,
Expand All @@ -66,6 +71,7 @@ import { RippleModule } from 'primeng/ripple';
DropdownModule,
ProgressSpinnerModule,
ChipsModule,
ProgressBarModule,
],
providers: [
ThemeService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,23 @@ export const programmingLanguages = {
5: { label: 'Typescript' },
};

export enum QuestionLevel {
ALL = 5,
TOP_10 = 1,
TOP_25 = 3,
}

export interface QuestionTable {
accepted: number;
diff: Difficulty;
qid: string;
submitted: number;
acceptance?: string;
tags: string[];
title: string;
status: UserQuestionStatus;
bookmark: boolean;
questionLevel: QuestionLevel;
}

export const difficultyLevelProperties = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<div class="">
<button
pRipple
class="btn btn-sm p-0 px-2"
class="btn btn-sm p-0 px-2 border-0"
(click)="onResetCode()"
pTooltip="Reset to default code"
tooltipPosition="bottom"
Expand All @@ -40,7 +40,7 @@
<button
style="min-width: 60px"
pRipple
class="btn btn-success rounded-3 btn-sm p-0"
class="btn btn-success rounded-3 btn-sm p-0 border-0"
[disabled]="
loadingState.execution === executionState.RUN_LOADING ||
loadingState.execution === executionState.SUBMIT_LOADING ||
Expand Down Expand Up @@ -81,7 +81,7 @@
<button
style="min-width: 60px"
pRipple
class="btn rounded-3 btn-sm p-0"
class="btn rounded-3 btn-sm p-0 border-0"
[disabled]="
loadingState.execution === executionState.RUN_LOADING ||
loadingState.execution === executionState.SUBMIT_LOADING ||
Expand Down
Loading

0 comments on commit 5e51109

Please sign in to comment.