svg+css实现立体玻璃质感按钮效果代码
代码语言:html
所属分类:布局界面
代码描述:svg+css实现立体玻璃质感按钮效果代码,鼠标悬浮有走光效果。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
/* Defs */
@property --angle-1 {
syntax: "<angle>";
inherits: false;
initial-value: -75deg;
}
@property --angle-2 {
syntax: "<angle>";
inherits: false;
initial-value: -45deg;
}
:root {
--global--size: clamp(2rem, 4vw, 5rem);
--anim--hover-time: 400ms;
--anim--hover-ease: cubic-bezier(0.25, 1, 0.5, 1);
}
/* Base Styles */
body {
width: 100%;
height: 100vh;
margin: 0;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: var(--global--size);
background-color: rgba(215, 215, 215, 1);
font-family: "Inter", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
overflow: hidden;
}
/* ========== BUTTON ========== */
/* Button Wrap Container */
.button-wrap {
position: relative;
z-index: 2;
border-radius: 999vw;
background: transparent;
pointer-events: none;
transition: all var(--anim--hover-time) var(--anim--hover-ease);
}
/* Button Shadow Container */
.button-shadow {
--shadow-cuttoff-fix: 2em;
position: absolute;
width: calc(100% + var(--shadow-cuttoff-fix));
height: calc(100% + var(--shadow-cuttoff-fix));
top: calc(0% - var(--shadow-cuttoff-fix) / 2);
left: calc(0% - var(--shadow-cuttoff-fix) / 2);
filter: blur(clamp(2px, 0.125em, 12px));
-webkit-filter: blur(clamp(2px, 0.12.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0