123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- //动画特效
- .container {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- height: 100vh;
- }
- .btn-82,
- .btn-82 *,
- .btn-82 :after,
- .btn-82 :before,
- .btn-82:after,
- .btn-82:before {
- border: 0 solid;
- box-sizing: border-box;
- }
- .btn-82 {
- -webkit-tap-highlight-color: transparent;
- -webkit-appearance: button;
- background-color: darkgreen;
- background-image: none;
- color: pink;
- cursor: pointer;
- font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
- Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif,
- Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
- font-size: 100%;
- font-weight: 900;
- line-height: 1.5;
- margin: 0;
- -webkit-mask-image: -webkit-radial-gradient(#000, #fff);
- padding: 0;
- }
- .btn-82:disabled {
- cursor: default;
- }
- .btn-82:-moz-focusring {
- outline: auto;
- }
- .btn-82 svg {
- display: block;
- vertical-align: middle;
- }
- .btn-82 [hidden] {
- display: none;
- }
- .btn-82 {
- background: none;
- border-radius: 999px;
- box-sizing: border-box;
- display: block;
- overflow: hidden;
- padding: 1.2rem 3rem;
- position: relative;
- text-transform: uppercase;
- }
- .btn-82 span {
- font-weight: 900;
- mix-blend-mode: difference;
- transition: opacity 0.2s;
- }
- .btn-82:hover span {
- -webkit-animation: text-reset 0.2s 0.8s forwards;
- animation: text-reset 0.2s 0.8s forwards;
- opacity: 0;
- }
- .btn-82:after,
- .btn-82:before {
- border: 4px solid #fff;
- border-radius: 999px;
- content: "";
- height: 100%;
- left: 0;
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- transition: height 0.2s;
- width: 100%;
- }
- .btn-82:after {
- background: darkgreen;
- border: none;
- height: 2rem;
- width: 0;
- z-index: -1;
- }
- .btn-82:hover:before {
- -webkit-animation: border-reset 0.2s linear 0.78s forwards;
- animation: border-reset 0.2s linear 0.78s forwards;
- height: 2rem;
- }
- .btn-82:hover:after {
- -webkit-animation: progress-bar 1s;
- animation: progress-bar 1s;
- }
- @-webkit-keyframes progress-bar {
- 0% {
- opacity: 1;
- width: 0;
- }
- 10% {
- opacity: 1;
- width: 15%;
- }
- 25% {
- opacity: 1;
- width: 25%;
- }
- 40% {
- opacity: 1;
- width: 35%;
- }
- 55% {
- opacity: 1;
- width: 75%;
- }
- 60% {
- opacity: 1;
- width: 100%;
- }
- to {
- opacity: 0;
- width: 100%;
- }
- }
- @keyframes progress-bar {
- 0% {
- opacity: 1;
- width: 0;
- }
- 10% {
- opacity: 1;
- width: 15%;
- }
- 25% {
- opacity: 1;
- width: 25%;
- }
- 40% {
- opacity: 1;
- width: 35%;
- }
- 55% {
- opacity: 1;
- width: 75%;
- }
- 60% {
- opacity: 1;
- width: 100%;
- }
- to {
- opacity: 0;
- width: 100%;
- }
- }
- @-webkit-keyframes border-reset {
- 0% {
- height: 2rem !important;
- }
- to {
- height: 100% !important;
- }
- }
- @keyframes border-reset {
- 0% {
- height: 2rem !important;
- }
- to {
- height: 100% !important;
- }
- }
- @-webkit-keyframes text-reset {
- 0% {
- opacity: 0;
- }
- to {
- opacity: 1;
- }
- }
- @keyframes text-reset {
- 0% {
- opacity: 0;
- }
- to {
- opacity: 1;
- }
- }
|