rmcg.dev/projects/FrontendMentor/newbie/faq-accordion-card/README.md

85 lines
3.3 KiB
Markdown
Raw Permalink Normal View History

# Frontend Mentor - FAQ Accordion Card
2022-09-16 00:13:03 +02:00
This is a solution to the [FAQ Accordion Card](https://www.frontendmentor.io/challenges/faq-accordion-card-XlyjD0Oam). Frontend Mentor challenges help you improve your coding skills by building realistic projects.
2022-09-16 00:13:03 +02:00
## Table of contents
2022-09-16 00:13:03 +02:00
- [Frontend Mentor - FAQ Accordion Card](#frontend-mentor---faq-accordion-card)
- [Table of contents](#table-of-contents)
- [Overview](#overview)
- [The challenge](#the-challenge)
- [Screenshot](#screenshot)
- [Links](#links)
- [My process](#my-process)
- [Built with](#built-with)
- [What I learned](#what-i-learned)
- [Continued development](#continued-development)
- [Useful resources](#useful-resources)
- [Author](#author)
- [Acknowledgments](#acknowledgments)
2022-09-16 00:13:03 +02:00
## Overview
2022-09-16 00:13:03 +02:00
### The challenge
2022-09-16 00:13:03 +02:00
Users should be able to:
2022-09-16 00:13:03 +02:00
- View the optimal layout for the site depending on their device's screen size
- See hover states for all interactive elements on the page
2022-09-16 00:13:03 +02:00
These are the design references
![Mobile Design](./design/mobile-design.jpg)
![Desktop Design](./design/desktop-design.jpg)
2022-09-16 00:13:03 +02:00
### Screenshot
2022-09-16 00:13:03 +02:00
Screen shots of the finished Mobile & Desktop versions with and without the active state
2022-09-16 00:13:03 +02:00
![Mobile Inactive](./screenshots/mobile-inactive.png)
![Mobile Active](./screenshots/mobile-active.png)
2022-09-16 00:13:03 +02:00
![Desktop Inactive](./screenshots/desktop-inactive.png)
![Desktop Active](./screenshots/desktop-active.png)
2022-09-16 00:13:03 +02:00
### Links
2022-09-16 00:13:03 +02:00
- Solution URL: [Github](https://github.com/tarasis/tarasis.github.io/tree/main/projects/FrontendMentor/newbie/faq-accordion-card)
- Live Site URL: [tarasis.github.io](https://tarasis.github.io/FrontendMentor/newbie/faq-accordion-card/)
2022-09-16 00:13:03 +02:00
## My process
2022-09-16 00:13:03 +02:00
I built out the mobile version first, with the full intention of making it a responsive design that would scale the mobile version till it got to the desktop size and then flip to the desktop version. Unfortunately I couldn't get the placement and scaling to work as I wanted; particularly with regards to the desktop version.
2022-09-16 00:13:03 +02:00
In the end I sought out a someone else's solution to get an idea of how to do the desktop images. This was the first time I had worked with using 3 images layered on top of each other, and I found it difficult.
2022-09-16 00:13:03 +02:00
As I used a disclosure animation I made sure to use `@media (prefers-reduced-motion) {}` to disable the animation for those that need it.
2022-09-16 00:13:03 +02:00
### Built with
2022-09-16 00:13:03 +02:00
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
2022-09-16 00:13:03 +02:00
### What I learned
2022-09-16 00:13:03 +02:00
That I could use Detail / Summary to handle the questions in HTML & CSS rather than use JavaScript.
2022-09-16 00:13:03 +02:00
### Continued development
2022-09-16 00:13:03 +02:00
Need to spend some more time practicing placement of images when there are multiple images that are supposed to be layer.
2022-09-16 00:13:03 +02:00
### Useful resources
2022-09-16 00:13:03 +02:00
- [MDN Detail](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) - Provided how to do the summary and detail without having to use JavaScript.
2022-09-16 00:13:03 +02:00
## Author
2022-09-16 00:13:03 +02:00
- Website - [Blog](https://tarasis.net)
- Website - [Portfolio](https://rmcg.dev)
- Frontend Mentor - [@tarasis](https://www.frontendmentor.io/profile/tarasis)
- Twitter - [@tarasis](https://www.twitter.com/tarasis)
## Acknowledgments
2022-09-16 00:13:03 +02:00
I want to thank Bob Matyas for his [codepen](https://codepen.io/bobmatyas/pen/NWRWVeK?editors=1100), which gave the tip that I needed for handling the placement of the desktop images.