css实现酷炫的鼠标滑过按钮动画特效

AI 概述
css 实现酷炫的鼠标滑过按钮动画特效,通过鼠标悬停各种 ui 动画特效。 HTML 代码: <div class="container"> <div class="button-wrapper"> <div class="button"> <span class="text">Not really clickable</span> </div> </div> <div class=...

css 实现酷炫的鼠标滑过按钮动画特效,通过鼠标悬停各种 ui 动画特效。

css 实现酷炫的鼠标滑过按钮动画特效

HTML 代码:

<div class="container">
  <div class="button-wrapper">
    <div class="button">
      <span class="text">Not really clickable</span>
    </div>
  </div>
  <div class="button-wrapper">
    <div class="button">
      <span class="text">Hover me</span>
    </div>
  </div>
  <div class="button-wrapper">
    <div class="button">
      <span class="text">And Me</span>
    </div>
  </div>
</div>

SCSS 代码:

body {
  background-color: #555555;
}

$colors: #FF8B94, #02A7E1, #98CB4A, #AE5A41, #F7D842;

@for $i from 1 through length($colors) {
	.container .button-wrapper:nth-child(#{length($colors)}n+#{$i}) div:before {
		border-color: nth($colors, $i);
	} 
  .container .button-wrapper:nth-child(#{length($colors)}n+#{$i}) div {
		border-color: nth($colors, $i);
	} 
}

.container {  
  z-index: 99;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0;
  flex-wrap: wrap;
  
  .button-wrapper {
    overflow:hidden;  
    .button {
    position:relative;
    text-transform: uppercase;
    color: #fff;
    border: solid 2px #02A7E1;
    padding: 10px 30px;
    z-index:1;
    &::before {
      position:absolute;
      border-bottom: solid 3px;
      content:'';
      min-height: 10px;
      min-width: 100px;
      z-index:200;
      left: 50%;
      transform: translateX(-50%);
      top: 60%;
      opacity:1;
      transition-duration:0.5s;
      
    }
    &::after {
      pointer-events: none;
      position:absolute;
      content:'';
      width: 600px;
      height: 160px;
      border-radius:50%;
      background-color: #555555;
      //background-color: red;
      
      //border: solid 2px red;
      top:-120%;
      left:-30%; 
      z-index: -10;
      //transform: rotate(30deg);
      transition-duration: 2s;
    }
    &:hover:after {
      width:0;
      height:50px;
    }
    &:hover:before {
      opacity:0;
    }
  }
  }
}

以上关于css实现酷炫的鼠标滑过按钮动画特效的文章就介绍到这了,更多相关内容请搜索码云笔记以前的文章或继续浏览下面的相关文章,希望大家以后多多支持码云笔记。

「点点赞赏,手留余香」

1

给作者打赏,鼓励TA抓紧创作!

微信微信 支付宝支付宝

还没有人赞赏,快来当第一个赞赏的人吧!

声明:本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若内容造成侵权/违法违规/事实不符,请将相关资料发送至 admin@mybj123.com 进行投诉反馈,一经查实,立即处理!
重要:如软件存在付费、会员、充值等,均属软件开发者或所属公司行为,与本站无关,网友需自行判断
码云笔记 » css实现酷炫的鼠标滑过按钮动画特效

发表回复