-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
57 lines (44 loc) · 2.03 KB
/
app.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
53
54
55
56
57
function calculate() {
document.getElementById("span").textContent = ""
document.querySelector(".media-result").classList.remove("aprooved")
document.querySelector(".media-result").classList.remove("reprooved")
document.querySelector(".media-result").classList.remove("animate__bounce")
document.querySelector(".media-result").classList.remove("animate__fadeInLeft")
document.querySelector(".media-result").classList.add("animate__animated")
const note1 = Number(document.getElementById("note1").value)
const note2 = Number(document.getElementById("note2").value)
const note3 = Number(document.getElementById("note3").value)
const note4 = Number(document.getElementById("note4").value)
verifyValue(note1)
verifyValue(note2)
verifyValue(note3)
verifyValue(note4)
const media = (note1 + note2 + note3 + note4) / 4
if (media.toFixed(1) >= 6) {
document.getElementById("span").textContent = `aprovado, nota: ${media.toFixed(1)}`
document.querySelector(".media-result").classList.add("aprooved")
document.querySelector(".media-result").classList.add("animate__bounce")
} else {
document.getElementById("span").textContent = `reprovado, nota: ${media.toFixed(1)}`
document.querySelector(".media-result").classList.add("reprooved")
document.querySelector(".media-result").classList.add("animate__fadeInLeft")
}
clearValue()
}
function clearValue() {
document.getElementById("note1").value = ""
document.getElementById("note2").value = ""
document.getElementById("note3").value = ""
document.getElementById("note4").value = ""
}
function verifyValue(value) {
if (!value) {
return
}
}
function animation() {
document.querySelector(".woman").classList.add("animate__animated")
document.querySelector(".media-container").classList.add("animate__animated")
document.querySelector(".woman").classList.add("animate__fadeInLeft")
document.querySelector(".media-container").classList.add("animate__fadeInDown")
}