div+css实现电影沙丘中唤醒沙虫的沙锤动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现电影沙丘中唤醒沙虫的沙锤动画效果代码
代码标签: div css 电影 沙丘 唤醒 沙虫 沙锤 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
:root {
--thumper-base: #2a3333;
--thumper-shadow-a: #141414a0;
--thumper-shadow: #151515;
--thumper-highlight: #5f605b80;
--thumper-dark: #0e0e0e;
--sand-light: #f5965e;
--sand-dark: #a75a4b;
}
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
.center-cols {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.center-rows {
display: flex;
justify-content: center;
align-items: center;
}
main {
position: relative;
overflow: hidden;
height: 100vh;
width: 100vw;
background: linear-gradient(#c1f4ff 1%, #eed2b1 30%);
}
.dune {
position: absolute;
background: linear-gradient(
90deg,
var(--sand-light) 30%,
var(--sand-dark) 100%
);
border-radius: 100%;
box-shadow: inset 10px 10px 50px rgba(0, 0, 0, 0.1);
width: 2100px;
}
.dune1 {
aspect-ratio: 2;
scale: 1;
translate: 200px 628px;
rotate: -5deg;
}
.dune2 {
aspect-ratio: 2;
translate: -300px 400px;
scale: 0.6;
rotate: 8deg;
}
.dune3 {
aspect-ratio: 1.8;
translate: -300px 230px;
scale: 0.6;
rotate: 0deg;
}
.dune4 {
aspect-ratio: 1.2;
translate: -800px 100px;
scale: 0.4;
rotate: 10deg;
}
.dune5 {
aspect-ratio: 2;
translate: 300px 100px;
scale: 0.6;
}
.thumper {
position: absolute;
scale: 0.7;
transform: translate(-200px, -210px);
.head {
position: absolute;
animation: thump 1.8s infinite ease-in-out;
.tip {
position: absolute;
width: 114px;
height: 70px;
background-color: var(--thumper-base);
border-radius: 100%;
.end {
position: absolute;
height: 10px;
width: 30px;
border-radius: 100%;
background-color: var(--thumper-base);
box-shadow: inset 0 0 6px 1px var(--thumper-shadow-a);
transform: translateY(-35px);
}
}
.cylinder {
position: absolute;
width: 150px;
height: 180px;
background-color: var(--thumper-base);
translate: 0px 88px;
clip-path: polygon(10% 0%, 90% 0%, 100% 100%, 0% 100%);
border-top: 5px solid var(--thumper-h.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0