Skip to content

luckyszakul0/FM-results-summary-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - Results summary component solution

This is a solution to the Results summary component challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

The challenge

Users should be able to:

  • View the optimal layout for the interface depending on their device's screen size
  • See hover and focus states for all interactive elements on the page

Screenshot

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • CSS Grid
  • Mobile-first workflow
  • Javascript for injecting JSON
  • Variable font file

What I learned

The most influencial thing I learned were basic operations with JSON files and injecting them into HTML.
The other thing was in this project I first learned about variable fonts and how to declare them in CSS.

@font-face {
  font-family: 'HankenGrotesk';
  src: url(assets/fonts/HankenGrotesk-VariableFont_wght.ttf) format('truetype');
  font-weight: 500 800;
}
async function loadJSONData(){
  const response = await fetch('./data.json');
  const names = await response.json();

  let i = 0;
  for(const component of componentsArray){
      component.children[0].children[1].innerHTML = names[i].category;
      component.children[1].children[0].innerHTML = names[i].score;
      component.children[0].children[0].setAttribute("src", names[i].icon);
      i++;
  }
}

Continued development

In future project I plan to use a CSS preprocessor, probably Sass, because the code bloat is getting tiring. Also, as I'm actively learning jQuery, I plan to use it more often. Another subject that requires my attention are JS Promises.

Useful resources

Author

About

This repo is for a results summary component challenge that can be found on frontendmentor.io

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published