my-cafe-events/valentines-day-25/js/script.js

194 lines
12 KiB
JavaScript
Raw Permalink Normal View History

const notesForEmma = {
tileOne: `<button class="close-note" style="display: inline-block; margin-left: 30vw; cursor: pointer;" onclick="closeLoveLetter()"></button>
2025-02-09 18:27:16 +00:00
<p class="note">Love the woman you are. All of her, genuinely.
Don't be afraid of yourself. Don't be afraid to seek help.
Don't be afraid to share yourself with others</p>`,
tileTwo: `<button class="close-note" style="display: inline-block; margin-left: 30vw; cursor: pointer;" onclick="closeLoveLetter()"></button>
2025-02-09 18:27:16 +00:00
<p class="note">How happy you are to be surrounded by people who understand you.
Who support you. Who love seeing you at your best</p>`,
tileThree: `<button class="close-note" style="display: inline-block; margin-left: 30vw; cursor: pointer;" onclick="closeLoveLetter()"></button>
2025-02-09 18:27:16 +00:00
<p class="note">You are getting better.
The best part is you can tell you are getting better.
Keep working hard. This story has a happy ending. I promise</p>`,
tileFour: `<button class="close-note" style="display: inline-block; margin-left: 30vw; cursor: pointer;" onclick="closeLoveLetter()"></button>
2025-02-09 18:27:16 +00:00
<p class="note">Embrace the part of you that is quite simply a goofball.
You don't have to do it just to fit in any more.
You can be silly because quite simply you are sometimes,
and that's a lovely thing about you</p>`,
tileFive: `<button class="close-note" style="display: inline-block; margin-left: 30vw; cursor: pointer;" onclick="closeLoveLetter()"></button>
2025-02-09 18:27:16 +00:00
<p class="note">You've been taking care of yourself and you are noticing.
How pretty did you think you looked in the mirror with those lashes?
The answer is very. With time all the work you are putting into yourself
will show. You're doing a good job, keep it up</p>`,
tileSix: `<button class="close-note" style="display: inline-block; margin-left: 30vw; cursor: pointer;" onclick="closeLoveLetter()"></button>
2025-02-09 18:27:16 +00:00
<p class="note">When depression tried to isolate you even further,
you stood up for yourself. You took action. You made friends at one
of your loneliest points. How brave you are to take that risk.
How happy you are to know friendship again</p>`,
tileSeven: `<button class="close-note" style="display: inline-block; margin-left: 30vw; cursor: pointer;" onclick="closeLoveLetter()"></button>
<p class="note">There's a song i want you to listen to.
2025-02-09 18:27:16 +00:00
You haven't listened to it in a long time.
I want you to remember the times you used to dream of dancing
and twirling in your apartment with the stereo on.
2025-02-09 18:27:16 +00:00
The only two important things in that moment was the music
and what you felt in your heart</p>
2025-02-08 02:21:39 +00:00
<iframe width="500" height="280"
src="https://www.youtube-nocookie.com/embed/hlco1UrtJSc?si=P3YNM8EM27kAn2vA"
title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin" allowfullscreen>
</iframe>`,
tileEight: `<button class="close-note" style="display: inline-block; margin-left: 30vw; cursor: pointer;" onclick="closeLoveLetter()"></button>
2025-02-09 18:27:16 +00:00
<p class="note">When you're ready, you'll know love again.
True love this time. What you are working on now is true love of
yourself. Romance can wait for you this time</p>`,
tileNine: `<button class="close-note" style="display: inline-block; margin-left: 30vw; cursor: pointer;" onclick="closeLoveLetter()"></button>
2025-02-09 18:27:16 +00:00
<p class="note">Current times are all but certain.
It is important you don't let your anxiety get the best of you.
Do not doubt yourself, you are capable of so much.
You have been through so much and made it out okay. You can do this</p>`,
tileTen: `<button class="close-note" style="display: inline-block; margin-left: 30vw; cursor: pointer;" onclick="closeLoveLetter()"></button>
2025-02-09 18:27:16 +00:00
<p class="note">You need to stop drinking coffee.
I know you love it, but you have medication that interacts poorly with
it. Right now you can't handle the potential anxiety that caffeine
introduces. You can't afford to be drinking a pot of coffee at 11 PM.
Please do this for yourself, it will help</p>`,
tileEleven: `<button class="close-note" style="display: inline-block; margin-left: 30vw; cursor: pointer;" onclick="closeLoveLetter()"></button>
2025-02-09 18:27:16 +00:00
<p class="note">Even though sometimes it feels like they aren't helping.
The things you have started doing to take care of yourself are
objectively good things. They are important for your physical
and mental health. This will take time, but i am so proud of
2025-02-08 02:21:39 +00:00
you for continuing to do these very important things even when
2025-02-09 18:27:16 +00:00
they don't bring you happiness. Because you know they are
important to do regardless</p>`,
tileTwelve: `<button class="close-note" style="display: inline-block; margin-left: 30vw; cursor: pointer;" onclick="closeLoveLetter()"></button>
2025-02-09 18:27:16 +00:00
<p class="note">Don't run away any more Emma. Don't let depression have that over you.
You have people that care about you. Every day you work so hard on
2025-02-08 02:21:39 +00:00
caring for yourself and doing the things you need to, even if you
2025-02-09 18:27:16 +00:00
still feel like shit at the end of the day. You're in the thick of
2025-02-08 02:21:39 +00:00
it now, you've got depression on the run and it wants to make
one more push to try and take you in the hole with it.
2025-02-09 18:27:16 +00:00
Don't let it. Don't run away</p>`,
};
const readThisMessage = `<button class="close-note" style="display: inline-block; margin-left: 30vw; cursor: pointer;" onclick="closeLoveLetter()"></button>
<p class="note">You were out late last night, again. A craving for chocolate
had sent you on a quest late at night. You needed something special. This was
no time for a Hershey's bar. You took the bus into the city, and found a specialty
shop. Quite odd, when did this show up? You entered and a woman behind the counter
said "You need these, i can tell."</p>
<p class="note">"Honey, quite simply, you look like you've seen some shit" she said in
a playful, yet caring tone. "This box here, each item comes with a note, the notes all
have something you've desperately needed to hear. Take them, no charge." Free candy?
Who could resist? Certainly not me.</p>
<p class="note">Any ways you wrote this down in your journal so you'd believe yourself.
Maybe don't stay up so late anymore, hm?</p>
<p>(a note to the visitor - other items on the page are clickable! Baxter however may
have a bit of a preference on where he wants pets).</p>
`;
const creditNote = `<button class="close-note" style="display: inline-block; margin-left: 30vw; cursor: pointer;" onclick="closeLoveLetter()"></button>
<h1>credits for resources used to make this event entry</h1>
<ul>
<li><a href="https://www.pexels.com/photo/sweets-on-brown-box-6441133/" target="_blank">sweets in brown box</a> - Gustavo Peres</li>
<li><a href="https://pixabay.com/photos/paper-stationery-old-grunge-7834713/" target="_blank">paper stationary old</a> - flutie8211</li>
<li><a href="https://pixabay.com/illustrations/paper-lines-background-template-878964/" target="_blank">paper lines background</a> - geralt</li>
<li><a href="https://zaneray.com/responsive-image-map/" target="_blank">responsive image map maker</a> - The ZoneRay Group</li>
<li><a href="https://commons.wikimedia.org/wiki/File:Transgender_Pride_flag.svg" target="_blank">transgender pride flag</a> - wikimedia commons</li>
<li><a href="https://css-tip.com/image-heart-shape/" target="_blank">turn an image into a heart</a> - CSS Tip</li>
<li><a href="https://www.remove.bg/" target="_blank">Remove Background from Image</a> - remove.bg</li>
<li><a href="https://www.colourlovers.com/pattern/1748168/Love_Me" target="_blank">Love me - Pattern</a> - Zinebski</li>
<li><a href="https://www.colourlovers.com/palette/2285499/Nestled" target="_blank">Nestled - palette</a> - museshand</li>
<li><a href="https://www.colourlovers.com/palette/867235/LoversInJapan" target=_blank">Lovers in Japan - palette</a> - lovelyrita</li>
<li><a href="https://bvfonts.com/fonts/details.php?id=76" target="_blank">Learning Curve Pro - font</a></li>
<li><a href="https://www.fontspace.com/always-in-my-heart-font-f16367" target="_blank">Always In My Heart - font</a> - ByTheButterfly</li>
<li><a href="https://fontawesome.com/" target="_blank">fontawesome - heart icon</a></li>
<li><a href="https://tirifto.xwx.moe/en/emoji/blobcats.html" target="_blank">blobcats</a> - Tirifto</li>
<li><a href="https://pixabay.com/illustrations/thought-bubble-thoughts-think-7791595/" target="_blank">Thought bubble</a> - einsichtsweise</li>
</ul>
`;
const baxterThoughtImgSrc = [
"./img/baxter-thoughts/baxter-thought-one.webp",
"./img/baxter-thoughts/baxter-thought-two.webp",
"./img/baxter-thoughts/baxter-thought-three.webp",
"./img/baxter-thoughts/baxter-thought-four.webp",
"./img/baxter-thoughts/baxter-thought-five.webp",
"./img/baxter-thoughts/baxter-thought-six.webp",
"./img/baxter-thoughts/baxter-thought-seven.webp"
];
const displayReadThisNote = () => {
const readNote = document.querySelector(".love-note");
readNote.style.display = "block";
readNote.innerHTML = readThisMessage;
};
const displayNote = (noteName) => {
const loveNote = document.querySelector(".love-note");
loveNote.style.display = "block";
loveNote.innerHTML = notesForEmma[noteName.className.split(' ')[0]];
};
const displayCredits = () => {
const credits = document.querySelector(".love-note");
credits.style.display = "block";
credits.innerHTML = creditNote;
};
const extraLove = () => {
const header = document.querySelector(".header-text");
header.innerHTML += '. Always <i class="fa-solid fa-heart"></i>';
const transHeart = document.querySelector(".trans-pride-heart");
transHeart.style.cursor = "default";
transHeart.removeEventListener("click", extraLove);
}
2025-02-06 13:14:10 +00:00
const baxterHeadPat = () => {
const imgSrcArrayNo = Math.floor(Math.random() * 7);
const thoughtBubble = document.querySelector(".baxter-thought");
thoughtBubble.src = baxterThoughtImgSrc[imgSrcArrayNo];
2025-02-06 13:14:10 +00:00
};
const closeLoveLetter = () => {
const loveNote = document.querySelector(".love-note");
loveNote.style.display = "none";
};
const main = () => {
displayReadThisNote();
const tiles = document.querySelectorAll(".tile");
tiles.forEach((tile) => {
tile.style.cursor = "pointer";
tile.addEventListener("click", () => {
displayNote(tile);
});
});
2025-02-06 13:14:10 +00:00
const headPats = document.querySelector(".headpats");
headPats.style.cursor = "pointer";
headPats.addEventListener("click", baxterHeadPat);
const transHeart = document.querySelector(".trans-pride-heart");
transHeart.style.cursor = "pointer";
transHeart.addEventListener("click", extraLove);
const readThis = document.querySelector(".read-this");
readThis.style.cursor = "default";
readThis.removeEventListener("click", main);
};
const credits = document.querySelector(".credits");
credits.addEventListener("click", displayCredits);
const readThis = document.querySelector(".read-this");
readThis.addEventListener("click", main);