Skip to content

This repository is for the 'FAQ Accordion Card' challenge on frontendmentor.io - Faq accordion

Notifications You must be signed in to change notification settings

mdanieladla/faq-accordion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - FAQ accordion card solution

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.

Table of contents

Note: Delete this note and update the table of contents based on what sections you keep.

Overview

The challenge

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

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • CSS Grid
  • Mobile-first workflow
  • JavaScript (ES6)

What I learned

I have reinforced my knowledge in CSS and javascript.

To see how you can add code snippets, see below:

<h1>
  Some HTML code I'm proud of because it has been a little difficult for me:
</h1>
function handleClick(ev) {
  let clicked = ev.currentTarget;
  const click = clicked.parentNode;
  for (let index = 0; index < iconRotate.length; index++) {
    if (clicked === iconRotate[index]) {
      questionBlock[index].classList.toggle('hidden');
      iconRotate[index].classList.toggle('icon-end');
      questions[index].classList.toggle('bold');
    }
  }
}

for (const item of iconRotate) {
  item.addEventListener('click', handleClick);
}

Continued development

Use this section to outline areas that you want to continue focusing on in future projects. These could be concepts you're still not completely comfortable with or techniques you found useful that you want to refine and perfect.

  • Javascript (ES6)
  • CSS

Author

About

This repository is for the 'FAQ Accordion Card' challenge on frontendmentor.io - Faq accordion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published