svg实现一个液体按钮效果代码
代码语言:html
所属分类:表单美化
代码描述:svg实现一个液体按钮效果代码,鼠标放上去试试
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
position: relative;
display: grid;
height: 100vh;
place-items: center;
background: #ede9fe;
overflow: hidden;
color: #4c1d95;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
svg {
overflow: visible;
}
.wobble {
position: relative;
width: 256px;
height: 56px;
background: none;
border: none;
color: #f5f3ff;
cursor: pointer;
font-family: "Nunito", sans-serif;
font-weight: 700;
font-size: 1rem;
overflow: visible;
outline: none;
}
.wobble svg {
/* filter: drop-shadow(0px 8px 16px rgba(139, 92, 246, 0.75)); */
overflow: visible;
}
.wobble #btnPath {
stroke: transparent;
stroke-width: 3;
}
.wobble > * {
pointer-events: none !important;
}
.wobble:focus #btnPath {
stroke-width: 3;
stroke: #fcd34d;
}
.wobble svg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
.toggle-points {
}
.blob {
position: absolute;
bottom: -25%;
right: -25%;
width: 50vw;
}
.blob path {
fill: #ddd6fe;
}
..........完整代码请登录后点击上方下载按钮下载查看
















网友评论0