5
On Android and on design system Material Design is common to see this button they call Ripple Buttom. https://material-components.github.io/material-components-web-catalog/#/Component/ripple
But it is done with JS and my intention is to do it only with CSS. It would be possible to make an effect of this type only with CSS?
Notice that when btn is clicked this "ripple Effect"...
OBS: Don’t need the effect to happen where the click was made, it can always happen from the center of the button out. So I believe it is possible to do it only with CSS in this case.
That’s what I got so far:
.btn {
width: 200px;
height: 160px;
margin: auto;
background-color: #eee;
box-shadow: 0 0 3px 0 rgba(0, 0, 0, .5);
display: flex;
justify-content: center;
align-items: center;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
cursor: pointer;
transition: all 200ms linear;
}
.btn:hover {
background-color: #ddd;
}
<div class="btn">Meu Ripple</div>
hugocsl Take a look at this codepen, I think it answers your question. It’s pretty simple. Anything we can get into more detail! https://codepen.io/finnhvman/pen/jLXKJw An Embrace!
– Rodrigo Daoud