-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
51 lines (48 loc) · 1.51 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
// Verification pin generator
function getPin (){
const pin = Math.round(Math.random() * 10000);
const pinString = pin + '';
if (pinString.length == 4){
// console.log(pin);
return pin;
}
else{
// console.log('komi geche reee... ' + pin);
return getPin;
}
};
// verrification pin generator display part
function generatePin() {
const pintus = getPin();
document.getElementById('input-pin').value = pintus;
};
// number-pad
document.getElementById('number-pad').addEventListener('click', function (event) {
const number = event.target.innerText;
const output = document.getElementById('output-display');
if (isNaN(number)){
if (number == 'C'){
output.value = '';
}
}
else{
const priviusNumber = output.value;
const newNumber = priviusNumber + number;
output.value = newNumber;
}
});
// button Click and varifi pin
function verifypin (){
const numberPad = document.getElementById('output-display').value;
const numberPadValue = document.getElementById('input-pin').value;
const notifacationRong = document.getElementById('notifacition-rong');
const notifacationRight = document.getElementById('notifacition-right');
if (numberPad == numberPadValue){
notifacationRight.style.display = 'block';
notifacationRong.style.display = 'none';
}
else{
notifacationRong.style.display = 'block';
notifacationRight.style.display = 'none';
}
};