Skip to content
Permalink
4d271520e5
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
55 lines (39 sloc) 5.25 KB
import { Alert, Confirm, Prompt, Prompt2, Prompt3, Prompt4 } from "./game-framework.js";
/**
* Week 04 - Control Flow
*/
// 'Welcome to the perfume room. Explore and select your type.'
let name;
// Modify the text for the introduction
if (await Alert('\'Top Note\' is your first room. Top notes, sometimes referred to as headnotes, form the top layer of a fragrance. In other words, top notes are the scents you detect first after spraying a perfume. These play a role in setting first impressions and shaping a fragrance\’s story. Top notes usually evaporate quickly, lingering around for only the first five to fifteen minutes. Their main purpose is to give off an initial scent and then transition smoothly into the next part of the fragrance. As a result, top notes generally consist of lighter and smaller molecules. Some common top notes include citrus scents – like lemon, orange, and bergamot – as well as light floral scents like lavender and rose. Basil and anise are also commonly used as top notes.')) {
} else {
await Alert('That\'s too bad. Maybe next time.')
window.location.reload()
}
if(await Alert('\'Heart Note\' is your second room. As the name suggests, heart notes make up the “heart” of the fragrance. Their function is to retain some of the top notes’ aroma while also introducing new scents to deepen the experience. Sometimes referred to as middle notes, the heart notes also serve as a buffer for the base notes, which may not smell as pleasant on their own. Because they make up around 70 percent of the total scent, heart notes usually last longer than top notes. Heart notes appear as the top notes start to fade and remain evident for the full life of the fragrance. Heart notes include full-bodied, aromatic floral oils like jasmine, geranium, neroli and ylang-ylang, as well as cinnamon, pepper, pine, lemongrass, black pepper and cardamom.')
) {} else {
await Alert('That\'s too bad. Maybe next time.')
window.location.reload()
}
if(await Alert('\'Base Note\' is your last room. Along with middle notes, base notes in perfume form the foundation of the fragrance. They help boost the lighter notes while adding more depth and resonance. Since they form the perfume’s foundation, base notes are very rich, heavy and long-lasting fragrance notes. They kick in after about 30 minutes and work together with the middle notes to create the fragrance’s scent. Since base notes sink into your skin, their scent lingers the longest and can last for six hours or more. Popular base notes include vanilla, amber, musk, patchouli, moss and woody notes like sandalwood and cedarwood.')) {
name = await Prompt("What is your name?")
} else {
await Alert('That\'s too bad. Maybe next time.')
window.location.reload()
}
if(await Confirm(`Hi ${name}. Do you want to find your scent?`)) {
await Alert('Great! Let\'s get started.')
} else {
await Alert('That\'s too bad. Maybe next time.')
window.location.reload()
}
let choice2 = await Prompt2("Fresh Notes: Fresh notes are light and citrusy in nature, making them popular as top notes. Notes like orange and bergamot give a fragrance its freshness and sweetness, while lemon and bergamot have a more bitter sharpness \n \n \n What would you like to add: lemon, orange, bergamot, lavender, rose, basil.")
let choice3 = await Prompt3("Floral Notes: Floral notes add a natural feel to a fragrance. They are often used as top or heart notes and can be mixed with other notes for a more dramatic scent. \n \n \n Jasmine is another popular floral note with its fruity and white floral scent, while ylang ylang adds a more tropical touch. \n \n \n Fruit Notes: Fruity notes are most commonly used as middle notes, as they blend easily with other notes and can add more depth to a fragrance. For example, blackberry adds a rich, musky scent, while notes like apple and strawberry give off a sweet and juicy vibe. \n \n \n What would you like to add: jasmine, geranium, ylang-ylang, cinnamon, pepper, lemon grass, cardamon.")
let choice4 = await Prompt4("Spice Note: Spice notes are used to add warmth and potency to a fragrance, mixing particularly well with floral notes in the heart of a perfume. Notes like cinnamon and nutmeg add spice and sweetness, while others like rosemary and basil possess an herbal quality. \n \n \n Wood Notes: Sandalwood and patchouli are two wood notes that are often used in a fragrance’s base to strengthen the scent’s lifetime. While most wood notes have an earthy quality, some like cedarwood and oud provide a nice sweet scent. \n \n \n Musk Notes: Musky notes are most frequently found in the base notes of fragrances. Their richness helps to fill in the foundation and increase the duration of the scent. The different types of musk, from black musk to cashmere musk, means that these scents can add a unique trait to any fragrance. \n \n \n What would you like to add: vanilla, amber, mush, patchouli, sandalwood, cedarwood.")
if(await Confirm(`You chose ${choice2}, ${choice3}, ${choice4}. Are you happy with your selection? Press \'OK\' to move on.`)) {
await Alert('Great! Let\'s get your perfume.')
} else {
await Alert('That\'s too bad. Maybe next time.')
window.location.reload()
}
// https://www.fragrancex.com/blog/fragrance-notes/