css实现三维玻璃弹珠球滚动动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现三维玻璃弹珠球滚动动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
html,
body {
height: 100%;
height: 100vh;
}
html {
font-size: 10px;
font-size: 0.8vw;
}
body {
margin: 0;
padding: 0;
background: #f9f9f9;
background: linear-gradient(0deg, #f9f9f9 0%, #9d9d9d 60%, gray 100%);
}
#area div {
transform-style: preserve-3d;
}
#area {
perspective-origin: 50% -50%;
perspective: 500px;
width: 100%;
height: 100%;
background-size: cover;
display: grid;
place-items: center;
}
.ball {
position: relative;
border-radius: 50%;
width: 10rem;
height: 10rem;
background: transparent;
backdrop-filter: blur(3px);
-webkit-backdrop-filter: blur(3px);
}
.ball::before,
.ball::after {
content: "";
border-radius: 50%;
position: absolute;
}
.ball::before {
z-index: 100;
width: 10rem;
height: 10rem;
mix-blend-mode: screen;
background: radial-gradient(circle at 10rem 2rem, #fff, #fff0 50%);
background-size: 200%;
background-position: 75%;
}
.ball::after {
z-index: 101;
width: 10rem;
height: 10rem;
mix-blend-mode: darken;
background: radial-gradient(circle at 5rem 3.3rem, #23acc400, #23acc4aa);
}
.ball::oldafter {
z-index: 101;
top: 2%;
left: 5%;
width: 90%;
height: 90%;
background: radial-gradient(circle at 50% 0px, #ffffff, rgba(255, 255, 255, 0) 58%);
}
.ball .inner {
width: 10rem;
height: 10rem;
border-radius: 50%;
position: absolute;
transform-style: preserve-3d;
}
.ball {
animation: roll 10s ease-in-out alternate infinite;
}
.ball .inner {
animation: inner-roll 10s ease-in-out alternate infinite;
}
.ball::before {
animation: shine-move 10s ease-in-out alternate infinite;
}
.ball .shadow {
animation: shadow-move 10s ease-in-out alternate infinite;
}
.ball .reflection {
animation: shadow-move 10s ease-in-out alternate infinite;
}
.ball .shadow::after {
animation: shadowAfter-move 10s ease-in-out alte.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0