css的clip path实现按钮点击动画效果代码

代码语言:html

所属分类:布局界面

代码描述:css的clip path实现按钮点击动画效果代码,现代浏览器支持。

代码标签: css clip path 按钮 点击 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  

  
  
  
<style>
@import url("https://fonts.googleapis.com/css2?family=PT+Mono&family=Poppins:wght@400;600&display=swap");
body {
  background-color: #20232e;
  color: #a1b1e6;
  font-family: "Poppins", sans-serif;
  font-weight: 400;
}

h1,
h2 {
  font-weight: 600;
}
h1 span,
h2 span {
  color: #fcba03;
  font-family: "PT Mono", monospace;
}

.container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
}

.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.box {
  background-color: #2e3342;
  border: 1px solid #444b61;
  border-radius: 6px;
  margin: 10px;
  padding: 10px 30px;
}

button {
  align-items: center;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-family: "Poppins", sans-serif;
  font-size: 18px;
  height: 44px;
  margin: 15px 0;
  padding: 0 25px;
  position: relative;
  text-decoration: none;
  z-index: 1;
}
button:before, button:after {
  border-radius: 50px;
  content: "";
  display: block;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  transition: -webkit-clip-path 275ms ease-in-out;
  transition: clip-path 275ms ease-in-out;
  transition: clip-path 275ms ease-in-out, -webkit-clip-path 275ms ease-in-out;
}
button.dramatic:before, button.dramatic:after {
  transition.........完整代码请登录后点击上方下载按钮下载查看

网友评论0