html 点击旋转,CSS3 按钮触摸(点击)脉冲+环形旋转动效

CSS

语言:

CSSSCSS

确定

body {

background-color: #444;

color: #bbb;

}

button {

font-size: 300%;

outline: none;

}

fieldset {

text-align: center;

}

.custom-button {

position: relative;

margin: 0.25em 0.25em;

padding: 0;

border: none;

border-radius: 50%;

background: none;

transition: color 0.7s;

text-align: center;

overflow: visible;

width: 1.75em;

height: 1.75em;

}

.custom-button .custom-button__icon {

width: auto;

}

.custom-button__icon {

display: block;

}

.custom-button__text {

position: absolute;

opacity: 0;

pointer-events: none;

}

.custom-button::before {

content: '';

position: absolute;

top: 0;

left: 0;

width: inherit;

height: inherit;

margin: 0;

border-radius: inherit;

opacity: 0;

pointer-events: none;

background-color: blue;

}

.custom-button--effect-yaya .custom-button__icon {

text-shadow: 0 0 0.1em rgba(0, 0, 0, 0.2);

transition: text-shadow 0.3s;

}

.custom-button--effect-yaya:focus .custom-button__icon {

text-shadow: -2px -2px 0 rgba(0, 0, 0, 0.2);

}

.custom-button--effect-yaya {

color: #286aab;

}

.custom-button--effect-yaya:hover {

color: #3c8ddc;

}

.custom-button--effect-yaya:hover:focus {

transition: none;

color: #3c8ddc;

animation: effect-yaya__anim-push 1s linear;

}

@keyframes effect-yaya__anim-push {

from {

color: #286aab;

}

}

.custom-button--effect-yaya:focus {

color: #286aab;

animation: effect-yaya__anim-colorVariations 5s 1s ease-in-out infinite;

}

@keyframes effect-yaya__anim-colorVariations {

50% {

color: #3c8ddc;

}

}

.custom-button--effect-yaya::before {

background: rgba(111, 148, 182, 0.1);

}

.custom-button--effect-yaya:focus::before {

animation: effect-yaya__anim-drip 0.3s forwards;

}

@keyframes effect-yaya__anim-drip {

0% {

transform: scale3d(1, 1, 1);

}

25%,

50% {

opacity: 1;

}

50% {

transform: scale3d(2, 2, 1);

}

100% {

opacity: 0.5;

transform: scale3d(1, 1, 1);

}

}

.custom-button--effect-yaya {

width: 1.35em;

height: 1.35em;

}

.custom-button--effect-yaya::before {

top: -0.2em;

left: -0.2em;

width: calc(100% + .4em);

height: calc(100% + .4em);

}

.custom-button--effect-yaya {

box-shadow: 0 0 0 transparent, 0 0 0 0.2em transparent;

}

.custom-button--effect-yaya:focus {

box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2), 0 0 0 0.2em rgba(0, 0, 0, 0.2);

}

.custom-button--effect-yaya::before {

box-shadow: inset 0 0 0 transparent;

transition: box-shadow 0.3s 0.3s, backgound-color 0.3s 0.15s, border 0.3s 0.3s;

}

.custom-button--effect-yaya:focus::before {

box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.2);

}

.custom-button--effect-yaya::after {

content: "";

position: absolute;

color: inherit;

width: 0.2em;

height: 0.2em;

margin-left: -0.1em;

bottom: -0.2em;

opacity: 0;

transition: opacity 0.7s;

transform-origin: 0.1em -0.675em;

background-color: #286aab;

transform: rotateZ(0deg);

animation-name: effect-yaya__anim-spin;

animation-duration: 1s;

animation-iteration-count: infinite;

animation-timing-function: linear;

animation-play-state: paused;

}

@keyframes effect-yaya__anim-spin {

25% {

background-color: #3c8ddc;

}

50% {

background-color: #286aab;

transform: rotateZ(180deg);

}

75% {

background-color: #3c8ddc;

}

100% {

background-color: #286aab;

transform: rotateZ(360deg);

}

}

.custom-button--effect-yaya:focus::after {

opacity: 1;

animation-play-state: running;

}

.custom-button--effect-yaya.button-backward::after,

.custom-button--effect-yaya.button-forward::after {

animation-duration: 0.5s;

}

.custom-button--effect-yaya.button-backward::after {

animation-direction: reverse;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值