├── .gitignore ├── LICENSE ├── README.md ├── design ├── active-states.jpg ├── desktop-design.jpg ├── desktop-preview.jpg ├── desktop-thank-you-state.jpg ├── mobile-design.jpg └── mobile-thank-you-state.jpg ├── images ├── favicon-32x32.png ├── icon-star.svg └── illustration-thank-you.svg ├── index.html ├── script.js ├── style-guide.md └── style.css /.gitignore: -------------------------------------------------------------------------------- 1 | # Avoid accidental upload of the Sketch and Figma design files 2 | ##################################################### 3 | ## Please do not remove lines 5 and 6 - thanks! 🙂 ## 4 | ##################################################### 5 | *.sketch 6 | *.fig 7 | 8 | # Avoid accidental XD upload if you convert the design file 9 | ############################################### 10 | ## Please do not remove line 12 - thanks! 🙂 ## 11 | ############################################### 12 | *.xd 13 | 14 | # Avoid your project being littered with annoying .DS_Store files! 15 | .DS_Store 16 | .prettierignore -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2024, Sarthak Sachdev 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Interactive Rating Component 2 | 3 | ## Welcome! 👋 4 | 5 | ## Table of contents 6 | 7 | - [Overview](#overview) 8 | - [The challenge](#the-challenge) 9 | - [How to setup the project](#how-to-setup-the-project) 10 | - [Screenshot](#screenshot) 11 | - [Links](#links) 12 | - [My process](#my-process) 13 | - [Built with](#built-with) 14 | - [What I learned](#what-i-learned) 15 | - [Continued development](#continued-development) 16 | - [Useful resources](#useful-resources) 17 | - [Author](#author) 18 | - [Acknowledgments](#acknowledgments) 19 | 20 | ## Overview 21 | 22 | ### The challenge 23 | 24 | Gather valuable feedback from your users with our interactive Rating Component! 25 | 26 | This frontend component allows users to- 27 | - View the optimal layout for the app depending on their device's screen size 28 | - See hover states for all interactive elements on the page 29 | - Select and submit a number rating on a scale from 1 to 5 30 | - View a 'Thank you' card state after submitting a rating. 31 | 32 | ### How to setup the project 33 | 34 | To set up the project locally, follow these steps: 35 | 36 | 1. Clone the repository using GitHub Desktop or Git Bash: 37 | ```bash 38 | git clone https://github.com/SartHak-0-Sach/Interactive-rating-component_frontend_project.git 39 | ``` 40 | 2. Open the project folder in your code editor. 41 | 3. Run the project using a live server extension or deploy it using Netlify, Vercel, or another web hosting and deployment service. 42 | 43 | ### Screenshot 44 | 45 |  46 | 47 | ### Links 48 | 49 | - Solution URL: [GitHub Repository](https://github.com/SartHak-0-Sach/Interactive-rating-component_frontend_project) 50 | - Live Site URL: [Live Site](https://rating-component-frontend-app.netlify.app/) 51 | 52 | ## My process 53 | 54 | ### Built with 55 | 56 | - HTML5 57 | - CSS3 58 | - JavaScript 59 | 60 | You will find all the required assets in the `/design` folder. The assets are already optimized. 61 | 62 | There is also a `style-guide.md` file containing the information you'll need, such as color palette and fonts. 63 | 64 | ### What I learned 65 | 66 | This project is a beginner friendly project which can be the first project of many people according to my recommendation due to its simple design and not much complex javaScript knowledge required to implement programming of buttons as shown- 67 | 68 | ```js 69 | buttons.forEach((button) => { 70 | button.addEventListener("click", (e) => { 71 | buttons.forEach((button) => button.classList.remove("list__change")); 72 | e.target.classList.add("list__change"); 73 | value = e.target.textContent; 74 | }); 75 | }); 76 | 77 | submit.addEventListener("click", () => { 78 | rating.textContent = value; 79 | card.style.display = "none"; 80 | success.style.display = "flex"; 81 | }); 82 | ``` 83 | 84 | ### Continued development 85 | 86 | The continuously learning journey of a programmer never ends. This project made me realize that there are many concepts that I need to work upon including fundamentals like flex-box and its properties, to more complex concepts like working with fetch and async await in javascript. These areas are some that I think I need to work more upon in the upcoming future as they highlight some of the most significant regions of web development that are important for every developer to know of. 87 | 88 | These key points mentioned here will help me grow accountable and consistent towards improving at writing good quality code and be a successful full stack developer one day. 89 | 90 | ### Useful resources 91 | 92 | - [Harkirat Singh course notes](https://github.com/SartHak-0-Sach/harkirat-singh-course_code_and_notes) - I have added notes of all lectures along with code and lecture insights of all weeks along with bonus lectures to help you all as much as I can. 93 | - [My development code and notes](https://github.com/SartHak-0-Sach/cwh-web-dev-playlist_code_and_notes) - These are my notes that I made while working on my development skills in initial days and did these courses. Make sure to star the repository if you like it.✨💫 94 | - [MDN documentation hover state for CSS](https://developer.mozilla.org/en-US/docs/Web/CSS/:hover) - This is an amazing article which helped me finally understand hover states. I'd recommend it to anyone still learning this concept. 95 | 96 | ## Author 97 | 98 | Sarthak Sachdev 99 | - Website - [Sarthak Sachdev](https://itsmesarthak.netlify.app/) 100 | - LeetCode - [@sarthak_sachdev](https://leetcode.com/u/sarthak_sachdev/) 101 | - Twitter - [@sarthak_sach69](https://www.twitter.com/sarthak_sach69) 102 | 103 | ## Acknowledgments 104 | 105 | I feel like the solutions provided on the website and the continuous doubt solving by industry experts on discord for free is something that is unmatched by anyone else and need to be acknowledged for their efforts in improving me as a developer by suggesting the best practices in your respective tech stack. 106 | 107 | ## Got feedback for me? 108 | 109 | I love receiving feedback! I am always looking to improve my code and take up new innovative ideas to work upon. So if you have anything you'd like to mention, please email 'hi' at saarsaach30[at]gmail[dot]com. 110 | 111 | If you liked this project make sure to spread the word and share it with all your friends. 112 | 113 | **Happy coding!** ☺️🚀 114 | -------------------------------------------------------------------------------- /design/active-states.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Interactive-rating-component_frontend_project/0cb6e77d314ab69949d946cf27e94891aaf38f75/design/active-states.jpg -------------------------------------------------------------------------------- /design/desktop-design.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Interactive-rating-component_frontend_project/0cb6e77d314ab69949d946cf27e94891aaf38f75/design/desktop-design.jpg -------------------------------------------------------------------------------- /design/desktop-preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Interactive-rating-component_frontend_project/0cb6e77d314ab69949d946cf27e94891aaf38f75/design/desktop-preview.jpg -------------------------------------------------------------------------------- /design/desktop-thank-you-state.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Interactive-rating-component_frontend_project/0cb6e77d314ab69949d946cf27e94891aaf38f75/design/desktop-thank-you-state.jpg -------------------------------------------------------------------------------- /design/mobile-design.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Interactive-rating-component_frontend_project/0cb6e77d314ab69949d946cf27e94891aaf38f75/design/mobile-design.jpg -------------------------------------------------------------------------------- /design/mobile-thank-you-state.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Interactive-rating-component_frontend_project/0cb6e77d314ab69949d946cf27e94891aaf38f75/design/mobile-thank-you-state.jpg -------------------------------------------------------------------------------- /images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Interactive-rating-component_frontend_project/0cb6e77d314ab69949d946cf27e94891aaf38f75/images/favicon-32x32.png -------------------------------------------------------------------------------- /images/icon-star.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/illustration-thank-you.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 13 | 14 | 15 | 16 |37 | Please let us know how we did with your support request. All feedback 38 | is appreciated to help us improve our offering! 39 |
40 |55 | You selected x out of 5 56 |
57 |59 | We appreciate you taking the time to give a rating. If you ever need 60 | more support, don’t hesitate to get in touch! 61 |
62 |