css实现注水图

<div class="one tip_one" >
 	<div class="rate_box">{{propertystaType=='num' ? inUseCountRate : inUseAreaRate}} %</div>
	<div class="water_level water_green"  :style="{ 'animation-name': inUseCountRate >= 100 ? 'anim_100': (inUseCountRate < 100 && inUseCountRate >= 90) ? 'anim_90' : (inUseCountRate < 90 && inUseCountRate >= 80) ? 'anim_80': (inUseCountRate < 80 && inUseCountRate >= 70) ? 'anim_70': (inUseCountRate < 70 && inUseCountRate >= 60) ? 'anim_60': (inUseCountRate < 60 && inUseCountRate >= 50) ? 'anim_50': (inUseCountRate < 50 && inUseCountRate >= 40) ? 'anim_40': (inUseCountRate < 40 && inUseCountRate >= 30) ? 'anim_30': (inUseCountRate < 30 && inUseCountRate >= 20) ? 'anim_20': (inUseCountRate < 20 && inUseCountRate >= 10) ? 'anim_10':(inUseCountRate < 10 && inUseCountRate > 0) ? 'anim_5':'anim_0'}"></div>
</div>
						.tip_one {
                            position: relative;
                            overflow: hidden;
                            border-bottom-left-radius: 10px;
                            border-bottom-right-radius: 10px;

                            .rate_box {
                                margin: auto;
                                position: absolute;
                                top: 50%; left: 0; bottom: 0; right: 0;
                                z-index: 1000;
                            }
                            .water_green {
                                background-color: #3d6e7e;
                                background: -moz-linear-gradient(right, #316b78 0%, #2f6674 20%, #255264 60%, #1e4458 80%, #102941 100%);
                                background: -webkit-gradient(linear, top right, top left, color-stop(0%,#316b78),color-stop(20%,#2f6674),color-stop(60%,#255264),color-stop(80%,#1e4458), color-stop(100%,#102941));
                                background: -webkit-linear-gradient(right, #316b78 0%, #2f6674 20%, #255264 60%, #1e4458 80%, #102941 100%);
                                background: -o-linear-gradient(right, #316b78 0%, #2f6674 20%, #255264 60%, #1e4458 80%, #102941 100%);
                                background: -ms-linear-gradient(right,#316b78 0%, #2f6674 20%, #255264 60%, #1e4458 80%, #102941 100%);
                                background: linear-gradient(to right,#316b78 0%, #2f6674 20%, #255264 60%, #1e4458 80%, #102941 100%);
                                box-shadow: 9px 5px 8px 4px #316b78;
                            }

                            .water_level {
                                position: absolute;
                                margin: auto;
                                height: 145px;
                                width: 89px;
                                top: 196px;
                                border: none;
                                animation-name: anim_100;
                                animation-duration: 5s;
                                animation-timing-function: ease;
                                animation-fill-mode: forwards;
                                border-radius: 5px;
                                border-bottom-left-radius: 10px;
                                border-bottom-right-radius: 10px;
                            }
                        }
                        @keyframes anim_100 {
                            100% {
                                top: 55px;
                            }
                        }
                        @keyframes anim_90 {
                            100% {
                                top: 65px;
                            }
                        }
                        @keyframes anim_80 {
                            100% {
                                top: 80px;
                            }
                        }
                        @keyframes anim_70 {
                            100% {
                                top: 95px;
                            }
                        }
                        @keyframes anim_60 {
                            100% {
                                top: 105px;
                            }
                        }
                        @keyframes anim_50 {
                            100% {
                                top: 115px;
                            }
                        }
                        @keyframes anim_40 {
                            100% {
                                top: 125px;
                            }
                        }
                        @keyframes anim_30 {
                            100% {
                                top: 140px;
                            }
                        }
                        @keyframes anim_20 {
                            100% {
                                top: 165px;
                            }
                        }
                        @keyframes anim_10 {
                            100% {
                                top: 180px;
                            }
                        }
                        @keyframes anim_5 {
                            100% {
                                top: 185px;
                            }
                        }
                        @keyframes anim_0 {
                            100% {
                                top: 196px;
                            }
                        }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值