前端进度条动画(自定义颜色)

前端进度条动画(自定义

代码如下(示例):

<template>
	<view class="flex-cen">
		<view class="progress candy">
			<view class="progress-bar" :style="{width: Width+'%'}"></view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			Width:80 //进度百分比0~100
		};
	}
};
</script>

<style>
.progress {
	margin-top: 100rpx;
    position: relative;
    z-index: 5;
    background: #0000000F;
}

.progress,
.progress-bar {
    width: 610rpx;
    height: 10rpx;
	border-radius: 8rpx;
}


// 进度条动画
.progress.candy .progress-bar {
    background-color: #FF9100FF;
    /* box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.3) inset; */
    background-image: linear-gradient(
		-45deg, 
		rgba(255, 83, 0, 1) 25%, 
		rgba(255, 255, 255, 0) 25%, 
		rgba(255, 255, 255, 0) 50%, 
		rgba(255, 83, 0, 1) 50%, 
		rgba(255, 83, 0, 1) 75%, 
		rgba(255, 255, 255, 0) 75%, 
		rgba(255, 255, 255, 0));
    background-repeat: repeat-x;
    background-size: 20px 20px;
    -webkit-animation: candystripe 1s linear infinite;
    -moz-animation: candystripe 1s linear infinite;
    animation: candystripe 1s linear infinite;
}

@-webkit-keyframes candystripe {
    to {
        background-position: 20px 0;
    }
}

@-moz-keyframes candystripe {
    to {
        background-position: 20px 0;
    }
}

@keyframes candystripe {
    to {
        background-position: 20px 0;
    }
}
</style>

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值