-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
103 lines (96 loc) · 3.43 KB
/
index.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
<!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>ATM MACHINE</title>
<link rel="stylesheet" href="./bootstrap-5.2.2-dist/css/bootstrap.css">
</head>
<body>
<style>
.child3{
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 40px;
left: 190px;
width: 400px;
top: -270px;
position: relative;
height: 100px;
}
</style>
<div class="container w-50 rounded" style="background-color: #0B3A97;">
<div class="child1 text text-white ms-5 mt-5" style="position: relative; top:50px;">
<h1 class="mx-auto" align="center">VICKY ATM MACHINE</h1>
<p id="balance"></p>
<div class="child2 mt-4">
<h2 class="text1 mt-5"></p>
<h6 class="text2" id="display">ffff</h3><br>
<h2 class="text1">PIN</p>
<h3 class="text2">*******</h3> <br>
<h2 class="text1">Balance</p>
<h3 class="text2" id="text3">₦0</h3> <br>
<input type="button" value="Click to add your Name" onclick="adname()">
</div>
<div class="child3">
<button onclick="withdraw()" class="btn btn-primary">Withdraw</button>
<button onclick="deposit()" class="btn btn-primary">Deposit</button>
<button onclick="account()" class="btn btn-primary">Account Number</button>
<button onclick="airtime()" class="btn btn-primary">Buy Airtime</button>
<button onclick="transfer()" class="btn btn-primary">Transfer</button>
<button onclick="logout()" class="btn btn-primary">Log out</button>
<input type="text" placeholder="₦" id="bal" class="my-3 form-control">
</div>
<script>
function logout(){
alert("Are you sure you want to log out")
window.location.href = "signin.html"
}
function adname(){
alert("am working")
prompt("WHAT IS YOUR NAME PLEASE")
if(prompt.userResponse.value="string"){
display.innerHTML +=`
<h2>Dear, ${balance.value}</h2>`
}
}
function account(){
var randomNumber = Math.round(Math.random()*20000000000)
if(randomNumber){
alert("YOUR ACCOUNT MUNBER IS " + randomNumber)
}
}
var balance = 0
bal.style.color = "yellowgreen"
function dep(){
var customer = Number(amount.value)
if (customer < 1){
alert("Invalid Amount")
} else if(customer == ""){
alert("Enter an amount")
} else if (customer > 0){
bal.innerText = balance + customer
balance = balance + customer
alert("Deposit Successfully")
} else{
alert("Error")
}
}
function withd(){
var customer = Number(amount.value)
if (bal.innerText < customer ){
alert("Insufficient Fund")
}else if(customer == ""){
alert("Enter an amount")
}else if(customer < balance){
bal.innerText = balance - customer
balance = balance - customer
alert("Withdraw Successfully")
}else{
alert("Error")
}
}
</script>
</body>
</html>