div+css实现海上帆船城堡自然风光卡通动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现海上帆船城堡自然风光卡通动画效果代码
代码标签: div css 海上 帆船 城堡 自然 风光 卡通 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
body{
display: block;
background-color: #ffbf00;
}
.section-center{
position: relative;
width: 600px;
height: 450px;
display: block;
z-index: 6;
margin: 0 auto;
overflow: hidden;
}
.section-up{
position: absolute;
width: 100%;
height: 270px;
left: 0;
top: 0;
display: block;
z-index: 5;
}
.hill{
position: absolute;
width: 115px;
height: 27px;
left: 30px;
bottom: 0;
display: block;
z-index: 15;
}
.hill.snd{
left: 115px;
z-index: 14;
}
.hill.trd{
transform: rotateY(180deg);
left: auto;
right:30px;
}
.hill.frt{
transform: rotateY(180deg);
left: auto;
right: 110px;
z-index: 14;
}
.hill span{
position: absolute;
width: 60px;
height: 60px;
background-color: saddlebrown;
left: 4px;
top: 0;
display: block;
border-radius: 50%;
border: 2px solid #030308;
border-color: #030308 transparent transparent transparent;
}
.hill span:nth-child(2){
width: 110px;
height: 110px;
left: -6px;
top: -5px;
background-color: transparent;
transform: rotate(5deg);
border-color: transparent transparent transparent #030308;
}
.hill span:nth-child(3){
width: 10px;
height: 10px;
left: 2px;
top: 22px;
transform: rotate(-55deg);
border: none;
border-radius: 0;
}
.hill span:nth-child(4){
width: 40px;
height: 40px;
left: auto;
top: 11px;
right: 5px;
border-color: #030308 transparent transparent transparent;
}
.hill span:nth-child(5){
width: 110px;
height: 110px;
left: auto;
top: 3px;
right: -8px;
background-color: transparent;
transform: rotate(85deg);
border-color: #030308 transparent transparent transparent;
}
.hill span:nth-child(6){
width: 24px;
height: 24px;
left: auto;
top: -5px;
right: 31px;
background-color: transparent;
border-color: transparent transparent #030308 transparent;
}
.hill span:nth-child(7){
width: 17px;
height: 4px;
left: auto;
top: 10px;
right: 49px;
background-color: transparent;
border-radius: 0;
transform: rotate(33deg);
border-color: #030308 transparent transparent transparent;
}
.hill span:nth-child(8){
width: 20px;
height: 10px;
left: 65px;
top: 21px;
transform: rotate(-35deg);
border: none;
border-radius: 0;
}
.hill span:nth-child(9){
width: 30px;
height: 10px;
left: 46px;
top: 15px;
transform: rotate(33deg);
border: none;
border-radius: 0;
}
.hill span:nth-child(10){
width: 20px;
height: 10px;
left: 60px;
top: 19px;
border: none;
border-radius: 0;
}
.hill span:nth-child(11){
width: 20px;
height: 10px;
left: 101px;
top: 29px;
border: none;
border-radius: 0;
transform: rotate(45deg);
}
.left-tree{
position: absolute;
width: 20px;
height: 33px;
left: 33px;
bottom: 8px;
display: block;
z-index: 10;
transform: rotate(11deg) skewX(3deg);
transform-origin: center bottom;
animation: moveTree 1.6s ease infinite;
}
@keyframes moveTree {
0%,100% {
transform: rotate(11deg) skewX(3deg);
}
50% {
transform: rotate(-11deg) skewX(-3deg);
}
100% {
transform: rotate(11deg) skewX(3deg);
}
}
.left-tree span{
position: absolute;
width: 20px;
height: 20px;
left: 0;
top: 0;
border-radius: 50%;
border: 2px solid #030308;
background-color: lawngreen;
}
.left-tree span:nth-child(2){
width: 2px;
height: 25px;
left: 9px;
top: auto;
bottom: 0;
border-radius: 0;
border: none;
background-color: #030308;
}
.left-tree span:nth-child(3){
width: 2px;
height: 5px;
left: 7px;
top: auto;
bottom: 20px;
border-radius: 0;
border: none;
background-color: #030308;
transform: rotate(-45deg);
}
.left-tree span:nth-child(4){
width: 2px;
height: 5px;
left: 11px;
top: auto;
bottom: 17px;
border-radius: 0;
border: none;
background-color: #030308;
transform: rotate(45deg);
}
.right-tree{
position: absolute;
width: 20px;
height: 33px;
right: 25px;
bottom: 3px;
display: block;
z-index: 10;
transform: rotate(11deg) skewX(3deg);
transform-origin: center bottom;
animation: moveTree 1.6s .........完整代码请登录后点击上方下载按钮下载查看
















网友评论0