-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
46 lines (41 loc) · 1.26 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
// price of tokens
const red_token_price = 2;
const blue_token_price = 3;
// Big Hero 6 button
let tix_bg6 = 0;
document.getElementById('button_bg6').addEventListener('click',
function() {
document.getElementById('tix_bg6').innerHTML = `${++tix_bg6}`;
}
);
// Inside Out button
let tix_io = 0;
document.getElementById('button_io').addEventListener('click',
function() {
document.getElementById('tix_io').innerHTML = `${++tix_io}`;
}
);
// show revenues button
let rev_bg6 = 0;
let rev_io = 0;
document.getElementById('button_rev').addEventListener('click',
function() {
rev_bg6 = tix_bg6 * 3 * red_token_price + tix_bg6 * 2 * blue_token_price;
document.getElementById('rev_bg6').innerHTML = `$${rev_bg6}`;
rev_io = tix_io * 2 * red_token_price + tix_io * 3 * blue_token_price;
document.getElementById('rev_io').innerHTML = `$${rev_io}`;
}
);
// reset button
document.getElementById('button_reset').addEventListener('click',
function() {
tix_bg6 = 0;
document.getElementById('tix_bg6').innerHTML = ' ';
tix_io = 0;
document.getElementById('tix_io').innerHTML = ' ';
rev_bg6 = 0;
document.getElementById('rev_bg6').innerHTML = ' ';
rev_io = 0;
document.getElementById('rev_io').innerHTML = ' ';
}
);