-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
39 lines (34 loc) · 1.23 KB
/
script.js
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
let clickCount = 0;
const yesBtn = document.querySelector('.yes-btn');
const noBtn = document.querySelector('.no-btn');
const title = document.querySelector('.title');
const questionContainer = document.querySelector('#question-container');
const gifContainer = document.querySelector('#gif-container');
const messages = [
"Sicura topina?",
"Pensaci bene...",
"Eiiiiii",
"😠😠😠😠😠😠",
];
function makeYesBigger() {
clickCount++;
const scale = 1 + (clickCount * 0.1);
const fontSize = 20 + (clickCount * 2);
const padding = 20 + (clickCount * 2);
yesBtn.style.transform = `scale(${scale})`;
yesBtn.style.fontSize = `${fontSize}px`;
yesBtn.style.padding = `${padding}px`;
noBtn.style.transform = `scale(${1 - (clickCount * 0.05)})`;
const randomMessage = messages[Math.floor(Math.random() * messages.length)];
title.textContent = randomMessage;
}
function sayYes() {
questionContainer.style.opacity = '0';
setTimeout(() => {
questionContainer.style.display = 'none';
gifContainer.style.display = 'block';
setTimeout(() => {
gifContainer.classList.add('visible');
}, 100);
}, 500);
}