Documentation
Documentation
HTML:
CSS:
font-size: 2em;
4-vertical
8-blur radius
border-radius: 50%
iski wajah se logo circular hai
Header:
Ek header section jo "Login - Manan's Expense Tracker" ka title dikhaata hai.
Form:
Form ko rounded corners, shadows, aur white background ke saath style kiya gaya hai.
Footer:
Ek footer section jo Manan's Expense Tracker ke liye copyright information dikhata hai.
Footer ko dark background aur white text ke saath style kiya gaya hai.
JavaScript:
Ye default form submission ka behavior rokne ke liye false return karta hai, taaki redirection ho sake.
About us
Contact us
Similar to login form but only few links are added which are mine personal as I have not created
for this website.
Position relative: ek element ke position ko relative banati hai uske parent element ke respect
mein. Subscription plain mein list hai vo relative hai subscription plan ke respect mein.
transition: background-color 0.3s, color 0.3s;:Ye CSS property ek element par kisi bhi change ke
transition ko define karta hai. Yahan par background-color aur color ke liye 0.3 seconds ka
transition time set kiya gaya hai, matlab jab koi element hover hoga to uska background-color
aur color 0.3 seconds mein smoothly change hoga. Ye effect user interface ko attractive banane
ke liye istemal kiya jata hai.
z-index: 1;
Z-index property positioned elements ki stacking order ko control karta hai. Jitna index jyada
utni layers vo upar rahega.
Top:100% use kiya hai taaki sub menu exact bottom pe aaye menu ke.
H2:before , use kiya hai taaki bullets ko h2 tags se pehle use kar saku.
JavaScript part:
1. Variables Initialization:
expensesData aur incomesData arrays me expenses aur incomes ki data store hoti hai.
2. addExpense(event) Function:
- Ye function tab call hota hai jab expense form submit hota hai.
- isme expense data ham 2 store karva paa rahe hai kyuki ye object hai javascript mein aur
isme multiple data support kiye jaate hai.
- event.preventdefault() use kiya hai taaki page reload na hojaye form submit hone par kyuki
hame multiple entries chahiye incomes and expenses ki.
- Ye functions ko call karta hai jo expenses table aur remaining balance ko update karte hain.
3. addIncome(event) Function:
4. updateExpensesTable() Function:
- expensesTableBody.innerHTML = ""; ka use kiya hai taaki purana data koi error na de aur
naya table ekdam accurate ho.
-expensesData.forEach(function (expense) { ... });: This loop iterates over each element in the
expensesData array, where each element represents an expense object containing a category
and an amount.
Isme dynamically ek row generate ki baadme td se cell bane baadme un tags ki close kar diya.
expensesTableBody.innerHTML += row;
isse rows ko append kiya.
totalExpense += parseFloat(expense.amount);
isme expense amount ko float mein convert karke total expense mein add kiya.
totalExpenseElement.textContent = totalExpense.toFixed(2);
total expense ko two digit decimal place tak string mein convert kiya display karne ke liye.
- Har expense category aur amount ko ek table row me display karta hai.
5. updateIncomesTable() Function:
- Ye functions total income aur total expense ko calculate karte hain incomesData aur
expensesData arrays me amounts ko sum karke.
7. calculateRemainingBalance() Function:
- Remaining balance ko calculate karta hai total income se total expense ko subtract karke.
8. updateRemainingBalance() Function:
- Page par display ki gayi remaining balance ko update karta hai calculateRemainingBalance()
function ko call karke.
- Har ek second, text ka rang agle rang me change hota hai colors array me.
In future I will learn database and server side programming and make this project to reality.