-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.js
54 lines (43 loc) · 1.26 KB
/
settings.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
// SETTINGS
const pocong_img = document.getElementById('pocong-img')
const manusia_img = document.getElementById('human')
let pocong_src = 1
let manusia_src = 1
sessionStorage.setItem('pocongimg', pocong_src)
sessionStorage.setItem('humanimg', manusia_src)
function pocongback(){
if(pocong_src > 1){
pocong_src--
} else {
pocong_src = 3
}
sessionStorage.setItem('pocongimg', pocong_src)
pocong_img.src = "./assets/pocong/" + sessionStorage.getItem('pocongimg') + ".gif"
}
function pocongnext(){
if(pocong_src < 4){
pocong_src++
} else {
pocong_src = 1
}
sessionStorage.setItem('pocongimg', pocong_src)
pocong_img.src = "./assets/pocong/" + sessionStorage.getItem('pocongimg') + ".gif"
}
function humanBack(){
if(manusia_src > 1){
manusia_src--
} else {
manusia_src = 3
}
sessionStorage.setItem('humanimg', manusia_src)
manusia_img.src = "./assets/manusia/" + sessionStorage.getItem('humanimg') + ".gif"
}
function humanNext(){
if(manusia_src < 3){
manusia_src++
} else {
manusia_src = 1
}
sessionStorage.setItem('humanimg', manusia_src)
manusia_img.src = "./assets/manusia/" + sessionStorage.getItem('humanimg') + ".gif"
}