js+svg实现按钮点击不松手发布进度动画效果代码
代码语言:html
所属分类:表单美化
代码描述:js+svg实现按钮点击不松手发布进度动画效果代码
代码标签: js svg 按钮 点击 不松手 发布 进度 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Roboto:400,500,700&display=swap'>
<style>
.button-hold {
--color: #F6F8FF;
--background: #2B3044;
--icon: var(--color);
--progress-border: #646B8C;
--progress-active: #fff;
--progress-success: #5C86FF;
--tick-stroke: var(--progress-active);
--shadow: rgba(0, 9, 61, 0.2);
font-size: 16px;
font-weight: 500;
line-height: 19px;
min-width: 112px;
padding: 12px 20px 12px 12px;
border: 0;
border-radius: 24px;
outline: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
cursor: pointer;
-webkit-backface-visibility: hidden;
-webkit-appearance: none;
transition: transform 0.3s, box-shadow 0.3s;
box-shadow: 0 var(--shadow-y, 4px) var(--shadow-blur, 12px) var(--shadow);
transform: scale(var(--scale, 1)) translateZ(0);
color: var(--color);
background: var(--background);
}
.button-hold > div {
margin-right: 4px;
border-radius: 50%;
display: inline-block;
vertical-align: top;
position: relative;
background: var(--progress-border);
}
.button-hold > div:before {
content: "";
width: 16px;
height: 16px;
left: 2px;
top: 2px;
z-index: 1;
position: absolute;
background: var(--background);
border-radius: inherit;
transform: scale(var(--background-scale, 1));
transition: transform 0.32s ease;
}
.button-hold > div svg {
display: block;
}
.button-hold > div svg.icon, .button-hold > div svg.tick {
position: absolute;
}
.button-hold > div svg.icon {
width: 8px;
height: 8px;
left: 6px;
top: 6px;
fill: var(--icon);
z-index: 1;
transition: opacity 0.2s, transform 0.2s;
opacity: var(--icon-opacity, 1);
transform: translateY(var(--icon-y, 0)) scale(var(--icon-scale, 1));
}
.button-hold > div svg.progress, .button-hold > div svg.tick {
fill: none;
}
.button-ho.........完整代码请登录后点击上方下载按钮下载查看
网友评论0