Giter VIP home page Giter VIP logo

interactive-rating-component's Introduction

Interactive Rating Component

Live link: https://interactive-rating-component-nine-tau.vercel.app/

This is a simple rating component challenge from @FrontendMentor. I have used:

  • HTML
  • CSS and
  • JavaScript with Typescript

I am currently learning TS so using it is important, it was a massive challenge, I encountered a lot of errors but pushed through and its worked // save one error.

Issue to-do

Currently after you select a rating and then return to the cleared card the hover to purple on clicked ratings doesn't work.

        // Set styles for newly selected label
        if (labelElement) {
            labelElement.style.backgroundColor = "hsl(216, 12%, 54%)";
            labelElement.style.color = "hsl(0, 0%, 100%)";
        }

I suspect an interaction with CSS + JS resetting it all. Will look into it.

Continued Development

  • I currently have an error in the console.log related to an invalid DOM selection in regards to changing the colour of the label with the nested radio button, I will continue research and fix this error!

  • Tailwind was something I wanted to use for this challenge, but its been a minute and I Was having an issue setting it up, so, I went with vanilla CSS and I will return to refactor this code.

  • Improve/refactor usage of TS. I did not utilize TS to its full capacity, I was learning with this project alongside the official docs, so, errors and very little optimization, so, optimization and cleaner TS code! Follow best practice, etc.

  • Better invalid submission que -- currently it just logs to the console if someone clicks on the submit button without a rating present, I would like to add a small message "You need to pick a rating before submission"!

interactive-rating-component's People

Contributors

ofthewildfire 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.