Botão Css – Icone Animado Efeito Tremer
Postado: 1 de dezembro de 2021
Botão Css – Icone Animado Efeito Tremer
Neste tutorial vamos fazer um botão com icone animado feito de tremer quando passamos o mouse.
Vamos Adicionar o Html:
<a href="#" class="btn motion-tremer" title="Saiba mais"> Saiba mais</a>
Vamos Adicionar o Css:
@-webkit-keyframes motion-tremer {
10% {
-webkit-transform: translateX(3px) rotate(2deg);
transform: translateX(3px) rotate(2deg);
}
20% {
-webkit-transform: translateX(-3px) rotate(-2deg);
transform: translateX(-3px) rotate(-2deg);
}
30% {
-webkit-transform: translateX(3px) rotate(2deg);
transform: translateX(3px) rotate(2deg);
}
40% {
-webkit-transform: translateX(-3px) rotate(-2deg);
transform: translateX(-3px) rotate(-2deg);
}
50% {
-webkit-transform: translateX(2px) rotate(1deg);
transform: translateX(2px) rotate(1deg);
}
60% {
-webkit-transform: translateX(-2px) rotate(-1deg);
transform: translateX(-2px) rotate(-1deg);
}
70% {
-webkit-transform: translateX(2px) rotate(1deg);
transform: translateX(2px) rotate(1deg);
}
80% {
-webkit-transform: translateX(-2px) rotate(-1deg);
transform: translateX(-2px) rotate(-1deg);
}
90% {
-webkit-transform: translateX(1px) rotate(0);
transform: translateX(1px) rotate(0);
}
100% {
-webkit-transform: translateX(-1px) rotate(0);
transform: translateX(-1px) rotate(0);
}
}
@keyframes motion-tremer {
10% {
-webkit-transform: translateX(3px) rotate(2deg);
transform: translateX(3px) rotate(2deg);
}
20% {
-webkit-transform: translateX(-3px) rotate(-2deg);
transform: translateX(-3px) rotate(-2deg);
}
30% {
-webkit-transform: translateX(3px) rotate(2deg);
transform: translateX(3px) rotate(2deg);
}
40% {
-webkit-transform: translateX(-3px) rotate(-2deg);
transform: translateX(-3px) rotate(-2deg);
}
50% {
-webkit-transform: translateX(2px) rotate(1deg);
transform: translateX(2px) rotate(1deg);
}
60% {
-webkit-transform: translateX(-2px) rotate(-1deg);
transform: translateX(-2px) rotate(-1deg);
}
70% {
-webkit-transform: translateX(2px) rotate(1deg);
transform: translateX(2px) rotate(1deg);
}
80% {
-webkit-transform: translateX(-2px) rotate(-1deg);
transform: translateX(-2px) rotate(-1deg);
}
90% {
-webkit-transform: translateX(1px) rotate(0);
transform: translateX(1px) rotate(0);
}
100% {
-webkit-transform: translateX(-1px) rotate(0);
transform: translateX(-1px) rotate(0);
}
}
.btn {
padding: 0.7em 1.3em;
cursor: pointer;
background: linear-gradient(90deg, #00EFF4 0%, #4245F4 100%);
text-decoration: none;
font-weight:bold;
font-size:1.1em;
color: #fff;
border-radius:50px;
transition:0.3s;
}
.btn:hover {
background: linear-gradient(90deg, #00CED2 0%, #2023B0 100%);
}
.motion-tremer {
display: inline-block;
vertical-align: middle;
-webkit-transform: translateZ(0);
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
position: relative;
padding-left: 2.6em;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.motion-tremer:before {
content: "\e0ab";
position: absolute;
left: 1em;
padding: 0 1px;
font-family: untitled-font-1;
-webkit-transform: translateZ(0);
transform: translateZ(0);
}
.motion-tremer:hover:before, .motion-tremer:focus:before, .motion-tremer:active:before {
-webkit-animation-name: motion-tremer;
animation-name: motion-tremer;
-webkit-animation-duration: 0.75s;
animation-duration: 0.75s;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-iteration-count: 1;
animation-iteration-count: 1;
}
Veja o Resultado !
Baixar Código
Veja Funcionando
Publicado por: loopnerd
702 Visualizações
Deixe um comentário