Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 4 months ago

Article Preview Component using HTML/SCSS and JS

bem, sass/scss, vite
Adesh Katiya•420
@adeysh
A solution to the Article preview component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

Proud of implementing the project very close to the designs.

I would try to create it faster since now it's becoming kind of easy for me to make layouts

What challenges did you encounter, and how did you overcome them?
  • The project was about the intro to JS and was just the javascript action for the popup that appears on click of the share button. I was able to do that also looking out for accessiblity for keyboard users.

  • The main challenge was rather some other things:

  • I had problems with changing particular colors for the svg used but was able to find some answers.

  • Also I thought that a cropped version of image used in card image for the mobile styles were not provided so rather I cropped it myself for the sake of just having another image 😂 After looking at other solutions I found out that I just had the style the image that was already provided using object css properties to position it correctly but then I just let it be because it was looking ok.

  • I had problems with positioning the share button popup that was supposed to be a popover element outside the card. After looking at some solutions I found that It is easy to just create a container outside your card and then you can use it to place it anywhere according to your design.

What specific areas of your project would you like help with?
  • One thing I was confused with was about adding a transition to an element when a class is removed from it. I actually added a simple transition effect when I was adding an --active class over the button click and then styled the popup. I wanted to remove the popup with the same transition effect when I removed the class on another button click but it was not working.
  • After searching some solutions on stack overflow I found that for this with removing a class I will have to add another class like hidden and apply transition effect with that or I can just listen to transitionend event in my js and add a transition effect there. I was not able to achieve it in my code though.
  • So if you guys follow with any suggestion about how to do it in simple way. Please provide me 😅
Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

  • Vanessa•160
    @petrihcour
    Posted 4 months ago

    The design for desktop is really close. Great job. I like the transition effects you added.

    I'd keep an eye out on the responsiveness for the tablet version. The tablet version on the site looks like a giant version of the mobile, but should be a smaller version of the desktop.

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub