JSFiddle - React, Tailwind, and code Playground
by taffrail
HTML
NOTES:
Some of the variable names would be changed to AdviceBuilder names but you can't have a variable
name starting with a number.
ie. Company_401K_Match_Max_Pct would actually be 401K_Company_Match_Max_Pct
JavaScript
//////////////////////////////////////
const goal1 = "emergency fund1";
const goal2 = "debt1";
const goal3 = "debt2";
const goal4 = "401K match";
const goal5 = "emergency fund2";
const goal6 = "401K deferral";
const goal7 = "retirement savings";
const goal8 = "home savings";
let All_Goals_Complete;
let goal1_complete;
let goal2_complete;
let goal3_complete;
let goal4_complete;
let goal5_complete;
let goal6_complete;
let goal7_complete;
let goal8_complete;
///////////////////////////////
// General inputs
const Current_Age
const Inflation_Rate = .02;
const Salary = 150000;
const Monthly_Income = 10000;
const Monthly_Expenses = 6000;
// Set by rule
const Monthly_Spendable = Monthly_Income - Monthly_Expenses;
const Monthly_Spendable_Used = 0;
const Monthly_Spendable_Avail = 0;
let current_month = 0;
///////////////////////////////
// Emergency Fund Inputs
const Current_EF_Savings = 2000;
const Current_Emergency_Savings_Monthly;
const Emergency_Fund_Months_Needed = 6;
// Set by rule
let efSavings_Accum = Current_EF_Savings;
let emergency_fund_spend = 0;
///////////////////////////////
// Debt Inputs
const Debt1_Type;
const Debt1_Balance;
const Debt1_Interest_APR;
const Debt1_Payment_Monthly;
const Debt1_Payment_Additional;
const Debt2_Type;
const Debt2_Balance;
const Debt2_Interest_APR;
const Debt2_Payment_Monthly;
const Debt2_Payment_Additional;
// Set by rule
const Debt1_Interest_Total = 0;
const Debt2_Interest_Total = 0;
///////////////////////////////
// Retirement Inputs
const Tier1_Match_Pct;
const Tier1_Up_To_Pct;
const Tier2_Match_Pct;
const Tier2_Up_To_Pct;
const Match_Tiers; // (401K_Tiers)
const Years_Until_Retirement = 25;
const Retirement_Savings_Needed = 3200000;
const Current_Retirement_Savings = 400000;
const Rate_of_Return = .06;
const Company_401K_Match_Max_Pct; //(401K_Company_Match_Max_Pct)
const Other_Retirement_Savings_Monthly = 500; // Add Monthly_Retirement_Savings_Other_Current + Monthly_IRA_Contribution_Current
let...