Skip to content

Commit

Permalink
mortage payment calculator
Browse files Browse the repository at this point in the history
  • Loading branch information
FredericHeem committed Nov 4, 2024
1 parent afc1959 commit 9246483
Show file tree
Hide file tree
Showing 15 changed files with 551 additions and 1 deletion.
24 changes: 24 additions & 0 deletions examples/mortgage-repayment-calculator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
2 changes: 2 additions & 0 deletions examples/mortgage-repayment-calculator/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
save-exact = true
package-lock = false
23 changes: 23 additions & 0 deletions examples/mortgage-repayment-calculator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Frontend Mentor Mortgage Repayment Calculator

Here is the implementation in [Bau.js](https://github.com/grucloud/bau) of the [Frontend Mentor Mortgage Repayment Calculator code challenge](https://www.frontendmentor.io/challenges/mortgage-repayment-calculator-Galx1LXK73)

## Workflow

Install the dependencies:

```sh
npm install
```

Start a development server:

```sh
npm run dev
```

Build a production version:

```sh
npm run build
```
17 changes: 17 additions & 0 deletions examples/mortgage-repayment-calculator/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link
rel="icon"
type="image/png"
href="./assets/images/favicon-32x32.png"
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Mortgage Repayment Calculator | FrontendMentor</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
21 changes: 21 additions & 0 deletions examples/mortgage-repayment-calculator/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "frontendmentor-mortgage-repayment-calculator",
"private": true,
"version": "0.85.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"devDependencies": {
"typescript": "^5.0.2",
"vite": "^5.2.11"
},
"dependencies": {
"@grucloud/bau": "^0.85.0",
"@grucloud/bau-css": "^0.85.0",
"@grucloud/bau-ui": "^0.85.0",
"bignumber.js": "9.1.2"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions examples/mortgage-repayment-calculator/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { createContext, type Context } from "@grucloud/bau-ui/context";
import mortgageRepaymentCalculator from "./mortgageRepaymentCalculator";

import "./style.css";

const context = createContext();

const app = (context: Context) => {
const { bau } = context;
const { main } = bau.tags;

const MortgageRepaymentCalculator = mortgageRepaymentCalculator(context);

return function () {
return main(MortgageRepaymentCalculator());
};
};

const App = app(context);
document.getElementById("app")?.replaceChildren(App());
Loading

0 comments on commit 9246483

Please sign in to comment.