This is a solution to the FAQ accordion card challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Note: Delete this note and update the table of contents based on what sections you keep.
Users should be able to:
- View the optimal layout for the component depending on their device's screen size
- See hover states for all interactive elements on the page
- Hide/Show the answer to a question when the question is clicked
- Solution URL: Check out the code here
- Live Site URL: Visit the live site here
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
This was my first javascript challenge and I did have some problem understanding how to implement the code such that upon click of the arrow it rotates -180deg, however I then decided that it would be smart to select all of the arrow classes and then have indexes and the particular link clicked as a parameter so that no matter which link the user clicks the function will be called to add the active and rotate classes to the link. However once you click a link then the other links that were previously clicked will have the active and rotate classes removed.
I am a bit unfamiliar with javascript syntax hence I plan to complete more projects on Frontend Mentor involving javascript and in addition to attempt an online javascript course to better understand the syntax.
-
CSS Tricks - CSS Grid - This helped me with the flexbox concept and I am really glad to be recommend this article, will use it going forward.
-
MDN CSS Reference - This is the guide to all the css properties with an indept explanation. Definitely recommend it.
- Frontend Mentor - @TheCoderGuru
- Twitter - @TheCoderGuru