svg+css实现高科技铃声按钮悬浮点击动画效果代码
代码语言:html
所属分类:动画
代码描述:svg+css实现高科技铃声按钮悬浮点击动画效果代码
代码标签: svg css 高科技 铃声 按钮 悬浮 点击 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Architects+Daughter&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap" rel="stylesheet">
<style>
* {
box-sizing: border-box;
}
body,
html {
overflow: hidden;
}
body {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100vw;
height: 100vh;
margin: 0;
background: black;
color: #ccc;
}
button {
position: relative;
width: 100px;
height: 100px;
background-image: linear-gradient(
120deg,
#7afffb,
#79fcff,
#75eaff,
#6eccff,
#67a4ff,
#5f73ff,
#7156ff,
#9b4eff,
#c547ff,
#e940ff,
#ff3cfc,
#ff3bf2
);
background-position: top left;
background-size: 100%;
box-shadow: 0px 0px 400px rgba(255, 59, 242, 1),
0px 0px 200px rgba(255, 59, 242, 0.75), 0px 0px 100px rgba(255, 59, 242, 0.5),
0px 0px 50px rgba(255, 59, 242, 0.35), 0px 0px 25px rgba(255, 59, 242, 0.2);
border-radius: 100%;
border: none;
margin: 0;
padding: 15px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s ease;
}
button:hover {
box-shadow: 0px 0px 400px rgba(122, 255, 251, 1),
0px 0px 200px rgba(122, 255, 251, 0.75),
0px 0px 100px rgba(122, 255, 251, 0.5), 0px 0px 50px rgba(122, 255, 251, 0.35),
0px 0px 25px rgba(122, 255, 251, 0.2);
padding: 20px;
background-size: 180%;
transition: all 0.3s ease;
}
button:active {
transform: scale(0.9);
transition: all 0.05s ease;
}
button::before {
position: absolute;
width: calc(100% + 20px);
height: calc(100% + 20px);
border: 1px solid rgba(255, 59, 242, 0.8);
border-radius: 100%;
pointer-events: none;
content: "";
transition: all 0.3s ease;
}
button:hover::before {
border: 1px solid rgba(122, 255, 251, 0.6);
width: calc(100% + 40px);
height: calc(100% + 40px);
transition: all 0.3s ease;
}
button:active::before {
width: calc(100% + 20px);
height: calc(100% + 20px);
transition: all 0.07s ease;
}
button::after {
position: absolute;
width: calc(100% + 40px);
height: calc(100% + 40px);
border: 2px dashed rgba(255, 59, 242, 0.4);
box-shadow: 0px 0px 100px rgba(122, 255, 251, 0.1);
border-radius: 100%;
pointer-events: none;
animation: rotate 30s linear infinite;
content: "";
transition: all 0.3s ease;
}
@keyframes rotate {
to {
transform: rotateZ(-360deg);
}
}
button:hover::after {
border: 2px dashed rgba(122, 255, 251, 0.3);
width: calc(100% + 80px);
height: calc(100% + 80px);
transition: all 0.3s ease;
}
button:active::after {
width: calc(100% + 40px);
height: calc(100% + 40px);
transition: all 0.07s ease;
}
button > svg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2;
mix-blend-mode: overlay;
transition: all 0.3s ease;
z-index: 1;
}
button i {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
button i svg {
position: relative;
width: 100%;
height: auto;
filter: drop-shadow(0px 0px 5px white);
mix-blend-mode: overlay;
}
button:hover i svg {
animation: shake 0.5s linear infinite;
}
@keyframes shake {
0% {
transform: rotate(0deg);
}
25% {
transform: rotate(15deg);
}
75% {
transform: rotate(-15deg);
}
}
button span {
position: absolute;
top: -7px;
right: -11px;
width: 40px;
height: 40px;
border-radius: 100%;
background-color: rgba(0, 0, 0, 0.3);
backdrop-filter: blur(5px);
color: white;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
z-in.........完整代码请登录后点击上方下载按钮下载查看
网友评论0