StealThis .dev

Real Estate — Affordability Estimator

An editorial home-affordability estimator that turns annual income, monthly debts, down payment, interest rate, loan term and a debt-to-income target into a recommended purchase-price range. A live semicircular gauge tracks the maximum price, while result cards break out the estimated monthly housing payment, loan amount, required income and down-payment share. Matching sample listings flag whether each fictional home fits the buyer's band, with a per-home monthly payment preview.

Відкрити в Lab
html css vanilla-js
Цілі: JS HTML

Код

Affordability Estimator

A premium, editorial buyer tool that answers the first question every shopper asks: what can I actually afford? The left panel collects gross annual income, monthly debt obligations, available down-payment cash, interest rate, debt-to-income target and loan term. Number fields and matching sliders stay in sync, each with a live formatted readout and a brass-filled track.

The right panel reacts instantly. A semicircular SVG gauge sweeps a green-to-brass-to-red arc with a needle that points to the recommended maximum price, computed by inverting a lender-style DTI formula and converging on a price that folds in property tax, insurance and HOA escrow. Below it, four metric tiles surface the estimated monthly housing payment, loan amount, income needed and down-payment percentage, plus a horizontal breakdown of principal & interest versus taxes and insurance. A status chip reads Comfortable, Stretch or Aggressive depending on how hard the inputs push the DTI and down-payment ratios.

Saving the estimate scrolls to a grid of fictional listings rendered with warm architectural CSS gradients standing in for property photography. Each card carries price, beds, baths and square footage badges, a flag for whether it fits the recommended band (or how far over it is), and a quick monthly-payment preview at the current rate and term. A small toast helper confirms saves and resets.

Illustrative UI only — sample listings and data are fictional; not a real real-estate service.