Giter VIP home page Giter VIP logo

results-summary-component's Introduction

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

Desktop screenshot Mobile screenshot

Links

My process

Built with

  • HTML5
  • CSS with Flexbox, BEM methodology, and Sass
  • Javascript and JQuery

What I learned

In completing this project, I learned how to

  • apply a color gradient as a background-image
  • use hsla to specify colors and opacity
  • minimize CSS (although it was hardly necessary for such a small project)
  • use JQuery to select HTML elements and change their text and attributes, i.e.,
for (let row = 0; row <= 3; row++) {
    $(`.summary-card__img--${row}`).attr("src", data[row].icon)
    $(`.summary-card__category--${row}`).text(data[row].category)
    $(`.summary-card__grade--${row}`).text(data[row].score)
}

Continued development

  • Since I learned how to minimize CSS, I should probably learn how to minimize Javascript as well.
  • While I do appreciate BEM methodology for how it helps me organize my CSS thinking and code, using BEM does produce a lot of files and directories compared to simply putting all of my CSS into a single styles.css file. This necessitates the project having a build step. On this (and my previous) project, I used Make for building. On my next project, I plan to use Gulp for building.
  • Reading in a local JSON file was surprisingly difficult. In the end, I edited the data.json file so that it defined data to be a list of objects. Then, I loaded the file in index.html using a script tag. But to do this, I needed to be able to edit data.json which won't always be the case. So, what's the best way to read a local JSON file?

Useful resources

  • W3Schools HTML HSL and HSLA Colors - This W3S page explains the H, S, L, and A from hsla and has several demos with sliders that let you see the effects of changing each of the values.
  • Learn Makefiles - I hadn't written a Makefile in a while. This webpage served as an excellent refresher.
  • JQuery API Documentation - This is the official JQuery documentation site. It's fairly easy to read and contains many code snippets.

Author

Acknowledgments

results-summary-component's People

Contributors

harnettd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.