diff --git a/public/affirmations.html b/public/affirmations.html new file mode 100644 index 0000000..86321d9 --- /dev/null +++ b/public/affirmations.html @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/public/rainfall.html b/public/rainfall.html index e169591..f80f995 100644 --- a/public/rainfall.html +++ b/public/rainfall.html @@ -3,6 +3,6 @@ - + diff --git a/src/Affirmations.ts b/src/Affirmations.ts new file mode 100644 index 0000000..5efb5c0 --- /dev/null +++ b/src/Affirmations.ts @@ -0,0 +1,100 @@ +import { LitElement, css, html } from 'lit'; +import { customElement } from 'lit/decorators.js'; + +@customElement('lavender-affirmations') +export class Affirmations extends LitElement { + replaceShe = ["her", "she", "her", "herself", "she is"]; + replaceThey = ["them", "they", "their", "themself", "they are"]; + replaceHe = ["him", "he", "his", "himself", "he is"]; + replaceYou = ["you", "you", "your", "yourself", "you are"]; + replaceI = ["me", "i ", "my", "myself", "i am"]; + replacements = [/pronoun15/ig, /pronoun1/ig, /pronoun2/ig, /pronoun3/ig, /pronoun4/ig]; + arrPositiveYou1 = ["Pronoun1 feel the love of those who are not physically around pronoun15", "Pronoun1 take pleasure in pronoun2 own solitude", "Pronoun4 too big a gift to this world to feel self-pity", "Pronoun1 love and approve of pronoun3", "Pronoun1 focus on breathing and grounding pronoun3", "Following pronoun2 intuition and pronoun2 heart keeps pronoun15 safe and sound", "Pronoun1 make the right choices every time", "Pronoun1 draw from pronoun2 inner strength and light", "Pronoun1 trust pronoun3", "Pronoun4 a unique child of this world", "Pronoun1 have as much brightness to offer the world as the next person", "Pronoun1 matter and what Pronoun1 have to offer this world also matters", "Pronoun1 trust pronoun2 inner wisdom and intuition", "Pronoun1 breathe in calmness and breathe out nervousness", "This situation works out for pronoun2 highest good", "Wonderful things unfold before pronoun15", "Pronoun1 forgive pronoun3 for all the mistakes Pronoun1 have made", "Pronoun1 let go of pronoun2 anger so Pronoun1 can see clearly", "Pronoun1 accept responsibility if pronoun2 anger has hurt anyone", "Pronoun1 replace pronoun2 anger with understanding and compassion", "Pronoun1 offer an apology to those affected by pronoun2 anger", "Pronoun1 may not understand the good in this situation but it is there", "Pronoun1 muster up more hope and courage from deep inside pronoun15", "Pronoun1 choose to find hopeful and optimistic ways to look at this", "Pronoun1 kindly ask for help and guidance if Pronoun1 cannot see a better way", "Pronoun1 refuse to give up because Pronoun1 haven't tried all possible ways", "Pronoun1 know pronoun2 wisdom guides pronoun15 to the right decision", "Pronoun1 trust pronoun3 to make the best decision for pronoun15", "Pronoun1 receive all feedback with kindness but make the final call pronoun3", "Pronoun1 listen lovingly to this inner conflict and reflect on it until Pronoun1 get to peace around it", "Pronoun1 love pronoun2 family even if they do not understand pronoun15 completely", "Pronoun1 show pronoun2 family how much Pronoun1 love them in all the verbal and non-verbal ways Pronoun1 can", "There is a good reason Pronoun1 was paired with this perfect family", "Pronoun1 choose to see pronoun2 family as a gift", "Pronoun4 a better person from the hardship that I've gone through with pronoun2 family", "Pronoun1 choose friends who approve of pronoun15 and love pronoun15", "Pronoun1 surround pronoun3 with people who treat pronoun15 well", "Pronoun1 take the time to show pronoun2 friends that Pronoun1 care about them", "Pronoun2 friends do not judge pronoun15, nor do they influence what Pronoun1 do with pronoun2 life", "Pronoun1 take great pleasure in pronoun2 friends, even if they disagree or live different lives", "Pronoun4 beautiful and smart and that's how everyone sees pronoun15", "Pronoun1 take comfort in the fact that Pronoun1 can always leave this situation", "Pronoun1 never know what amazing incredible person Pronoun1 will meet next", "The company of strangers teaches pronoun15 more about pronoun2 own likes and dislikes", "Pronoun4 doing work that Pronoun1 enjoy and find fulfilling", "Pronoun1 play a big role in pronoun2 own career success", "Pronoun1 ask for and do meaningful, wonderful and rewarding work", "Pronoun1 engage in work that impacts this world positively", "Pronoun1 believe in pronoun2 ability to change the world with the work that Pronoun1 do", "Peaceful sleep awaits pronoun15 in dreamland", "Pronoun1 let go of all the false stories Pronoun1 make up in pronoun2 head", "Pronoun1 release pronoun2 mind of thought until the morning", "Pronoun1 embrace the peace and quiet of the night", "Pronoun1 sleep soundly and deeply and beautifully into this night", "This day brings pronoun15 nothing but joy", "Today will be a gorgeous day to remember", "Pronoun2 thoughts are pronoun2 reality so Pronoun1 think up a bright new day", "Pronoun1 fill pronoun2 day with hope and face it with joy", "Pronoun1 choose to fully participate in pronoun2 day", "Pronoun1 let go of worries that drain pronoun2 energy", "Pronoun1 make smart, calculated plans for pronoun2 future", "Pronoun4 a money magnet and attract wealth and abundance", "Pronoun4 in complete charge of planning for pronoun2 future", "Pronoun1 trust in pronoun2 own ability to provide well for pronoun2 family", "Pronoun1 follow pronoun2 dreams no matter what", "Pronoun1 show compassion in helping pronoun2 loved ones understand pronoun2 dreams", "Pronoun1 ask pronoun2 loved ones to support pronoun2 dreams", "Pronoun1 answer questions about pronoun2 dreams without getting defensive", "Pronoun2 loved ones love pronoun15 even without fully grappling with pronoun2 dreams", "Pronoun1 accept everyone as they are and continue on with pursuing pronoun2 dream", "Pronoun4 safe and sound. All is well", "Everything works out for pronoun2 highest good", "There is a great reason this is unfolding before pronoun15 now", "Pronoun1 have the smarts and the ability to get through this", "All pronoun2 problems have a solution", "Pronoun1 attempt all - not some - possible ways to get unstuck", "Pronoun1 seek a new way of thinking about this situation", "The answer is right before pronoun15, even if Pronoun4 not seeing it yet", "Pronoun1 believe in pronoun2 ability to unlock the way and set pronoun3 free", "Pronoun1 have no right to compare pronoun3 to anyone for Pronoun1 do not know their whole story", "Pronoun1 compare pronoun3 only to pronoun2 highest self", "Pronoun1 choose to see the light that Pronoun4 to this world", "Pronoun4 happy in pronoun2 own skin and in pronoun2 own circumstances", "Pronoun1 see pronoun3 as a gift to pronoun2 people and community and world", "Pronoun4 more than good enough and Pronoun1 get better every day", "Pronoun1 give up the habit of criticising pronoun3", "Pronoun1 adopt the mindset of praising pronoun3", "Pronoun1 see the perfection in all pronoun2 flaws and all pronoun2 genius", "Pronoun1 fully approve of who Pronoun4, even as Pronoun1 get better", "Pronoun4 a good person at all times of day and night", "Pronoun1 cannot give up until Pronoun1 have tried every conceivable way", "Giving up is easy and always an option so let's delay it for another day", "Pronoun1 press on because Pronoun1 believe in pronoun2 path", "It is always too early to give up on pronoun2 goals", "Pronoun1 must know what awaits pronoun15 at the end of this rope so Pronoun1 do not give up", "The past has no power over pronoun15 anymore. Pronoun1 embrace the rhythm and the flowing of pronoun2 own heart", "All that Pronoun1 need comes to pronoun15 at the right time and place in this life", "Pronoun4 deeply fulfilled with who Pronoun4."]; + /* array for she, he pronouns*/ + arrPositiveShe1 = ["Pronoun1 feels the love of those who are not physically around pronoun15", "Pronoun1 takes pleasure in pronoun2 own solitude", "Pronoun1 is too big a gift to this world to feel self-pity", "Pronoun1 loves and approves of pronoun3", "Pronoun1 focuses on breathing and grounding pronoun3", "Following pronoun2 intuition and pronoun2 heart keeps pronoun15 safe and sound", "Pronoun1 makes the right choices every time", "Pronoun1 draws from pronoun2 inner strength and light", "Pronoun1 trusts pronoun3", "Pronoun1 is a unique child of this world", "Pronoun1 has as much brightness to offer the world as the next person", "Pronoun1 matters and what Pronoun1 has to offer this world also matters", "Pronoun1 trusts pronoun2 inner wisdom and intuition", "Pronoun1 breathes in calmness and breathes out nervousness", "This situation works out for pronoun2 highest good", "Wonderful things unfold before pronoun15", "Pronoun1 forgives pronoun3 for all the mistakes Pronoun1 has made", "Pronoun1 lets go of pronoun2 anger so Pronoun1 can see clearly", "Pronoun1 accepts responsibility if pronoun2 anger has hurt anyone", "Pronoun1 replaces pronoun2 anger with understanding and compassion", "Pronoun1 offers an apology to those affected by pronoun2 anger", "Pronoun1 may not understand the good in this situation but it is there", "Pronoun1 musters up more hope and courage from deep inside pronoun15", "Pronoun1 chooses to find hopeful and optimistic ways to look at this", "Pronoun1 kindly asks for help and guidance if Pronoun1 cannot see a better way", "Pronoun1 refuses to give up because Pronoun1 hasn't tried all possible ways", "Pronoun1 knows pronoun2 wisdom guides pronoun15 to the right decision", "Pronoun1 trusts pronoun3 to make the best decisions for pronoun15", "Pronoun1 receives all feedback with kindness but makes the final call pronoun3", "Pronoun1 listens lovingly to this inner conflict and reflects on it until Pronoun1 get to peace around it", "Pronoun1 loves pronoun2 family even if they do not understand pronoun15 completely", "Pronoun1 shows pronoun2 family how much Pronoun1 loves them in all the verbal and non-verbal ways Pronoun1 can", "There is a good reason Pronoun1 was paired with this perfect family", "Pronoun1 chooses to see pronoun2 family as a gift", "Pronoun1 is a better person from the hardship that Pronoun1 gone through with pronoun2 family", "Pronoun1 chooses friends who approve of pronoun15 and love pronoun15", "Pronoun1 surrounds pronoun3 with people who treat pronoun15 well", "Pronoun1 takes the time to show pronoun2 friends that Pronoun1 cares about them", "Pronoun2 friends do not judge pronoun15, nor do they influence what Pronoun1 does with pronoun2 life", "Pronoun1 takes great pleasure in pronoun2 friends, even if they disagree or live different lives", "Pronoun1 is beautiful and smart and that's how everyone sees pronoun15", "Pronoun1 takes comfort in the fact that Pronoun1 can always leave this situation", "Pronoun1 never knows what amazing incredible person Pronoun1 will meet next", "The company of strangers teaches pronoun15 more about pronoun2 own likes and dislikes", "Pronoun1 is doing work that Pronoun1 enjoys and finds fulfilling", "Pronoun1 plays a big role in pronoun2 own career success", "Pronoun1 asks for and does meaningful, wonderful and rewarding work", "Pronoun1 engages in work that impacts this world positively", "Pronoun1 believes in pronoun2 ability to change the world with the work that Pronoun1 does", "Peaceful sleep awaits pronoun15 in dreamland", "Pronoun1 lets go of all the false stories Pronoun1 makes up in pronoun2 head", "Pronoun1 releases pronoun2 mind of thought until the morning", "Pronoun1 embraces the peace and quiet of the night", "Pronoun1 sleeps soundly and deeply and beautifully into this night", "This day brings pronoun15 nothing but joy", "Today will be a gorgeous day to remember", "Pronoun2 thoughts are pronoun2 reality so Pronoun1 thinks up a bright new day", "Pronoun1 fills pronoun2 day with hope and faces it with joy", "Pronoun1 chooses to fully participate in pronoun2 day", "Pronoun1 lets go of worries that drain pronoun2 energy", "Pronoun1 makes smart, calculated plans for pronoun2 future", "Pronoun1 is a money magnet and attract wealth and abundance", "Pronoun1 is in complete charge of planning for pronoun2 future", "Pronoun1 trusts in pronoun2 own ability to provide well for pronoun2 family", "Pronoun1 follows pronoun2 dreams no matter what", "Pronoun1 shows compassion in helping pronoun2 loved ones understand pronoun2 dreams", "Pronoun1 asks pronoun2 loved ones to support pronoun2 dreams", "Pronoun1 answer questions about pronoun2 dreams without getting defensive", "Pronoun2 loved ones love pronoun15 even without fully grappling with pronoun2 dreams", "Pronoun1 accepts everyone as they are and continue on with pursuing pronoun2 dream", "Pronoun1 is safe and sound. All is well", "Everything works out for pronoun2 highest good", "There is a great reason this is unfolding before pronoun15 now", "Pronoun1 has the smarts and the ability to get through this", "All pronoun2 problems have a solution", "Pronoun1 attempts all - not some - possible ways to get unstuck", "Pronoun1 seeks a new way of thinking about this situation", "The answer is right before pronoun15, even if Pronoun1 is not seeing it yet", "Pronoun1 believes in pronoun2 ability to unlock the way and set pronoun3 free", "Pronoun1 has no right to compare pronoun3 to anyone for Pronoun1 does not know their whole story", "Pronoun1 compares pronoun3 only to pronoun2 highest self", "Pronoun1 chooses to see the light that Pronoun4 to this world", "Pronoun1 is happy in pronoun2 own skin and in pronoun2 own circumstances", "Pronoun1 sees pronoun3 as a gift to pronoun2 people and community and world", "Pronoun1 is more than good enough and Pronoun1 gets better every day", "Pronoun1 gives up the habit of criticising pronoun3", "Pronoun1 adopts the mindset of praising pronoun3", "Pronoun1 sees the perfection in all pronoun2 flaws and all pronoun2 genius", "Pronoun1 fully approves of who Pronoun4, even as Pronoun1 gets better", "Pronoun1 is a good person at all times of day and night", "Pronoun1 cannot give up until Pronoun1 has tried every conceivable way", "Giving up is easy and always an option so let's delay it for another day", "Pronoun1 presses on because Pronoun1 believes in pronoun2 path", "It is always too early to give up on pronoun2 goals", "Pronoun1 must know what awaits pronoun15 at the end of this rope so Pronoun1 does not give up", "The past has no power over pronoun15 anymore. Pronoun1 embraces the rhythm and the flowing of pronoun2 own heart", "All that Pronoun1 needs comes to pronoun15 at the right time and place in this life", "Pronoun1 is deeply fulfilled with who Pronoun1 is."]; + + changeAffirmation() { + const arrayIndex = Math.floor(Math.random() * this.arrPositiveYou1.length); + let nextString = this.checkPronoun('You', arrayIndex); + nextString = this.capitaliseFirstLetter(nextString); + nextString = this.capitaliseLetterI(nextString); + nextString = this.capitaliseAfterFullStop(nextString); + nextString += "."; + + return nextString; + } + + checkPronoun(selectedPronoun: string, arrayIndex: number) { + if (selectedPronoun == "You") { + return this.changePronoun(this.replaceYou, this.arrPositiveYou1, arrayIndex); + } else if (selectedPronoun == "She") { + return this.changePronoun(this.replaceShe, this.arrPositiveShe1, arrayIndex); + } else if (selectedPronoun == "I") { + return this.changePronoun(this.replaceI, this.arrPositiveYou1, arrayIndex); + } else if (selectedPronoun == "They") { + return this.changePronoun(this.replaceThey, this.arrPositiveYou1, arrayIndex); + } else if (selectedPronoun == "He") { + return this.changePronoun(this.replaceHe, this.arrPositiveShe1, arrayIndex); + } else { + return ''; + } + } + + changePronoun(pronounArr: string[], arr: string[], arrayIndex: number) { + let newString = arr[arrayIndex].toLowerCase(); + /* pass function string + pronoun?*/ + for (var k = 0; k <= this.replacements.length; k++) { + newString = newString.replace(this.replacements[k], pronounArr[k]); + } + + return newString; + } + + generateRandom() { + let numNum = Math.floor(Math.random() * 5); + return numNum; + } + /* string modification */ + + capitaliseFirstLetter(firstLetter: string) { + firstLetter = firstLetter[0].toUpperCase() + firstLetter.slice(1); + return firstLetter; + } + + capitaliseAfterFullStop(fullStop: string) { + if (fullStop.indexOf(".") !== -1) { + var periodIndex = fullStop.indexOf("."); + if (fullStop.charAt(periodIndex + 1) !== ".") { + fullStop = fullStop.slice(0, periodIndex + 2) + fullStop.charAt(periodIndex + 2).toUpperCase() + fullStop.slice(periodIndex + 3); + } + } + return fullStop; + } + + capitaliseLetterI(stringToCapitalize: string) { + return stringToCapitalize.replace(" i ", " I "); + } + + static override styles = [ + css` + .centerit { + text-align: center; + } + + .affirmation { + font-style: italic; + } + ` + ]; + + override render() { + const affirmation = this.changeAffirmation() + return html`

Affirmation

${affirmation}
`; + } +} + +declare global { + interface HTMLElementTagNameMap { + 'lavender-affirmations': Affirmations; + } +} \ No newline at end of file diff --git a/src/Rainfall.ts b/src/Rainfall.ts index 24d26c1..845abc9 100644 --- a/src/Rainfall.ts +++ b/src/Rainfall.ts @@ -1,7 +1,7 @@ import { LitElement, html, css } from 'lit'; import { customElement } from 'lit/decorators.js'; -@customElement('lavendar-rainfall') +@customElement('lavender-rainfall') export class Rainfall extends LitElement { value = 0.0; @@ -54,6 +54,6 @@ export class Rainfall extends LitElement { declare global { interface HTMLElementTagNameMap { - 'lavendar-rainfall': Rainfall; + 'lavender-rainfall': Rainfall; } } \ No newline at end of file