-
-
前端小姐姐 小试身手Lv3
发表于2021-8-26 18:28
楼主
1、页面效果:
2、这个效果可以运用在自定义大屏中,对重要数据去展示。下边来简单介绍下具体实现代码,主要用到了常规的html、css,代码如下:
html:
<div class="main">
<div class="title title1">
<div class="text">
<h6>预算金额</h6>
<p>26.85亿元</p>
</div>
<div class="line"></div>
</div>
<div class="title title2">
<div class="text">
<h6>实际金额</h6>
<p>22.96亿元</p>
</div>
<div class="line"></div>
</div>
<div class="title title3">
<div class="text">
<h6>预算完成率</h6>
<p>85.51%</p>
</div>
<div class="line"></div>
</div>
<div class="title title4">
<div class="text">
<h6>资产利润率</h6>
<p>73.10%</p>
</div>
<div class="line"></div>
</div>
<div class="title title5">
<div class="text">
<h6>成本收入比</h6>
<p>40.50%</p>
</div>
<div class="line"></div>
</div>
</div>
css:<style>
*{
padding: 0;
margin: 0;
}
body{
width: 100%;
height: 100vh;
background-image: url(img/bg1.jpg);
background-position: center;
background-color: #122432;
background-repeat: no-repeat;
position: relative;
}
body:before{
content: '';
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(0,0,0,.13);
}
.main{
position: absolute;
left: 50%;
top: 50%;
margin: -347px 0 0 -547px;
z-index: 2;
width: 1095px;
height: 694px;
}
.title{
position: absolute;
left: 95px;
bottom: 303px;
width: 204px;
height: auto;
overflow: hidden;
padding-bottom: 20px;
}
.title .text{
width: 164px;
height: 55px;
padding: 30px 20px;
text-align: center;
background-image: url(img/title-bg.png);
background-position: center;
background-repeat: no-repeat;
}
.title .text h6{
line-height: 30px;
font-size: 18px;
color: #1AEEBE;
}
.title .text p{
line-height: 25px;
font-size: 16px;
color: #FFFFFF;
}
.title .line{
width: 1px;
height: 120px;
background-color: #50e3c2;
position: relative;
margin: 7px auto 0;
}
.title .line:before{
content: '';
position: absolute;
left: -5px;
top: -5px;
width: 11px;
height: 11px;
background-color: #50e3c2;
border-radius: 50%;
}
.title .line:after{
content: '';
position: absolute;
bottom: -17px;
left: -19px;
width: 38px;
height: 26px;
background-image: url(img/round.png);
background-position: center;
background-repeat: no-repeat;
}
.title2{
left: 297px;
bottom: 184px;
}
.title3{
left: 547px;
bottom: 40px;
}
.title4{
left: 660px;
bottom: 405px;
}
.title5{
left: 880px;
bottom: 290px;
}
.title1 .line{
-webkit-animation: move1 9s infinite;
-o-animation: move1 9s infinite;
animation: move1 9s infinite;
}
@keyframes move1 {
12%,18%{
height: 151px;
}
0%,30%,100%{
height: 120px;
}
}
.title1 .line:after{
-webkit-animation: move01 9s infinite;
-o-animation: move01 9s infinite;
animation: move01 9s infinite;
}
@keyframes move01 {
14%,18%{
opacity: .1;
}
0%,12%,16%,20%,100%{
opacity: 1;
}
}
.title2 .line{
-webkit-animation: move2 9s infinite;
-o-animation: move2 9s infinite;
animation: move2 9s infinite;
}
@keyframes move2 {
30%,36%{
height: 151px;
}
18%,48%,100%{
height: 120px;
}
}
.title2 .line:after{
-webkit-animation: move02 9s infinite;
-o-animation: move02 9s infinite;
animation: move02 9s infinite;
}
@keyframes move02 {
32%,36%{
opacity: .1;
}
0%,30%,34%,38%,100%{
opacity: 1;
}
}
.title3 .line{
-webkit-animation: move3 9s infinite;
-o-animation: move3 9s infinite;
animation: move3 9s infinite;
}
@keyframes move3 {
48%,54%{
height: 151px;
}
36%,66%,100%{
height: 120px;
}
}
.title3 .line:after{
-webkit-animation: move03 9s infinite;
-o-animation: move03 9s infinite;
animation: move03 9s infinite;
}
@keyframes move03 {
50%,54%{
opacity: .1;
}
0%,48%,52%,56%,100%{
opacity: 1;
}
}
.title5 .line{
-webkit-animation: move5 9s infinite;
-o-animation: move5 9s infinite;
animation: move5 9s infinite;
}
@keyframes move5 {
66%,72%{
height: 151px;
}
54%,84%,100%{
height: 120px;
}
}
.title5 .line:after{
-webkit-animation: move05 9s infinite;
-o-animation: move05 9s infinite;
animation: move05 9s infinite;
}
@keyframes move05 {
68%,72%{
opacity: .1;
}
0%,66%,70%,74%,100%{
opacity: 1;
}
}
.title4 .line{
-webkit-animation: move4 9s infinite;
-o-animation: move4 9s infinite;
animation: move4 9s infinite;
}
@keyframes move4 {
84%,90%{
height: 151px;
}
72%,100%{
height: 120px;
}
}
.title4 .line:after{
-webkit-animation: move04 9s infinite;
-o-animation: move04 9s infinite;
animation: move04 9s infinite;
}
@keyframes move04 {
86%,90%{
opacity: .1;
}
0%,84%,88%,92%,100%{
opacity: 1;
}
}
</style>

