-
Notifications
You must be signed in to change notification settings - Fork 0
/
belibensin-2.html
214 lines (185 loc) · 6.67 KB
/
belibensin-2.html
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Beli Bensin</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
<style>
body {
background-image: url('assets/green-color.png');
}
input[type='radio']:after {
width: 15px;
height: 15px;
border-radius: 15px;
top: -2px;
left: -1px;
position: relative;
background-color: #d1d3d1;
content: '';
display: inline-block;
visibility: visible;
border: 2px solid white;
}
input[type='radio']:checked:after {
width: 15px;
height: 15px;
border-radius: 15px;
top: -2px;
left: -1px;
position: relative;
background-color: #0a7041;
content: '';
display: inline-block;
visibility: visible;
border: 2px solid white;
}
.bottom {
display: flex;
justify-content: center;
}
.white-color-text {
color: white;
}
html,
body {
margin: 5px;
}
.button {
background-color: #4CAF50;
/* Blue */
border: none;
color: white;
padding: 15px 15px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
border-radius: 8px;
}
.button-blue {
background-color: #008CBA;
/* Blue */
border: none;
color: white;
padding: 15px 15px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
border-radius: 8px;
}
.button-red {
background-color: #f44336;
/* Red */
border: none;
color: white;
padding: 15px 15px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
border-radius: 8px;
}
.button-black {
background-color: #555;
/* Red */
border: none;
color: white;
padding: 15px 15px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
border-radius: 8px;
}
</style>
</head>
<body>
<!-- Top Page [S] -->
<div class="bottom">
<div class="unity-element">
<!-- Slider [S] -->
<div class="slider">
<input type="radio" id="slide-1" name="slider" disabled>
<input type="radio" id="slide-2" name="slider" checked disabled>
<input type="radio" id="slide-3" name="slider" disabled>
<input type="radio" id="slide-4" name="slider" disabled>
</div>
<!-- Slider [E] -->
</div>
</div>
<!-- Top Page [E] -->
<!-- Content [S] -->
<center>
<br>
<h1 class="white-color-text">
LAKUKAN<br>
<b>PUSH UP (<span id="tantangan-push-up">10</span>x)</b>
</h1>
<br>
<h1 class="white-color-text"> <span id="jumlah-push-up">0</span> <br><button class="button-red"
onclick="minus()"> - </button> <button class="button-blue" onclick="plus()"> + </button> <br>
<button class="button-black" onclick="addChallenge()">Kurang menantang!</button>
</h1>
<br>
<div class="white-color-text"> Dengan memencet enter, anda setuju dengan <abbr title="Kebijakan MyPertamina adalah:
(1) Selesaikan misi dengan penuh tanggung jawab
(2) Apabila misi tidak berhasil diselesaikan, maka akan ada konsekuensi
(3) Konsekuensi yang didapat jika misi tidak berhasil dijalankan adalah,
a) Peringatan tertulis - 1x
b) Ponsel berubah menjadi bom dan meledak (dampak kecil) - 2x
c) Bom panci didalam motor meledak - 3x">Kebijakan MyPertamina</abbr> </div>
<button class="button" onclick="verif()">Submit</button>
</center>
<!-- Content [E] -->
<script>
jumlahPushUp = 0
challenge = 10
function plus() {
pushUp = document.getElementById('jumlah-push-up')
jumlahPushUp += 1
pushUp.innerHTML = jumlahPushUp
}
function minus() {
pushUp = document.getElementById('jumlah-push-up')
jumlahPushUp -= 1
pushUp.innerHTML = jumlahPushUp
}
function addChallenge() {
challenge = challenge + 5
swal("Widih", "Kuat juga lu", 'success')
document.getElementById("tantangan-push-up").innerHTML = challenge
}
function save() {
localStorage.setItem('poin', poin);
localStorage.setItem('bensin', bensin);
}
function load() {
poin = JSON.parse(localStorage.getItem('poin'));
bensin = JSON.parse(localStorage.getItem('bensin'));
}
function verif() {
if (jumlahPushUp >= challenge) {
swal("Selamat!", "Anda akan dipindahkan ke halaman berikutnya.", 'success')
poin = JSON.parse(localStorage.getItem('poin'));
bensin = JSON.parse(localStorage.getItem('bensin'));
poin = poin + (challenge * 2)
localStorage.setItem('poin', poin);
localStorage.setItem('bensin', bensin);
window.location.replace("belibensin-3.html");
} else {
poin -= 10
swal("Ckckckck", "Gabisa ya? (-10 poin)", 'error')
}
}
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2"
crossorigin="anonymous"></script>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
</body>
</html>