Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 10 months ago

Mortgage Calculator component

accessibility, vite, vue, sass/scss
Andrey•5,430
@dar-ju
A solution to the Mortgage repayment calculator challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

This time I used plugin "CodeTime", I liked it more, will use next.

Dicided to experiment with some new tools for me.

First of them - modules in SCSS, which replaces BEM methodology, classes with is looks like :class="$style.result". My opinion is that BEM goes better with SCSS, or maybe I’m just more accustomed to BEM...

Second, I used SCSS functions, or rather one function - converter pixels to rem. Here is the function:

@use 'sass:math';
@function rem($px) {
 @return #{math.div($px, 16)}rem;
}

And using it: connecting in styles - @use '@/assets/styles/_functions.scss' as func; and using, for example - padding-right: func.rem(40);

All these innovations greatly increase the development time, according to CodeTime this component took 15 hours.

Calculating the mortgage also took time, the formula for annuity payments had to be googled + additional restrictions in input fields.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Andrey's solution.

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License