2、这个效果可以运用在自定义大屏中,对重要数据去展示。下边来简单介绍下具体实现代码,主要用到了常规的html、css,代码如下:
html:
<div class="main">
<div class="title title1">
<div class="text">
<h6>预算金额</h6>
<p>26.85亿元</p>
</div>
<div class="line"></div>
</div>
<div class="title title2">
<div class="text">
<h6>实际金额</h6>
<p>22.96亿元</p>
</div>
<div class="line"></div>
</div>
<div class="title title3">
<div class="text">
<h6>预算完成率</h6>
<p>85.51%</p>
</div>
<div class="line"></div>
</div>
<div class="title title4">
<div class="text">
<h6>资产利润率</h6>
<p>73.10%</p>
</div>
<div class="line"></div>
</div>
<div class="title title5">
<div class="text">
<h6>成本收入比</h6>
<p>40.50%</p>
</div>
<div class="line"></div>
</div>
</div>
css:<style>
*{
padding: 0;
margin: 0;
}
body{
width: 100%;
height: 100vh;
background-image: url(img/bg1.jpg);
background-position: center;
background-color: #122432;
background-repeat: no-repeat;
position: relative;
}
body:before{
content: '';
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(0,0,0,.13);
}
.main{
position: absolute;
left: 50%;
top: 50%;
margin: -347px 0 0 -547px;
z-index: 2;
width: 1095px;
height: 694px;
}
.title{
position: absolute;
left: 95px;
bottom: 303px;
width: 204px;
height: auto;
overflow: hidden;
padding-bottom: 20px;
}
.title .text{
width: 164px;
height: 55px;
padding: 30px 20px;
text-align: center;
background-image: url(img/title-bg.png);
background-position: center;
background-repeat: no-repeat;
}
.title .text h6{
line-height: 30px;
font-size: 18px;
color: #1AEEBE;
}
.title .text p{
line-height: 25px;
font-size: 16px;
color: #FFFFFF;
}
.title .line{
width: 1px;
height: 120px;
background-color: #50e3c2;
position: relative;
margin: 7px auto 0;
}
.title .line:before{
content: '';
position: absolute;
left: -5px;
top: -5px;
width: 11px;
height: 11px;
background-color: #50e3c2;
border-radius: 50%;
}
.title .line:after{
content: '';
position: absolute;
bottom: -17px;
left: -19px;
width: 38px;
height: 26px;
background-image: url(img/round.png);
background-position: center;
background-repeat: no-repeat;
}
.title2{
left: 297px;
bottom: 184px;
}
.title3{
left: 547px;
bottom: 40px;
}
.title4{
left: 660px;
bottom: 405px;
}
.title5{
left: 880px;
bottom: 290px;
}
.title1 .line{
-webkit-animation: move1 9s infinite;
-o-animation: move1 9s infinite;
animation: move1 9s infinite;
}
@keyframes move1 {
12%,18%{
height: 151px;
}
0%,30%,100%{
height: 120px;
}
}
.title1 .line:after{
-webkit-animation: move01 9s infinite;
-o-animation: move01 9s infinite;
animation: move01 9s infinite;
}
@keyframes move01 {
14%,18%{
opacity: .1;
}
0%,12%,16%,20%,100%{
opacity: 1;
}
}
.title2 .line{
-webkit-animation: move2 9s infinite;
-o-animation: move2 9s infinite;
animation: move2 9s infinite;
}
@keyframes move2 {
30%,36%{
height: 151px;
}
18%,48%,100%{
height: 120px;
}
}
.title2 .line:after{
-webkit-animation: move02 9s infinite;
-o-animation: move02 9s infinite;
animation: move02 9s infinite;
}
@keyframes move02 {
32%,36%{
opacity: .1;
}
0%,30%,34%,38%,100%{
opacity: 1;
}
}
.title3 .line{
-webkit-animation: move3 9s infinite;
-o-animation: move3 9s infinite;
animation: move3 9s infinite;
}
@keyframes move3 {
48%,54%{
height: 151px;
}
36%,66%,100%{
height: 120px;
}
}
.title3 .line:after{
-webkit-animation: move03 9s infinite;
-o-animation: move03 9s infinite;
animation: move03 9s infinite;
}
@keyframes move03 {
50%,54%{
opacity: .1;
}
0%,48%,52%,56%,100%{
opacity: 1;
}
}
.title5 .line{
-webkit-animation: move5 9s infinite;
-o-animation: move5 9s infinite;
animation: move5 9s infinite;
}
@keyframes move5 {
66%,72%{
height: 151px;
}
54%,84%,100%{
height: 120px;
}
}
.title5 .line:after{
-webkit-animation: move05 9s infinite;
-o-animation: move05 9s infinite;
animation: move05 9s infinite;
}
@keyframes move05 {
68%,72%{
opacity: .1;
}
0%,66%,70%,74%,100%{
opacity: 1;
}
}
.title4 .line{
-webkit-animation: move4 9s infinite;
-o-animation: move4 9s infinite;
animation: move4 9s infinite;
}
@keyframes move4 {
84%,90%{
height: 151px;
}
72%,100%{
height: 120px;
}
}
.title4 .line:after{
-webkit-animation: move04 9s infinite;
-o-animation: move04 9s infinite;
animation: move04 9s infinite;
}
@keyframes move04 {
86%,90%{
opacity: .1;
}
0%,84%,88%,92%,100%{
opacity: 1;
}
}
</style>