mirror of
https://github.com/MrEidam/PetPet.git
synced 2026-04-17 15:43:31 +00:00
NQ6 is now 'earning' money
This commit is contained in:
@@ -2,11 +2,31 @@ const dice = document.querySelector('#dice'); //img
|
||||
let answear = document.querySelector('#answear'); //text ans
|
||||
let number = document.querySelector('#num'); //num selec
|
||||
|
||||
let moneyDisplay = document.querySelector('#money');
|
||||
let money = 0;
|
||||
|
||||
async function display(){
|
||||
moneyDisplay.innerHTML = money;
|
||||
}
|
||||
|
||||
async function nft(amount){ //! MONEY POPPING
|
||||
let dabloons = document.createElement('h4');
|
||||
dabloons.classList.add('coins');
|
||||
dabloons.innerHTML = `+${amount}`;
|
||||
document.body.append(dabloons);
|
||||
money += amount;
|
||||
display();
|
||||
setTimeout(() => {
|
||||
dabloons.remove();
|
||||
}, 500);
|
||||
}
|
||||
|
||||
async function correct(){
|
||||
let won = document.createElement('h1');
|
||||
won.classList.add('result', 'won');
|
||||
won.innerHTML = `Correct!<br> +10 coins`;
|
||||
document.body.append(won);
|
||||
nft(10);
|
||||
setTimeout(() => {
|
||||
won.remove();
|
||||
}, 600);
|
||||
|
||||
Reference in New Issue
Block a user