首页 > 其他分享 >css 特殊进度条

css 特殊进度条

时间:2024-05-29 11:57:25浏览次数:31  
标签:count flex 特殊 进度条 background 10px fff currentCount css

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.staticfile.net/vue/3.2.36/vue.global.min.js"></script>
    <style>
        body {
            background: rgba(44, 163, 255, 1);

        }

        .itembox {
            width: 400px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 16px 0px 16px 0px;
            border: 4px solid #E3F3FF;
            /* height: 40px; */
            padding: 10px;
            overflow: hidden;
            display: flex;
            flex-wrap: nowrap;
        }


        .flex-shrink0 {
            -moz-flex-shrink: 0;
            -ms-flex-shrink: 0;
            -webkit-flex-shrink: 0;
            flex-shrink: 0;
        }

        .item {
            background: #7EC6FD;
            width: 20px;
            height: 40px;
            margin-right: 10px;
            transform: skewX(-40deg);
            position: relative;

        }

        .item-progress {
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: #fff;
        }

        .btn {
            border-radius: 10px;
            display: inline-block;
            padding: 10px;
            margin-top: 20px;
            color: #fff;
            cursor: pointer;
            border:1px solid #fff
        }

        .btn:hover {
            opacity: 0.8;
        }

        .test{
            font-size: 26px;
            color: #fff;
            margin-bottom: 10px;
        }
    </style>
</head>

<body>
    <div id="hello-vue" class="demo">
        <div class="itembox">
            <div v-for="item in RangeCount" :key="item" class="item flex-shrink0">
                <div class="item-progress" v-if="item <=currentCount"> </div>
            </div>
        </div>
        <div class="test">  {{currentCount}} {{count}} /{{countTol}}</div>
        <div @click="aaaa" class="btn">增加进度哦</div>
    </div>

    <script>
        const HelloVueApp = {
            data() {
                return {
                    message: 'Hello Vue!!',
                    currentCount: 0,
                    RangeCount:14,
                    count: 0,
                    countTol: 100
                }
            },

            methods: {
                aaaa() {
                    if(this.count>=this.countTol){
                        return false
                    }
                    this.count += 10;
                    var p= this.count/this.countTol;
                    this.currentCount= Math.floor(this.RangeCount*p);
                    console.log('aaa ', p,  this.RangeCount*p, this.currentCount);
                }
            }
        }

        Vue.createApp(HelloVueApp).mount('#hello-vue')
    </script>
</body>

</html>

  

 

 

效果:

标签:count,flex,特殊,进度条,background,10px,fff,currentCount,css
From: https://www.cnblogs.com/j-a-h/p/18219952

相关文章

  • css实现按钮文案垂直水平居中,按钮左侧图标相对文字固定距离展示
    需求css实现按钮文案垂直水平居中,按钮左侧图标相对文字固定距离展示,效果如图: 实现方案一:使用margin-right来实现按钮和左侧图标的间距<divclass="download-btn"><divclass="btn-content":class="{'left-icon':showLeftIcon}"><div......
  • css画箭头,三角形
    箭头.arrow{border:solidblack;border-width:01px1px0;display:inline-block;padding:4px;}//向上.up{transform:rotate(-135deg);-webkit-transform:rotate(-135deg);}//向下.down{transform:rotate(45deg);-webkit-transform:r......
  • css中px和em的区别
    px和em是用来表示元素大小的单位,在CSS中经常被使用。px(pixel)是像素单位,表示屏幕上的一个点。它是一个绝对单位,表示一个固定的大小。例如,一个宽度为200px的元素将始终显示为200个像素宽。em是相对单位,根据继承它的父元素的字体大小来计算实际的大小。默认情况下......
  • css04 CSS Combinators
    https://www.w3schools.com/css/css_combinators.aspCSSCombinatorsAcombinatorissomethingthatexplainstherelationshipbetweentheselectors.ACSSselectorcancontainmorethanonesimpleselector.Betweenthesimpleselectors,wecanincludeaco......
  • css05 CSS Pseudo-classes
    https://www.w3schools.com/css/css_pseudo_classes.asp WhatarePseudo-classes?Apseudo-classisusedtodefineaspecialstateofanelement.Forexample,itcanbeusedto:StyleanelementwhenausermousesoveritStylevisitedandunvisitedlinks......
  • css03 CSS Selectors
    https://www.w3schools.com/css/css_selectors.aspACSSselectorselectstheHTMLelement(s)youwanttostyle.CSSSelectorsCSSselectorsareusedto"find"(orselect)theHTMLelementsyouwanttostyle.WecandivideCSSselectorsintofive......
  • css01 CSS Introduction
    https://www.w3schools.com/css/css_intro.asp CSSisthelanguageweusetostyleaWebpage.WhatisCSS?CSSstandsforCascadingStyleSheetsCSSdescribeshowHTMLelementsaretobedisplayedonscreen,paper,orinothermediaCSSsavesalotofw......
  • css02 CSS Syntax
    https://www.w3schools.com/css/css_syntax.aspACSSruleconsistsofaselectorandadeclarationblock.CSSSyntaxTheselectorpointstotheHTMLelementyouwanttostyle.Thedeclarationblockcontainsoneormoredeclarationsseparatedbysemicolo......
  • html+CSS部分基础运用8
    1.P147实验1,完成页面制作效果。图7-1木兰花令效果图2.P147实验2,完成页面制作效果。项目1<!DOCTYPEhtml><htmllang="en"><head>  <metacharset="UTF-8">  <linktype="text/css">  <title>木兰花令</title>......
  • html+CSS部分基础运用7
    项目1 设计简易灯箱画廊1.实验所需素材在trees文件夹中提供一个MP3文件和18个JPG文件,设计页面时可以使用。2.编程实现简易灯箱画廊,鼠标单击任一个图像超链接,在底部浮动框架中显示大图像,效果如图4-1所示的页面。图4-1简易灯箱画廊项目2 设计支持音频、视频播放的......