-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaccountBalance.html
More file actions
114 lines (106 loc) · 2.69 KB
/
accountBalance.html
File metadata and controls
114 lines (106 loc) · 2.69 KB
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
<!DOCTYPE html>
<html>
<head>
<style>
a{
text-decoration: none;
}
body {
font-family: Arial, sans-serif;
background-color: white;
}
h1 {
color: #F76902;
text-align: center;
border-style: solid;
}
h2 {
text-align: center;
}
h3 {
color: #F76902;
}
p {
font-size: 20px;
text-align: center;
}
.orange {
width: 33%;
background-color: #F76902;
margin-left: 11%;
}
button {
background-color: black;
color: #F76902;
border-radius: 20px;
margin: auto;
display: block;
}
.center {
text-align: center;
}
.back-button {
position: absolute;
top: 10px;
right: 10px;
background-color: #e0e0e0;
border: 1px solid #ccc;
color: black;
padding: 10px 10px;
font-size: 14px;
cursor: pointer;
}
</style>
<script>
var total = 500;
function addFunds(){
let num = document.getElementById("addedAmount").value;
total = Number(total) + Number(num);
document.getElementById("total").innerHTML = "$" + total;
}
function spent(){
let num = document.getElementById("spentNum").value;
let reason = document.getElementById("spentReason").value;
let list = document.getElementById("spendingList");
let li = document.createElement("li");
var text = reason + " -$" + num;
total -= num;
document.getElementById("total").innerHTML = "$" + total;
li.innerHTML = text;
list.appendChild(li);
}
</script>
</head>
<body>
<h3><strong><a href="mainPage.html" >Paw Plan</a></strong></h3>
<button class="back-button"><a href="budget.html" >Back to Budget Info</a></button>
<h1>Account Balance</h1>
<div style="display: flex;">
<div class="orange">
<h2>Current Balance</h2>
<img src="pictures/account picture.png" alt="Account Icon" style="width:80%;max-width:700px;position:relative; left: 10%;">
<p id="total">$500</p>
<div class="center">
<button onclick="addFunds()">add funds</button>
<label for="total">Amount Added:</label><br>
<input type="text" id="addedAmount"><br>
<br>
</div>
<div class="center">
<button onclick="spent()">add spending</button>
<label for="spentNum">Amount Spent:</label><br>
<input type="text" id="spentNum"><br>
<label for="spentReason">Spending Reason:</label><br>
<input type="text" id="spentReason"><br>
<br>
</div>
</div>
<div class="orange">
<h2>Recent Spending</h2>
<div style="display: flex; justify-content: center;">
<ul id="spendingList"></ul>
</div>
</div>
</div>
</body>
</html>