css+js实现跟随鼠标移动的摇摆铃健身器材动画效果代码
代码语言:html
所属分类:动画
代码描述:css+js实现跟随鼠标移动的摇摆铃健身器材动画效果代码
代码标签: css js 跟随 鼠标 移动 摇摆铃 健身 器材
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
body {
min-height: 100vh;
display: grid;
place-items: center;
overflow: hidden;
background:
linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
background-size: 400% 400%;
background-position: 0 50%;
animation: gradient 15s ease infinite;
cursor: grab;
}
@keyframes gradient {
50% {
background-position: 100% 50%;
}
}
#shake_weight {
width: clamp(300px, 50%, 600px);
aspect-ratio: 4 / 1;
position: relative;
perspective: 600px;
}
#shake_weight * {
transition: .05s;
user-select: none;
}
.end {
width: 20%;
height: 130%;
position: absolute;
left: -12.5%;
top: -15%;
border-radius: 20%;
}
.end.right {
left: 92%;
transform: scaleX(-1);
}
.end:before {
content:'';
width: 110%;
height: 150%;
background:
linear-gradient(to bottom, rgba(0,0,0,.15) 0% 5%, transparent 15% 45%, rgba(0,0,0,.15) 55% 85%, transparent 95%),
silver;
position: absolute;
left: -100%;
top: -25%;
border-radius: 35% 0 0 35%;
z-index: -1;
}
.end:after {
content:'';
width: 50%;
height: 150%;
background:
radial-gradient(at 60% 50%, #000 55%, transparent 60%),
lightgray;
position: absolute;
left: -15%;
top: -25%;
border-radius: 50%;
transform: rotateY(-10deg);
z-index: -1;
}
.spring {
width: 20%;
height: 130%;
background:
radial-gradient.........完整代码请登录后点击上方下载按钮下载查看
网友评论0