-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
39 lines (31 loc) · 1.97 KB
/
script.js
File metadata and controls
39 lines (31 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
document.getElementById('proposalForm').addEventListener('submit', function(e) {
e.preventDefault();
const name = document.getElementById('name').value;
const favorite = document.getElementById('favorite').value;
const style = document.getElementById('style').value;
const romanticQuotes = [
`Hey ${name}, just like ${favorite}, you warm my heart every day. Will you be mine forever?`,
`${name}, you are the reason my mornings are brighter, like a perfect cup of ${favorite}. Will you share forever with me?`,
`From the moment I saw you, ${name}, my heart knew that life would be sweeter with you, just like ${favorite}. Will you be mine?`
];
const funnyQuotes = [
`Yo ${name}, you're cooler than ${favorite}, and that's saying something. Wanna be my partner-in-crime?`,
`${name}, life without you is like ${favorite} without sugar. Let's not let that happen! Be mine?`,
`Roses are red, ${favorite} is sweet, and if you don’t say yes, I’ll fall off my feet!`
];
const poeticQuotes = [
`${name}, like the sun rises and sets, my heart beats only for you. With ${favorite} by our side, will you say yes?`,
`Just like ${favorite} fills the air with fragrance, your love fills my soul with joy, ${name}. Will you be mine for eternity?`,
`${name}, your presence is as constant as the moonlight, and my love for you flows like poetry. With ${favorite} in hand, will you say yes?`
];
let proposal;
if (style === 'romantic') {
proposal = romanticQuotes[Math.floor(Math.random() * romanticQuotes.length)];
} else if (style === 'funny') {
proposal = funnyQuotes[Math.floor(Math.random() * funnyQuotes.length)];
} else if (style === 'poetic') {
proposal = poeticQuotes[Math.floor(Math.random() * poeticQuotes.length)];
}
document.getElementById('proposalText').innerText = proposal;
document.getElementById('proposalOutput').style.display = 'block';
});