div+css实现太空宇宙之窗户效果代码
代码语言:html
所属分类:布局界面
代码描述:div+css实现太空宇宙之窗户效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
body {
width: 100vw;
height: 100vh;
margin: 0;
overflow: hidden;
background: radial-gradient(circle, #2c1f5f 300px, #0e0b29);
}
.scene {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
transition: transform 400ms;
}
@media (max-width: 680px) {
.scene {
transform: scale(0.5);
}
}
.window {
position: absolute;
width: 460px;
height: 460px;
border: 20px solid #2c1f5f;
border-radius: 50%;
background-color: #d7e8ff;
overflow: hidden;
}
.window .glass {
position: absolute;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
border-radius: 50%;
}
.window .glass::after {
content: "";
position: absolute;
border-top: 5px solid #2c1f5f;
border-bottom: 5px solid #2c1f5f;
width: 100%;
height: 180px;
}
.window .glass::before {
content: "";
position: absolute;
border-left: 5px solid #2c1f5f;
border-right: 5px solid #2c1f5f;
width: 180px;
height: 100%;
}
.light {
position: absolute;
width: 580px;
height: 600px;
border-radius: 50%;
background: linear-gradient(#2c1f5f 40%, #524eb0);
overflow: hidden;
}
.shadow::after {
content: "";
position: absolute;
bottom: -70px;
left: 50%;
transform: translateX(-50%) rotate(-45deg);
border-top: 8px solid #342b76;
border-right: 8px solid #342b76;
width: 200px;
height: 200px;
}
.shadow::before {
content: "";
position: absolute;
bottom: 20px;
left: 50%;
transform: translateX(-50%) rotate(-45deg) skew(15deg, 15deg);
border-top: 8px solid #332772;
border-right: 8px solid #332772;
width: 300px;
height: 300px;
}
.sky {
position: absolute;
width: 100%;
height: 100%;
background:.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0