This is a solution to the Crowdfunding product page challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout depending on their device's screen size
- See hover states for interactive elements
- Make a selection of which pledge to make
- See an updated progress bar and total money raised based on their pledge total after confirming a pledge
- See the number of total backers increment by one after confirming a pledge
- Toggle whether or not the product is bookmarked
- Semantic HTML5 markup
- CSS
- Javascript
- Mobile-first workflow
- Design from Figma
I learned how to create a modal and dim the entire page background. The trick is not to use opacity but to use rgba for background and make sure that the modal is positioned absolute and the dimmed background is a div which is positioned fixed. This div should be not be a child of any other element.
I also learned how to use the scrollIntoView method which scrolls to the element you want. This is usefel when you have a long webpage and click events across the page pop up the modal. Instead of the user scrolling to find the modal, they will automatically be taken to it. See below:
function scrollToModal(modal) {
modal.scrollIntoView();
}
- YouTube - Custom radio button
- CSS Tricks - How to change color of svg image.
- YouTube - transparent background for popup modal.
- Stack Overflow - how to scroll to an element using Javascript.
- Frontend Mentor - @jkellerman
- GitHub - jkellerman