Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sidebar info #71

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<body>
<main [ngClass]="{'flex': !isMobileDisplay}" id="app-container">
<nav class="flex column left-menu" *ngIf="!isMobileDisplay">
<img src="./assets/images/title.svg" id="title-image" alt="Website Title">
Expand All @@ -13,6 +14,21 @@ <h2>Sub-genre</h2>
(click)="selectSubGenre(i)" [ngClass]="{'selected':i==selectedSubGenreIndex}">{{ subgenre.label }}
</button>
</section>
<div class="sidebar" *ngIf="isSideBarDisplayed">
<div class="sidebar-header">
Info
<button class="close-btn" (click)="isSideBarDisplayed = false">X</button>
</div>
<section>
<p>DrumBeatRepo is a rhythm library.</p>
<p>It is intended for composers or curious musicians.</p>
<p>The repository is open to sample/code contributions and is accessible via <a
href="https://github.com/Babali42/drumbeatrepo" target="_blank">github.com/babali42/drumbeatrepo</a>.
</p>
<p>Enjoy your musical journey !</p>
<p>Babali</p>
</section>
</div>
</nav>
<div *ngIf="isMobileDisplay">
<header class="header-mobile mt-40 mb-40">
Expand Down Expand Up @@ -40,3 +56,4 @@ <h2>Sub-genre</h2>
<div class="beat-name">{{ beat.name | titlecase }}</div>
<div class="bpm">{{ beat.bpm }} bpm</div>
</footer>
</body>
66 changes: 66 additions & 0 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,69 @@ footer {
aspect-ratio: 1;
clip-path: polygon(0 100%,0 0,100% 100%,0 100%);
}

/* Sidebar container */
.sidebar {
height: 100vh;
width: 250px;
position: fixed;
top: 0;
right: 0;
background-color: var(--sideBarColor);

section {
padding: 0 10px;
}

a:link {
color: var(--menuButtonColor);
}

a:visited {
color: green;
}

a:hover {
color: hotpink;
cursor: pointer;
}

a:active {
color: blue;
}
}

/* Header inside the sidebar */
.sidebar-header {
padding: 15px;
background-color: var(--sideBarHeaderColor);
font-size: 20px;
display: flex;
justify-content: space-between;
align-items: center;
}

/* Close button */
.close-btn {
background: none;
border: none;
color: var(--borderColor);
font-size: 20px;
cursor: pointer;
}

/* Main content */
.content {
padding: 20px;
transition: margin-left 0.3s ease;
}

/* Hidden sidebar state */
.sidebar.closed {
width: 0;
overflow: hidden;
}

.sidebar.closed + .content {
margin-left: 0;
}
1 change: 1 addition & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class AppComponent implements OnInit {
fileNameBehaviourSubject: BehaviorSubject<string>;
beat: Beat = new Beat('', 120, []);
private currentMode: Mode = Mode.DARK;
isSideBarDisplayed: boolean = true;

constructor(private responsive: BreakpointObserver, private jsonFilesService: JsonFilesService, public soundService: SoundService, private modeToggleService: ModeToggleService) {
this.fileNameBehaviourSubject = new BehaviorSubject<string>('metal');
Expand Down
7 changes: 7 additions & 0 deletions src/app/styles/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ $textColor_dark: white;
$borderColor_light: black;
$borderColor_dark: white;

$sideBarColor_light: #EBFBFF;
$sideBarColor_dark: #312c30;

// mixin that enables css variables in light mode
@mixin lighten() {
--backgroundColor: #{$bgColor_light};
--sideBarColor: #{$sideBarColor_light};
--sideBarHeaderColor: #{$color1_light_blue};
--textColor: #{$textColor_light};
--borderColor: #{$borderColor_light};
--menuButtonColor: #{$color1_light_blue};
Expand All @@ -23,6 +28,8 @@ $borderColor_dark: white;
// mixin that enables css variables in dark mode
@mixin darken() {
--backgroundColor: #{$bgColor_dark};
--sideBarColor: #{$sideBarColor_dark};
--sideBarHeaderColor: #{$color3_purple};
--textColor: #{$textColor_dark};
--borderColor: #{$borderColor_dark};
--menuButtonColor: #{$color3_purple};
Expand Down
Loading