/fem-article-preview-component

Article preview component || Frontend Mentor ๐Ÿฅ‰ NEWBIE...

Primary LanguageSCSS

Article preview component

๐Ÿ”– This is a solution to the Article preview component challenge on Frontend Mentor.

๐ŸŒˆ โœจ ๐ŸŽ‰ Have Fun Building! ๐Ÿš€ ๐ŸŽŠ ๐ŸŽˆ

๐Ÿ–ฅ๏ธ Welcome
Thanks for checking out this front-end coding challenge. Frontend Mentor challenges help you improve your coding skills by building realistic projects. To do this challenge, you need a basic understanding of HTML, CSS and a tiny bit of JavaScript. Press Enter ๐Ÿš€ to start the game!!

๐Ÿฅท Table of Contents

Brief

Practice your layout skills with this article preview component. There's lots of fun to be had playing around with animations for the sharing icons as well.

Your challenge is to build out this article preview component and get it looking as close to the design as possible. You can use any tools you like to help you complete the challenge. So if you've got something you'd like to practice, feel free to give it a go ๐Ÿ‘.

The only JavaScript you'll need for this challenge is to initiate the share options when someone clicks the share icon.

Preview ๐Ÿ‘“

Design preview for the Loopstudios landing page coding challenge

The challenge

Users should be able to:

Challenge Newbie Junior Intermediate Advanced
View the optimal layout for the component depending on their device's screen size โญ•
See the social media share links when they click the share icon โญ•

๐Ÿฌ Newbie Difficulty List

Links

My process

โŒ› I challenge my self to finish this for ~2 days
โ–
๐Ÿง‘โ€๐Ÿ’ป Day 1: Code basic layout with HTML & Sass
โ– Studying the design 0.5 hour
โ– Import style guide 0.5 hour
โ– Start mobile first 2.5 hours
โ–
๐ŸŽ…๐ŸŽ„ Day 2: Christmas holiday
โ– Rewrite mobile first to desktop first ~2.5 hours
โ–
๐Ÿง‘โ€๐Ÿ’ป Day 3: Working with Javascript
โ– Make small change for phone layout ~0.25 hour
โ– Javascript logic for active state ~1.5 hours
โ– CSS clip path ~1 hour
โ–
๐Ÿ—“๏ธ Day 4 onwards: Continue some unfinished task & submit the solution to Frontend Mentor ๐Ÿšฉ
โ–
๐Ÿ—“๏ธ

Built with

What I learned ๐Ÿฅณ

โ˜‘๏ธ CSS object-fit

object-position: left has the same idea of background-position: left

stylesheets/scss/_preview.scss
img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left;
}
โ˜‘๏ธ CSS clip-path

clip-path can show some part of our element by clip-in it

stylesheets/scss/_preview.scss
&--active {
  filter: drop-shadow(0px 10px 5px rgba(0, 0, 0, 0.1));
  clip-path: polygon(
    0% 0%,
    100% 0%,
    100% 75%,
    62% 75%,
    56% 100%,
    49% 75%,
    0% 75%
  );
}

Difficult Things ๐Ÿ˜“

Things were difficult for me and I finally gave up ๐Ÿ˜“๐Ÿ˜“

  • HTML5 Semantic
  • Not know how to work with <svg/>
  • Not figured out how to implement border-radius
  • Not making box-shadow on share links
  • Some DRY CSS code

Author

xvferdy
Berlianto

Acknowledgments