From 238dc5bbbd2da2a1d05ad1fb4a39bae6d3c6c331 Mon Sep 17 00:00:00 2001 From: AvinashUmrao <162718233+AvinashUmrao@users.noreply.github.com> Date: Fri, 25 Oct 2024 07:43:42 +0530 Subject: [PATCH] Added file under web Development #66 Problem solved --- Web_Development/Finance Manager/index.html | 24 ++++++++ Web_Development/Finance Manager/script.js | 26 ++++++++ Web_Development/Finance Manager/styles.css | 71 ++++++++++++++++++++++ 3 files changed, 121 insertions(+) create mode 100644 Web_Development/Finance Manager/index.html create mode 100644 Web_Development/Finance Manager/script.js create mode 100644 Web_Development/Finance Manager/styles.css diff --git a/Web_Development/Finance Manager/index.html b/Web_Development/Finance Manager/index.html new file mode 100644 index 0000000..5f8e454 --- /dev/null +++ b/Web_Development/Finance Manager/index.html @@ -0,0 +1,24 @@ + + + + + + Personal Finance Manager + + + +
+

Personal Finance Manager

+
+ + + +
+
+

Expenses

+ +
+
+ + + \ No newline at end of file diff --git a/Web_Development/Finance Manager/script.js b/Web_Development/Finance Manager/script.js new file mode 100644 index 0000000..fa77604 --- /dev/null +++ b/Web_Development/Finance Manager/script.js @@ -0,0 +1,26 @@ +let expenses = []; + +function addExpense() { + const name = document.getElementById('expense-name').value; + const amount = document.getElementById('expense-amount').value; + + if (name && amount) { + expenses.push({ name, amount: parseFloat(amount) }); + document.getElementById('expense-name').value = ''; + document.getElementById('expense-amount').value = ''; + renderExpenses(); + } else { + alert('Please enter both name and amount'); + } +} + +function renderExpenses() { + const expenseList = document.getElementById('expense-list'); + expenseList.innerHTML = ''; + + expenses.forEach(expense => { + const li = document.createElement('li'); + li.innerHTML = `${expense.name} - $${expense.amount.toFixed(2)}`; + expenseList.appendChild(li); + }); +} \ No newline at end of file diff --git a/Web_Development/Finance Manager/styles.css b/Web_Development/Finance Manager/styles.css new file mode 100644 index 0000000..37427cd --- /dev/null +++ b/Web_Development/Finance Manager/styles.css @@ -0,0 +1,71 @@ +body { + font-family: Arial, sans-serif; + background-color: #f4f4f4; + margin: 0; + padding: 0; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +.container { + background-color: #fff; + padding: 20px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + border-radius: 8px; + width: 300px; + text-align: center; +} + +h1 { + margin-bottom: 20px; +} + +.form-group { + margin-bottom: 20px; +} + +input[type="text"], input[type="number"] { + width: calc(100% - 22px); + padding: 10px; + margin-bottom: 10px; + border: 1px solid #ddd; + border-radius: 4px; +} + +button { + padding: 10px 20px; + background-color: #28a745; + border: none; + color: white; + border-radius: 4px; + cursor: pointer; +} + +button:hover { + background-color: #218838; +} + +.expenses { + text-align: left; +} + +.expenses h2 { + margin-top: 0; +} + +ul { + list-style-type: none; + padding: 0; +} + +li { + background-color: #f9f9f9; + margin-bottom: 10px; + padding: 10px; + border: 1px solid #ddd; + border-radius: 4px; + display: flex; + justify-content: space-between; +} \ No newline at end of file