<template>
<view class="content">
<!-- <view class="circleprogress">
<view class="progresstext">{{progresstext}}%</view>
<view class="wrapper left">
<view class="leftprogress" :style="{ transform: leftprogress}"></view>
</view>
<view class="wrapper right">
<view class="rightprogress" :style="{ transform: rightprogress}"></view>
</view>
</view>
<view class="section section_gap">
<text class="section__title">設(shè)置最小/最大值</text>
<view class="body-view">
<slider @changing="sliderchange" @change="sliderchange" min="0" max="100" show-value />
</view>
</view>
<view class="wrapper right">
<view class="rightprogress" :style="{ transform: rightprogress}"></view>
</view>
<view class="circle">
<view class="circle1" :style="{ transform: fog}">
<view class="">
</view>
</view>
</view> -->
<view class="">?
?<circlr></circle>?
?</view>?
?<image src="../../static/aixinRed.png" mode=""></image>?
</view>
</template>
<script>
export default {
data() {
return {
val: 0,
leftprogress: 'rotate(-45deg)',
rightprogress: 'rotate(45deg)',
progresstext: '0',
fog: 'rotate(45deg)',
n: 1
}
},
onLoad() {
// setInterval(()=>{
// this.n--
// this.fog = "rotate("+(45+this.n)+"deg)"
// },200)
},
watch: {
// val(new,old){}
},
methods: {
sliderchange: function(event) {
var val = event.detail.value;
this.progresstext = val;
console.log(val);
var deg = val / 100 * 360;
if (deg <= 180) {
this.rightprogress = 'rotate(' + eval(45 + deg) + 'deg)'
this.leftprogress = 'rotate(' + eval(-45) + 'deg)'
} else {
this.rightprogress = 'rotate(' + eval(45 + 180) + 'deg)'
this.leftprogress = 'rotate(' + eval(-45 + (deg - 180)) + 'deg)'
}
}
}
}
</script>
<style>
.circle1 {
width: 200rpx;
height: 200rpx;
border-radius: 50%;
border: 20rpx solid #ccc;
border-right: 20rpx solid #000;
border-bottom: 20rpx solid #000;
}
.leftprogress,
.rightprogress {
width: 160px;
height: 160px;
border: 20px solid green;
border-bottom: 20px solid #7ef22e;
border-radius: 50%;
}
.wrapper {
width: 100px;
height: 200px;
overflow: hidden;
}
.content {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
flex-flow: wrap;
align-items: center;
border-radius: 50%;
text-align: center;
height: 400upx;
padding-top: 50px;
}
.circleprogress {
width: 100%;
height: 200px;
display: flex;
justify-content: center;
}
.progresstext {
position: absolute;
font-size: 40px;
width: 200px;
height: 200px;
display: flex;
justify-content: center;
align-items: center;
z-index: 10;
color: #008000;
}
.wrapper {
width: 100px;
height: 200px;
overflow: hidden;
}
.leftprogress {
border-right: 20px solid #7ef22e;
}
.rightprogress {
border-left: 20px solid #7ef22e;
margin-left: -100px;
}
.section {
width: 80%;
margin-top: 50px;
}
</style>
css+js實(shí)現(xiàn)圓環(huán)實(shí)時(shí)進(jìn)度條功能
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
- 文/潘曉璐 我一進(jìn)店門尖飞,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事葫松⊥吒猓” “怎么了?”我有些...
- 文/不壞的土叔 我叫張陵腋么,是天一觀的道長咕娄。 經(jīng)常有香客問我,道長珊擂,這世上最難降的妖魔是什么圣勒? 我笑而不...
- 正文 為了忘掉前任,我火速辦了婚禮摧扇,結(jié)果婚禮上圣贸,老公的妹妹穿的比我還像新娘。我一直安慰自己扛稽,他們只是感情好吁峻,可當(dāng)我...
- 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著在张,像睡著了一般用含。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上帮匾,一...
- 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼蛇尚!你這毒婦竟也來了趟妥?” 一聲冷哼從身側(cè)響起,我...
- 序言:老撾萬榮一對情侶失蹤佣蓉,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后亲雪,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體勇凭,經(jīng)...
- 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
- 正文 我和宋清朗相戀三年义辕,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了虾标。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
- 正文 年R本政府宣布善炫,位于F島的核電站,受9級特大地震影響库继,放射性物質(zhì)發(fā)生泄漏箩艺。R本人自食惡果不足惜,卻給世界環(huán)境...
- 文/蒙蒙 一宪萄、第九天 我趴在偏房一處隱蔽的房頂上張望艺谆。 院中可真熱鬧,春花似錦拜英、人聲如沸静汤。這莊子的主人今日做“春日...
- 文/蒼蘭香墨 我抬頭看了看天上的太陽虫给。三九已至,卻和暖如春排监,著一層夾襖步出監(jiān)牢的瞬間狰右,已是汗流浹背。 一陣腳步聲響...
- 正文 我出身青樓挨队,卻偏偏與公主長得像谷暮,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個(gè)殘疾皇子盛垦,可洞房花燭夜當(dāng)晚...
推薦閱讀更多精彩內(nèi)容
- # CSS樣式規(guī)則overflow 使用HTML時(shí)湿弦,需要遵從一定的規(guī)范。CSS亦如此腾夯,要想熟練地使用CSS對網(wǎng)頁進(jìn)...
- 一颊埃、CSS入門 1、css選擇器 選擇器的作用是“用于確定(選定)要進(jìn)行樣式設(shè)定的標(biāo)簽(元素)”蝶俱。 有若干種形式的...
- 1、簡述<!doctype>的作用 <!doctype>是文檔的聲明榨呆,告訴瀏覽器當(dāng)前的文檔類型罗标;<!doctype...
- 第一部分 HTML&CSS整理答案 1. 什么是HTML5? 答:HTML5是最新的HTML標(biāo)準(zhǔn)。 注意:講述HT...