-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add chords to scales, scale root highlight & bump mtts
- Loading branch information
Showing
8 changed files
with
91 additions
and
38 deletions.
There are no files selected for viewing
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
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 React from 'react' | ||
import classNames from 'classnames' | ||
import { Note } from 'mtts' | ||
|
||
interface IFretProps { | ||
note: Note, | ||
stringNumber: number, | ||
fretNumber: number, | ||
highlighted: boolean, | ||
getNoteInScale: (note: Note) => Note, | ||
noteExistsInScale: (note: Note) => boolean | ||
isNoteScaleRoot: (note: Note) => boolean | ||
} | ||
|
||
function getNoteNameWithoutPitch(note: Note): string { | ||
return note.SPN.replace(/[0-9]/g, '') | ||
} | ||
|
||
function Fret({ note, highlighted, noteExistsInScale, getNoteInScale, isNoteScaleRoot }: IFretProps) { | ||
return ( | ||
<div | ||
className={classNames({ | ||
'bg-mtts-cta-0 text-white': isNoteScaleRoot(note), | ||
'bg-mtts-cta-2': highlighted && !isNoteScaleRoot(note), | ||
'color-white rounded': highlighted, | ||
'p-1 m-1 w-10 flex align-items border-left-1': true | ||
})} | ||
> | ||
<div className="m-auto"> | ||
{noteExistsInScale(note) ? <p>{getNoteNameWithoutPitch(getNoteInScale(note))}</p> : <p></p>} | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default Fret |
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
a { | ||
@apply no-underline; | ||
@apply text-4xl; | ||
@apply pr-4; | ||
} | ||
} | ||
|
||
|
b114c52
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
website – ./
website-git-master-marinprocureur.vercel.app
website-marinprocureur.vercel.app
www.norra.fr
website-liard.vercel.app
norra.fr