Skip to content

Commit 2a263fa

Browse files
author
Salma Alam-Naylor
committed
Added a play button for playScale and standardised some css vars
1 parent 3addab5 commit 2a263fa

19 files changed

+192
-30
lines changed

apps/fretonator-web/src/app/common/chips/chip/chip.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class="chip"
55
[class.chip--active]="selected"
66
[class.chip--round]="rounded"
7-
[class.chip--grey]="selectedColor === SelectedColor.grey"
7+
[class.chip--muted]="selectedColor === SelectedColor.muted"
88
>
99
<ng-content></ng-content>
1010
</a>

apps/fretonator-web/src/app/common/chips/chip/chip.component.scss

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
@include chip_button_base()
1111
}
1212

13-
.chip--grey {
14-
border-color: var(--grey);
15-
color: var(--grey);
13+
.chip--muted {
14+
border-color: var(--chip-border-color-muted);
15+
color: var(--chip-foreground-color-muted);
16+
background-color: var(--chip-background-color-muted);
1617
}
1718

1819
.chip--round {
@@ -25,10 +26,13 @@
2526
}
2627

2728
.chip--active {
28-
background-color: var(--black);
29-
color: var(--white);
29+
background-color: var(--chip-background-color-active);
30+
color: var(--chip-foreground-color-active);
31+
border-color: var(--chip-border-color-active);
3032

31-
&.chip--grey {
32-
background-color: var(--grey);
33+
&.chip--muted {
34+
background-color: var(--chip-background-color-muted-active);
35+
border-color: var(--chip-border-color-muted-active);
36+
color: var(--chip-foreground-color-muted-active);
3337
}
3438
}

apps/fretonator-web/src/app/common/chips/chip/chip.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ActivatedRoute } from '@angular/router';
44

55
export enum SelectedColor {
66
default = 'default',
7-
grey = 'grey',
7+
muted = 'muted',
88
}
99

1010
@Component({

apps/fretonator-web/src/app/common/fretonator/fretonator.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@
233233
@include content_wrapper();
234234
max-width: $screen-med;
235235
margin-top: pxToRem($grid-unit * 4);
236-
background-color: var(--white);
236+
background-color: var(--background-color-light);
237237
padding: pxToRem($grid-unit * 4);
238238
border-radius: pxToRem($grid-unit * 4);
239239
box-shadow: 0 pxToRem(1) pxToRem(3) rgba(26, 26, 26, 0.12), 0 pxToRem(1) pxToRem(2) rgba(26, 26, 26, 0.24);

apps/fretonator-web/src/app/common/fretonator/scale-map/scale-map.component.html

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,23 @@ <h5 class="scaleDisplay__note">
99
</h5>
1010
</ng-container>
1111
</div>
12-
<button *ngIf="isTheoretical"
13-
class="button__infoToggle"
14-
aria-label="Theoretical Scales Info Toggle"
15-
type="button"
16-
(click)="toggleTheoreticalScaleInfo()">{{theoreticalScalesToggleText}}
17-
</button>
12+
<div class="buttonRow">
13+
<button class="button__playScale"
14+
aria-label="Play this scale"
15+
type="button"
16+
(click)="playScale()">
17+
<span class="button__playScale__svg">
18+
<app-play-svg></app-play-svg>
19+
</span>
20+
Play scale
21+
</button>
22+
<button *ngIf="isTheoretical"
23+
class="button__infoToggle"
24+
aria-label="Theoretical Scales Info Toggle"
25+
type="button"
26+
(click)="toggleTheoreticalScaleInfo()">{{theoreticalScalesToggleText}}
27+
</button>
28+
</div>
1829
</div>
1930

2031
<div class="scaleMap__degrees" *ngIf="mode | displayScaleDegrees">
@@ -43,12 +54,13 @@ <h2 class="infoBlock__title">About Theoretical Scales
4354
aria-label="Theoretical Scales Info Close"
4455
type="button"
4556
(click)="toggleTheoreticalScaleInfo()">
46-
<app-cross-svg></app-cross-svg>
57+
<app-cross-svg></app-cross-svg>
4758
</button>
4859
</h2>
4960
<p class="infoBlock__copy">A theoretical scale or <em>impossible key</em> is a key whose key signature has at least
5061
one double flat (𝄫) or double sharp (x).</p>
51-
<p class="infoBlock__copy">{{modeDisplayString}} is a theoretical scale and looks unnecessarily complicated. We can make things simpler!</p>
62+
<p class="infoBlock__copy">{{modeDisplayString}} is a theoretical scale and looks unnecessarily complicated. We can
63+
make things simpler!</p>
5264
<p class="infoBlock__copy">Switch to the enharmonic equivalent note of {{scale[0] | getEnharmonicEquivalent }} to make
5365
the notes easier to read. (It'll sound exactly the same!)</p>
5466
<a class="actionButton"

apps/fretonator-web/src/app/common/fretonator/scale-map/scale-map.component.scss

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,39 @@
124124
}
125125
}
126126

127+
.buttonRow {
128+
display: flex;
129+
flex-direction: column;
130+
131+
@media screen and (min-width: $screen-sm) {
132+
flex-direction: row;
133+
}
134+
}
135+
136+
.button__playScale {
137+
@include chip_button_base();
138+
margin-top: pxToRem($grid-unit * 2);
139+
display: flex;
140+
flex-direction: row;
141+
align-items: center;
142+
justify-content: center;
143+
transition: background-color 0.1s ease-in-out;
144+
145+
&:hover, &:active {
146+
background-color: var(--purple);
147+
}
148+
149+
@media screen and (min-width: $screen-sm) {
150+
margin-right: pxToRem($grid-unit * 2);
151+
}
152+
}
153+
154+
.button__playScale__svg {
155+
display: flex;
156+
height: pxToRem($grid-unit * 2);
157+
width: pxToRem($grid-unit * 2);
158+
margin-right: pxToRem($grid-unit / 2);
159+
}
127160

128161
.button__infoToggle {
129162
@include chip_button_base();

apps/fretonator-web/src/app/common/fretonator/scale-map/scale-map.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,8 @@ export class ScaleMapComponent {
3939
this.showTheoreticalScalesInfo = !this.showTheoreticalScalesInfo;
4040
this.theoreticalScalesToggleText = this.showTheoreticalScalesInfo ? TheoreticalScalesToggleText.visible : TheoreticalScalesToggleText.hidden;
4141
}
42+
43+
playScale() {
44+
console.log('playing');
45+
}
4246
}

apps/fretonator-web/src/app/common/fretonator/scale-map/scale-map.module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { GetEnharmonicEquivalentPipe } from './get-enharmonic-equivalent.pipe';
66
import { RouterModule } from '@angular/router';
77
import { GetEnharmonicRouterLinkPipe } from './get-enharmonic-router-link.pipe';
88
import { CrossModule } from '../../svgs/cross/cross.module';
9+
import { PlayModule } from '../../svgs/play/play.module';
910

1011

1112
@NgModule({
@@ -16,7 +17,8 @@ import { CrossModule } from '../../svgs/cross/cross.module';
1617
imports: [
1718
CommonModule,
1819
RouterModule,
19-
CrossModule
20+
CrossModule,
21+
PlayModule
2022
]
2123
})
2224
export class ScaleMapModule { }
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<svg aria-hidden="true" role="img"
2+
class="svg"
3+
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
4+
<path
5+
d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z"></path>
6+
</svg>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.svg {
2+
flex: 1;
3+
height: 100%;
4+
width: 100%;
5+
fill: currentColor;
6+
}

0 commit comments

Comments
 (0)