diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..15fdf77 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,18 @@ +body { + font-family: 'Inter', sans-serif; +} + +.hero { + background: linear-gradient(45deg, #0d6efd, #6f42c1); + color: white; + padding: 4rem 0; +} + +.calculator-card { + box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15); +} + +#monthlyPayment { + font-size: 2rem; + font-weight: bold; +} diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..5144236 --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,23 @@ +document.addEventListener('DOMContentLoaded', function () { + const loanAmount = document.getElementById('loanAmount'); + const interestRate = document.getElementById('interestRate'); + const loanTerm = document.getElementById('loanTerm'); + const monthlyPayment = document.getElementById('monthlyPayment'); + + function calculatePayment() { + const p = parseFloat(loanAmount.value); + const r = parseFloat(interestRate.value) / 100 / 12; + const n = parseFloat(loanTerm.value) * 12; + + if (p > 0 && r > 0 && n > 0) { + const monthly = (p * r * Math.pow(1 + r, n)) / (Math.pow(1 + r, n) - 1); + monthlyPayment.textContent = '$' + monthly.toFixed(2); + } else { + monthlyPayment.textContent = '$0.00'; + } + } + + loanAmount.addEventListener('input', calculatePayment); + interestRate.addEventListener('input', calculatePayment); + loanTerm.addEventListener('input', calculatePayment); +}); diff --git a/index.php b/index.php index 7205f3d..5eec5e4 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,77 @@ - - + - - - New Style - - - - - - - - - - - - - - - - - - - + + + Interactive Calculator + + + + + + + + + + + + + + -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

-
-
- + + + +
+
+

Loan Calculator

+

Instantly calculate your monthly loan payments.

+
+
+ +
+
+
+
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+
+

Monthly Payment

+

$0.00

+
+
+
+
+
+
+
+ + + + + - + \ No newline at end of file