-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.js
52 lines (45 loc) · 1.32 KB
/
index.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
40
41
42
43
44
45
46
47
48
49
50
51
52
const sim = window.document.getElementById("opcyes")
const nao = window.document.getElementById("opcNo")
const fundo = window.document.getElementById("area")
const resp = window.document.getElementById("textinho")
nao.addEventListener("mouseenter", entrar)
let estado = -1
function entrar(){
estado++
if (estado == 0){
sim.style.transform="translate(+95px)"
nao.style.transform="translate(130px, -150px)"
}
if (estado == 1){
nao.style.transform="translate(130px, +150px)"
}
if (estado == 2){
nao.style.transform="translate(-325px, +150px)"
}
if (estado == 3){
nao.style.transform="translate(-325px, -150px)"
}
if (estado == 4){
nao.style.transform="translate(+135px, +150px)"
}
if (estado == 5){
nao.style.transform="translate(+135px, -150px)"
}
if (estado == 6){
nao.style.transform="translate(-325px, +150px)"
}
if (estado == 7){
nao.style.transform="translate(-325px, -150px)"
estado = -1
}
}
sim.addEventListener("click", clicar)
function clicar(){
resp.innerHTML ="Eu te amo meu amoooor!!"
sim.style.transform="translate(0px)"
nao.style.transform="translate(0px, 0px)"
resp.style.opacity= 1;
setTimeout(function(){
resp.style.opacity = 0;
}, 3000 )
}