css+svg实现自带加载进度条的下载按钮动画效果代码
代码语言:html
所属分类:表单美化
代码描述:css+svg实现自带加载进度条的下载按钮动画效果代码
代码标签: css svg 自带 加载 进度条 下载 按钮 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum=1.0,minimum=1.0,user-scalable=0" /> <style> body{ margin: 100px; background: black; } * { padding: 0; margin: 0; box-sizing: border-box; } button { font-family: inherit; } .container { padding: 0; margin: 0; box-sizing: border-box; font-family: Arial, Helvetica, sans-serif; display: flex; justify-content: center; align-items: center; } .label { background-color: transparent; border: 2px solid rgb(91, 91, 240); display: flex; align-items: center; border-radius: 50px; width: 150px; cursor: pointer; transition: all 0.4s ease; padding: 5px; position: relative; } .label::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; right: 0; background-color: #fff; width: 8px; height: 8px; transition: all 0.4s ease; border-radius: 100%; margin: auto; opacity: 0; visibility: hidden; } .label .input { display: none; } .label .title { font-size: 17px; color: #fff; transition: all 0.4s ease; position: absolute; right: 15px; bottom: 14px; text-align: center; } .label .title:last-child { opacity: 0; visibility: hidden; } .label .circle { height: 45px; width: 45px; border-radius: 50%; background-color: rgb(91, 91, 240); display: flex; justify-content: center; align-items: center; transition: all 0.4s ease; position: relative; box-shadow: 0 0 0 0 rgb(255, 255, 255); overflow: hidden; } .label .circle .icon { color: #fff; width: 30px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); transition: all 0.4s ease; } .label .circle .square { aspect-ratio: 1; width: 15px; border-radius: 2px; background-color: #fff; opacity: 0; visibility: hidden; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); transition: all 0.4s ease; } .label .circle::before { content: ""; position: absolute; left: 0; top: 0; background-color: #3333a8; width: 100%; height: 0; transition: all 0.4s ease; } .label:has(.input:checked) { width: 57px; animation: installed 0.4s ease 3.5s forwards; } .label:has(.input:checked)::before { animation: rotate 3s ease-in-out 0.4s forwards; }.........完整代码请登录后点击上方下载按钮下载查看
网友评论0