css布局实现三维探照灯灯塔旋转动画效果代码
代码语言:html
所属分类:动画
代码描述:css布局实现三维探照灯灯塔旋转动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<style>
*, *:before, *:after {
border: 0;
box-sizing: border-box;
margin: 0;
padding: 0;
}
:root {
font-size: 16px;
}
body {
background: #126;
display: flex;
height: 100vh;
overflow-x: hidden;
}
.lighthouse {
margin: auto;
position: relative;
width: 16.4em;
height: 31.2em;
perspective: 30em;
}
.lighthouse div {
position: absolute;
}
.shadow {
background: rgba(0, 0, 10, 0.15);
width: 20%;
height: 100%;
z-index: 1;
}
.light-ray {
animation: lightRay 3s 0s cubic-bezier(0.8, 0.2, 0.2, 0.8) infinite running;
background: linear-gradient(90deg, #ffff5c, rgba(255, 255, 92, 0));
top: 3.3em;
left: 8em;
width: 14em;
height: 1.5em;
transform-origin: 0% 50%;
z-index: 6;
}
.roof-tip {
background: #464646;
border-radius: 50%;
left: 7.5em;
width: 1em;
height: 1em;
z-index: 1;
}
.roof {
background: linear-gradient(-30deg, #5a5a5a 59%, rgba(90, 90, 90, 0) 60%) 0 0/50.5% 100%, linear-gradient(30deg, #5a5a5a 59%, rgba(90, 90, 90, 0) 60%) 99.5% 0/50.5% 100%;
background-repeat: no-repeat;
border-radius: 0 0 10% 10%;
top: 0.9em;
left: 5.25em;
width: 5.5em;
height: 2em;
}
.head, .window1, .window2 {
background: #dcdcdf;
}
.head, .upper-neck, .lower-neck, .stem, .base-bottom {
overflow: hidden;
}
.head {
border-radius: 50% 50% 0 0 / 20% 20% 0 0;
top: 2.2em;
left: 5.6em;
width: 4.8em;
height: 4em;
}
.light {
animation: light 3s 0s cubic-bezier(0.8, 0.2, 0.2, 0.8) infinite running;
background: #ffff5c;
border-radius: 50%;
top: 0.6em;
left: 1.4em;
width: 2em;
height: 2em;
}
.top-rail, .bottom-rail {
color: #8c8c96;
}
.top-rail {
border-radius: 50% 50% 0 0;
box-shadow: 0 0 0 0.2em inset;
top: 5em;
left: 5.1em;
width: 5.7em;
height: 1.5em;
z-index: 1;
}
.upper-neck {
background: #5a5a5a;
border-radius: 50% 50% 0 0 / 35% 35% 0 0;
top: 5.7em;
left: 5em;
width: 6em;
height: 2.2em;
z-index: 2;
}
.bottom-rail {
border-radius: 50%;
box-shad.........完整代码请登录后点击上方下载按钮下载查看
网友评论0