-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from whitep4nth3r/control-panel
Added a new control panel to the fretboard with highlightable 1, 3, 5 degrees of the scale and note names/note numbers toggle
- Loading branch information
Showing
50 changed files
with
1,285 additions
and
1,032 deletions.
There are no files selected for viewing
301 changes: 151 additions & 150 deletions
301
apps/fretonator-web/src/app/common/fret-map/fret-map.service.testConstants.ts
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...fretonator-web/src/app/common/fretonator/fretboard-config/fretboard-config.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<div class="configure__controls"> | ||
<div class="button__group"> | ||
<button class="fretboard__toggleButton twelve" | ||
[class.fretboard__toggleButton--active]="fretMode === FretModes.twelve" | ||
(click)="setFretModeClick(FretModes.twelve)">12 frets | ||
</button> | ||
<button class="fretboard__toggleButton twentyFour" | ||
[class.fretboard__toggleButton--active]="fretMode === FretModes.twentyFour" | ||
(click)="setFretModeClick(FretModes.twentyFour)">24 frets | ||
</button> | ||
</div> | ||
<div class="button__group"> | ||
<button class="fretboard__toggleButton left" | ||
[class.fretboard__toggleButton--active]="orientation === Orientations.left" | ||
(click)="setOrientationClick(Orientations.left)"> | ||
Left handed | ||
</button> | ||
<button class="fretboard__toggleButton right" | ||
[class.fretboard__toggleButton--active]="orientation === Orientations.right" | ||
(click)="setOrientationClick(Orientations.right)"> | ||
Right handed | ||
</button> | ||
</div> | ||
</div> |
47 changes: 47 additions & 0 deletions
47
...fretonator-web/src/app/common/fretonator/fretboard-config/fretboard-config.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
@import "../../../../styles/vars"; | ||
@import "../../../../styles/functions"; | ||
@import "../../../../styles/mixins"; | ||
@import "../../../../styles/typography"; | ||
|
||
.configure__controls { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.button__group { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
margin-bottom: pxToRem($grid-unit * 2); | ||
|
||
&:last-of-type { | ||
margin-bottom: 0; | ||
} | ||
|
||
@media screen and (min-width: $screen-med) { | ||
justify-content: flex-end; | ||
} | ||
} | ||
|
||
.fretboard__toggleButton { | ||
@include chip_button_base(); | ||
padding: pxToRem($grid-unit * 1.5); | ||
border-color: var(--fretboard-toggle-button-border-color); | ||
} | ||
|
||
.fretboard__toggleButton--active { | ||
background-color: var(--chip-background-color-active); | ||
color: var(--chip-foreground-color-active); | ||
} | ||
|
||
.fretboard__toggleButton:first-of-type { | ||
border-top-right-radius: 0; | ||
border-bottom-right-radius: 0; | ||
border-right-width: calc(var(--border-width-button) / 2); | ||
} | ||
|
||
.fretboard__toggleButton:last-of-type { | ||
border-top-left-radius: 0; | ||
border-bottom-left-radius: 0; | ||
border-left-width: calc(var(--border-width-button) / 2); | ||
} |
36 changes: 36 additions & 0 deletions
36
...tonator-web/src/app/common/fretonator/fretboard-config/fretboard-config.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { FretboardConfigComponent } from './fretboard-config.component'; | ||
import { Component } from '@angular/core'; | ||
import { FretboardConfigModule } from './fretboard-config.module'; | ||
|
||
describe('FretboardConfigComponent', () => { | ||
@Component({ | ||
selector: 'app-fretboard-config-spec', | ||
template: ` | ||
<app-fretboard-config></app-fretboard-config> | ||
` | ||
}) | ||
class FretboardConfigComponentSpec { | ||
} | ||
|
||
let component: FretboardConfigComponentSpec; | ||
let fixture: ComponentFixture<FretboardConfigComponentSpec>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ FretboardConfigComponentSpec ], | ||
imports: [FretboardConfigModule] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(FretboardConfigComponentSpec); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
31 changes: 31 additions & 0 deletions
31
apps/fretonator-web/src/app/common/fretonator/fretboard-config/fretboard-config.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Component, EventEmitter, Input, Output } from '@angular/core'; | ||
import { FretModes, Orientations } from '../fretboard/fretboard.component'; | ||
|
||
@Component({ | ||
selector: 'app-fretboard-config', | ||
templateUrl: './fretboard-config.component.html', | ||
styleUrls: ['./fretboard-config.component.scss'] | ||
}) | ||
export class FretboardConfigComponent { | ||
@Input() fretMode; | ||
@Input() orientation; | ||
|
||
@Output() setFretMode = new EventEmitter<FretModes>(); | ||
@Output() setOrientation = new EventEmitter<Orientations>(); | ||
|
||
setFretModeClick(fretMode: FretModes) { | ||
this.setFretMode.emit(fretMode); | ||
} | ||
|
||
setOrientationClick(orientation: Orientations) { | ||
this.setOrientation.emit(orientation); | ||
} | ||
|
||
get FretModes() { | ||
return FretModes; | ||
} | ||
|
||
get Orientations() { | ||
return Orientations; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
apps/fretonator-web/src/app/common/fretonator/fretboard-config/fretboard-config.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { FretboardConfigComponent } from './fretboard-config.component'; | ||
|
||
|
||
@NgModule({ | ||
declarations: [FretboardConfigComponent], | ||
exports: [ | ||
FretboardConfigComponent | ||
], | ||
imports: [ | ||
CommonModule | ||
], | ||
}) | ||
export class FretboardConfigModule { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.