Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Article Preview Component (Vanilla CSS, no JS, Custom Hover States)

Lucas 👾 104,420

@correlucas

Desktop design screenshot for the Article preview component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


👾 Hello, Frontend Mentor coding community. This is my solution for the Article Preview Component.

How can I fix this accessibility error?

"Form elements must have labels Context: <input type="checkbox" name="share" id="share__icon">"

What I've found harder to apply on this project, was the social media popup, once I didn`t know JavaScript yet I struggled to apply the same effect using only Html + Css and I achieved the same result for the popup on the desktop version, in the mobile version I don't have any clue how to reach the same result (on/off) to show the social media icon popup and shut off the author name section when one is active and the other dont.

If you've any tip how can I achieve it entirely with Html + Css, you're welcome.

In some months I'll try this challenge again and apply the changes using Javascript.

Thank you!

Community feedback

Adriano 34,090

@AdrianoEscarabote

Posted

Salve lucas! tudo bem? Muito top este desafio man, quero fazer ele em breve!

Vou te falar como podemos fazer este popup com js, mas primeiro vou te dar uma dica sobre o layout.

Observei que em resoluções maiores, as duas divs author--mobile e modal--mobile estão aparecendo, podemos corrigir isso com o nosso amigo media-query acompanhado pelo display: none;

@media (max-width: 4000px) {
  .share__icon__popup,
  .modal--mobile,
  .author--mobile {
    display: none;
  }
}

Podemos usar um addEventListener no icon que quando receber o click chamará a lista que conter ativo no nosso css, e com essa lista teremos os posicionamento necessário para o conteudo aparecer, e quando essa lista estiver desativada o conteúdo tera o posicionamento da lista que não tem ativo no css.

Por exemplo:

.social-links { display: none; posicionamentos...... }

.social-links.ativo { display: flex; }

let botaoIcon = document.getElementById('share__icon')
let showLinks = document.querySelector('.social-links');

botaoIcon.addEventListener('click', function () {
    showLinks.parentElement.classList.toggle('ativo');
})

Ainda ta difícil explicar js, mas espero que tenha pegado a ideia, que é bem semelhante ao modo que você fez o qr-code-dark, mas o que ira mudar não será cores, e sim posicionamento e display.

Espero que ajude! 👍

Marked as helpful

0

Lucas 👾 104,420

@correlucas

Posted

@AdrianoEscarabote Vou ver aqui, valeu

1

@Moamen31

Posted

Hello, Lucas. congrats on finishing the challenge. I have some tips for the mobile version:

  • I see that you made another div for the author for mobile, however you do not need that, you can show the popup on the author div with position absolute and z-index. And don't forget to give the parent element position relative.
  • Also give the button position relative and z-index:2; to make it appear on the popup

Marked as helpful

0

Please log in to post a comment

Log in with GitHub
Discord logo

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