Skip to content

Commit

Permalink
opened database instance
Browse files Browse the repository at this point in the history
  • Loading branch information
rajnidua committed Oct 13, 2021
1 parent 1fd309b commit a5b4aab
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 39 deletions.
8 changes: 8 additions & 0 deletions public/db.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// We request a database instance.
const request = indexedDB.open("budgetDatabase", 1);

// This returns a result that we can then manipulate.
request.onsuccess = (event) => {
console.log(request.result);
console.log(request);
};
91 changes: 52 additions & 39 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,47 +1,60 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="theme-color" content="#317EFB">
<link rel="shortcut icon" href="icons/icon-192x192.png" type="image/x-icon">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<meta name="theme-color" content="#317EFB" />
<link
rel="shortcut icon"
href="icons/icon-192x192.png"
type="image/x-icon"
/>

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="styles.css">
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<link rel="stylesheet" href="styles.css" />

<title>Budget Tracker</title>
</head>
<body>
<div class="wrapper">
<div class="total">
<div class="total">Your total is: $<span id="total">0</span></div>
</div>
<title>Budget Tracker</title>
</head>
<body>
<div class="wrapper">
<div class="total">
<div class="total">Your total is: $<span id="total">0</span></div>
</div>

<div class="form">
<input type="text" id="t-name" placeholder="Name of transaction" />
<input type="number" min="0" id="t-amount" placeholder="Transaction amount" />
<button id="add-btn"><i class="fa fa-plus buttons"></i> Add Funds</button>
<button id="sub-btn"><i class="fa fa-minus"></i> Subtract Funds</button>
<p class="error"></p>
</div>
<div class="form">
<input type="text" id="t-name" placeholder="Name of transaction" />
<input
type="number"
min="0"
id="t-amount"
placeholder="Transaction amount"
/>
<button id="add-btn">
<i class="fa fa-plus buttons"></i> Add Funds
</button>
<button id="sub-btn"><i class="fa fa-minus"></i> Subtract Funds</button>
<p class="error"></p>
</div>

<div class="transactions">
<table>
<thead>
<th>Transaction</th>
<th>Amount</th>
</thead>
<tbody id="tbody"></tbody>
</table>
</div>

<div class="transactions">
<table>
<thead>
<th>Transaction</th>
<th>Amount</th>
</thead>
<tbody id="tbody">

</tbody>
</table>
<canvas id="myChart"></canvas>
</div>

<canvas id="myChart"></canvas>
</div>

<script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"></script>
<script src="index.js"></script>
</body>
</html>
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"></script>
<script src="index.js"></script>
<script src="db.js"></script>
</body>
</html>

0 comments on commit a5b4aab

Please sign in to comment.