This is a solution to the Article preview component challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- 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
- Solution URL: https://github.com/seekinfox/Article-preview-cpmponent
- Live Site URL: https://seekinfox.github.io/Article-preview-cpmponent/
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Mobile-first workflow -javaScript
applying little bit of javaScript to make a card more interactive is fun thing to learn. In this exercise i learned how to add event triggers and toggle classes. i used these two function to get the click event and the share-popup section.
function myFunction() {
var popup = document.getElementById("myPopup");
popup.classList.toggle("visible");
}
const color = document.querySelectorAll(".share");
color.forEach(color => {
color.addEventListener("click", ()=>{
color.classList.toggle("color");
});
});
}
redoing javaScript basics.
- Frontend Mentor - @seekinfox