css实现一个瓶中萤火虫求救效果代码
代码语言:html
所属分类:动画
代码描述:css实现一个瓶中萤火虫求救效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Gloria+Hallelujah&display=swap");
:root {
--darkgrey: #3b3b3b; /* background */
--lightgrey: #768c90; /* jar */
--lightestgrey: #dcdedf; /* lid */
--red: #c7535d; /* body */
--yellow: #fec14f; /* body */
--nearlyblack: #3b3b3b; /* wings, head */
--lightyellow: #ffeac4; /* glow */
--grey: #767676; /* wings. head. */
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
position: relative;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
background: var(--darkgrey);
overflow-y: hidden;
}
.container {
position: relative;
width: 80vmin;
height: 80vmin;
}
.jar {
position: absolute;
width: 60vmin;
height: 50vmin;
background: var(--lightgrey);
border-bottom-left-radius: 10vmin;
border-bottom-right-radius: 10vmin;
top: 30vmin;
left: 10vmin;
}
.jar:before {
position: absolute;
content: "";
border-radius: 25% 75% 0% 100% / 100% 0% 100% 0%;
backg.........完整代码请登录后点击上方下载按钮下载查看
网友评论0