-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Position generated outlines relative to dominant letters #227
Position generated outlines relative to dominant letters #227
Conversation
✅ Deploy Preview for teeline-online ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Neat!
|
||
export const passiveConsonants = ['c', 'f', 'k', 'm', 'n', 'q', 'r', 's', 'v', 'w', 'x', 'y', 'z']; | ||
|
||
export const alphabet = [...vowels, ...dominantConsonants, ...passiveConsonants]; |
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.
Would be good to add a little test that this arrays create a Set
of size 26
export const createStartingObject = (text: string, lettersObjectArray: OutlineObject[]) => { | ||
// Identify dominant letter | ||
const findDominantLetter = (word: string | undefined) => { | ||
const dominantConsonant = word.split('').find((letter) => dominantConsonants.includes(letter)); |
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.
What if word is undefined?
const dominantConsonant = word.split('').find((letter) => dominantConsonants.includes(letter)); | |
const dominantConsonant = word?.split('').find((letter) => dominantConsonants.includes(letter)); |
This addresses issue #223 by adding a new
createStartingObject()
function that's used when generating outline objects. It finds a word's dominant letter and calculates the overall starting point accordingly.Before
After
Yuuuge step forward, this. Generated outlines are going to be so much better. Also opens the door to abstracting a bunch more special outlines (#222).
Potential followup: adjusting the starting point to ensure the outline is always centered.