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

Responsive data analytcs card landing page (also mobile)

Caio Rosa 20

@caio-rosa

Desktop design screenshot for the Stats preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I couldn't apply the purple filter to the image. If somebody else knows how to do it, please give me a feedback.

Community feedback

ROCKY BARUA 1,090

@Drougnov

Posted

Hi @caio-rosa, good job on the challenge.

To achieve the purple filter on the image, you can use pseudo-code(after or before) on the container. At first use position relative to the container.:

.container {
  position: relative;
  z-index: 0;
  overflow: hidden;
}

And add after to the container like this:

.container::after {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  background: hsla(277, 64%, 40%, 0.6);
  top: 0;
  left: 0;
}

this should do the trick.

You might wanna work on the accessibility and responsiveness(mobile devices). For further help feel free to comment or view my solution

Anyway, keep up the good work and have a good day : )

Marked as helpful

0

Caio Rosa 20

@caio-rosa

Posted

@Drougnov

Hey, thank you! i didn't know 'after' and 'before' it really helped!

1
Hyron 5,870

@hyrongennike

Posted

HI @caio-rosa,

** Nice job on the challgenge** Just a few things on mobile remove the display:none on the image on mobile and add the following:

.mainBox {
    flex-direction: column-reverse;
    margin-top: 5rem;
}

this is stack the image on top of the text and the below will the stack the stats.

.stats {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
}

Hope this is helpful

Marked as helpful

0

Caio Rosa 20

@caio-rosa

Posted

@hyrongennike

Hi bro, thank you! I really appreciated your design idea. I did what you said and added border radius at the top of the image and removed the border radius at the bottom.

0
Lucas 👾 104,560

@correlucas

Posted

Oi Caio, respondendo sua pergunta:

O jeito de fazer o efeito de sobreposição é feito de dois modos, ou você pode usar, filter, background-blend-mode ou mix-blend-mode: multiply; (a melhor escolha na minha opinião). Veja o código abaixo ```

img {
mix-blend-mode: multiply;
opacity: 0.8;}

Aqui a documentação explicando esse efeito mix-blend-mode: https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode

Depois me fala se funcionou

Marked as helpful

0

Caio Rosa 20

@caio-rosa

Posted

@correlucas

Fala Lucas, tudo bem?

Cara, eu dei uma olhada na documentação e não consegui achar exatamente uma forma de alterar a cor do filtro que aplico livremente, pude ver diversos tipos de filtro bem parecidos com o parâmetro 'filter' mas não encontrei nada sobre aplicar uma cor específica, nesse caso seria um tom roxo. Alguma dica?

1
Lucas 👾 104,560

@correlucas

Posted

@caio-rosa Acabei de olhar aqui e ficou falando a cor do fundo da div pra fazer o blend da imagem com a cor:

.container {
    background-color: #ef61ef;
}
.img {
    mix-blend-mode: multiply;
    width: 100%;
    height: 100%;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

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