jquery+css实现十款不同类型的进度条效果代码
代码语言:html
所属分类:进度条
代码描述:jquery+css实现十款不同类型的进度条效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <style> .progress { position: relative; z-index: 5; background: #484848; border: 10px solid #282828; border-radius: 20px; display: inline-block; box-shadow: 0 5px 17px rgba(40, 40, 40, 0.5), 0 0 3px 1px rgba(40, 40, 40, 0.5) inset; } .progress-text { position: absolute; font: bold 14px/20px Arial; text-align: center; top: 0; left: 0; } .progress, .progress-bar, .progress-text { width: 200px; max-width: 200px; height: 20px; } .progress .progress-text:first-child { z-index: 5; color: white; } .progress .progress-text:last-child { z-index: 10; color: black; } .progress-bar { overflow: hidden; position: relative; z-index: 10; border-radius: 12px; width: 0; -moz-transition: width .2s linear; -webkit-transition: width .2s linear; -o-transition: width .2s linear; transition: width .2s linear; } /* Test Style */ .progress.test .progress-bar { background-color: #00baba; background-image: -moz-linear-gradient(left, #d1fffb 0%, #00baba 100%); background-image: -webkit-linear-gradient(left, #d1fffb 0%, #00baba 100%); background-image: -o-linear-gradient(left, #d1fffb 0%, #00baba 100%); background-image: -ms-linear-gradient(left, #d1fffb 0%, #00baba 100%); background-image: linear-gradient(to right, #d1fffb 0%, #00baba 100%); background-size: 200px 20px; overflow: visible; } .progress.test .progress-text:first-child { display: none; } .progress.test .progress-text:last-child { left: auto; top: auto; bottom: -26px; right: -12px; display: block; background-color: #00baba; width: 40px; height: 20px; border-radius: 3px; } .test[data-width='0%'] .progress-text:last-child { display: none; } .progress.test .progress-text:last-child:before { position: absolute; left: 12px; top: -6px; content: ''; width: 0; height: 0; border-style: solid; border-width: 0 6px 6px 6px; border-color: transparent transparent #00baba transparent; } /* Copper style */ .progress.copper .progress-bar { background-color: #b68d4c; background-image: -moz-linear-gradient(top, #f3e2c7 0%, #b68d4c 51%, #e9d4b3 100%); background-image: -webkit-linear-gradient(top, #f3e2c7 0%, #b68d4c 51%, #e9d4b3 100%); background-image: -ms-linear-gradient(top, #f3e2c7 0%, #b68d4c 51%, #e9d4b3 100%); background-image: linear-gradient(to bottom, #f3e2c7 0%, #b68d4c 51%, #e9d4b3 100%); box-shadow: inset 2px 2px 3px 0 rgba(255, 255, 255, 0.75), inset -3px 0 3px 0 rgba(255, 255, 255, 0.75); } /* Aqua Style */ .progress.aqua .progress-bar { background-color: #00baba; background-image: -moz-linear-gradient(left, #d1fffb 0%, #00baba 100%); background-image: -webkit-linear-gradient(left, #d1fffb 0%, #00baba 100%); background-image: -o-linear-gradient(left, #d1fffb 0%, #00baba 100%); background-image: -ms-linear-gradient(left, #d1fffb 0%, #00baba 100%); background-image: linear-gradient(to right, #d1fffb 0%, #00baba 100%); background-size: 200px 20px; } /* Candystripe style */ .progress.candy .progress-bar { background-color: #d00; box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.3) inset; background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.35) 25%, rgba(255, 255, 255, 0) 25%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0.35) 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; } } /* Pulsating Neon style */ .progress.neon .progress-bar { background-color: #fff; box-shadow: 0 0 5px #01fe32 inset, 0 0 16px #08ff35, 0 0 20px #08ff35, 0 0 15px #08ff35; -webkit-animation: pulse 2s linear infinite; -moz-animation: pulse 2s linear infinite; animation: pulse 2s linear infinite; } @-webkit-keyframes pulse { 50% { box-shadow: 0 0 5px #01fe32 inset, 0 0 10px #08ff35, 0 0 10px #08ff35, 0 0 10px #08ff35; } } @-moz-keyframes pulse { 50% { box-shadow: 0 0 5px #01fe32 inset, 0 0 10px #08ff35, 0 0 10px #08ff35, 0 0 10px #08ff35; } } @keyframes pulse { 50% { box-shadow: 0 0 5px #01fe32 inset, 0 0 10px #08ff35, 0 0 10px #08ff35, 0 0 10px #08ff35; } } /* Shine style */ .progress.shine .progress-bar { background-color: #00BA0C; background-image: -moz-linear-gradient(left, #00BA0C 0%, #00BA0C 75%, #D7FFD1 80%, #00BA0C 85%, #00BA0C 100%); background-image: -webkit-linear-gradient(left, #00BA0C 0%, #00BA0C 75%, #D7FFD1 80%, #00BA0C 85%, #00BA0C 100%); background-image: -o-linear-gradient(left, #00BA0C 0%, #00BA0C 75%, #D7FFD1 80%, #00BA0C 85%, #00BA0C 100%); background-image: -ms-linear-gradient(left, #00BA0C 0%, #00BA0C 75%, #D7FFD1 80%, #00BA0C 85%, #00BA0C 100%); background-image: linear-gradient(to right, #00BA0C 0%, #00BA0C 75%, #D7FFD1 80%, #00BA0C 85%, #00BA0C 100%); background-size: 800px 20px; box-shadow: inset 0 -2px 2px rgba(0, 0, 0, 0.5), inset 0 2px 2px rgba(255, 255, 255, 0.8); -webkit-animation: shine 2s linear infinite; -moz-animation: shine 2s linear infinite; animation: shine 2s linear infinite; } @-webkit-keyframes shine { to { background-position: 800px 0; } } @-moz-keyframes shine { to { background-position: 800px 0; } } @keyframes shine { to { background-position: 800px 0; } } /* Zigzag style */ .progress.zigzag .progress-bar { background-color: #EFE743; background-image: -moz-linear-gradient(135deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%), -moz-linear-gradient(225deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%), -moz-linear-gradient(315deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%), -moz-linear-gradient(45deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%); background-image: -webkit-linear-gradient(135deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%), -webkit-linear-gradient(225deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%), -webkit-linear-gradient(315deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%), -webkit-linear-gradient(45deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%); background-image: -o-linear-gradient(135deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%), -o-linear-gradient(225deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%), -o-linear-gradient(315deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%), -o-linear-gradient(45deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%); background-image: -ms-linear-gradient(135deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%), -ms-linear-gradient(225deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%), -ms-linear-gradient(315deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%), -ms-linear-gradient(45deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%); background-image: linear-gradient(135deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%), linear-gradient(225deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%), linear-gradient(315deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%), linear-gradient(45deg, #EA0000 25%, rgba(234, 0, 0, 0) 25%); background-position: -10px 0, -10px 0, 0 0, 0 0; background-size: 20px 20px; -webkit-animation: zigzagmove .5s linear infinite; -moz-animation: zigzagmove .5s linear infinite; animation: zigzagmove .5s linear infinite; } @-webkit-keyframes zigzagmove { to { background-position: 10px 0, 10px 0, 20px 0, 20px 0; } } @-moz-keyframes zigzagmove { to { background-position: 10px 0, 10px 0, 20px 0, 20px 0; } } @keyframes zigzagmove { to { background-position: 10px 0, 10px 0, 20px 0, 20px 0; } } /* Diamond style */ .progress.diamond .progress-bar { background-color: #eee; background-image: -moz-linear-gradient(45deg, red 25%, rgba(255, 0, 0, 0) 25%, rgba(255, 0, 0, 0) 75%, red 75%, red), -moz-linear-gradient(-45deg, red 25%, rgba(255, 0, 0, 0) 25%, rgba(255, 0, 0, 0) 75%, red 75%, red); background-image: -webkit-linear-gradient(45deg, red 25%, rgba(255, 0, 0, 0) 25%, rgba(255, 0, 0, 0) 75%, red 75%, red), -webkit-linear-gradient(-45deg, red 25%, rgba(255, 0, 0, 0) 25%, rgba(255, 0, 0, 0) 75%, red 75%, red); background-image: -o-linear-gradient(45deg, red 25%, rgba(255, 0, 0, 0) 25%, rgba(255, 0, 0, 0) 75%, red 75%, red), -o-linear-gradient(-45deg, red 25%, rgba(255, 0, 0, 0) 25%, rgba(255, 0, 0, 0) 75%, red 75%, red); background-image: -ms-linear-gradient(45deg, red 25%, rgba(255, 255, 255, 0) 25%, rgba(255, 0, 0, 0) 75%, red 75%, red), -ms-linear-gradient(-45deg, red 25%, rgba(255, 0, 0, 0) 25%, rgba(255, 0, 0, 0) 75%, red 75%, red); background-image: linear-gradient(45deg, red 25%, rgba(255, 0, 0, 0) 25%, rgba(255, 0, 0, 0) 75%, red 75%, red), linear-gradient(-45deg, red 25%, rgba(255, 0, 0, 0) 25%, rgba(255, 0, 0, 0) 75%, red 75%, red); background-size: 10px 10px; -webkit-animation: move 1.2s linear alternate infinite; -moz-animation: move 1.2s linear alternate infinite; animation: move 1.2s linear alternate infinite; } @-webkit-keyframes move { to { background-position: 5px -10px; background-size: 20px 20px; } } @-moz-keyframes move { to { background-position: 5px -10px; background-size: 20px 20px; } } @keyframes move { to { background-position: 5px -10px; background-size: 20px 20px; } } .progress.sparkle .progress-bar { background-color: #F7A806; background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAABACAMAAADMI7KPAAACZFBMVEX////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////xG13JAAAAzHRSTlMAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyA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jo358zucWqAh5JLOhooyh+vXgvqmKCGSxiSQgIAJO3HGtror2OCKeP0rKg0Md55rPaVr/YZBxEkTYF+bID0WjgRPHwIoHXfypxmZxAFLYuG/fuxWHz9OwvvHoY4YroIB54r1j5sSAB6aMUU8B/6AMxz5+aSYemMqeVwLDc/9KvBH3UsxtJBSHUCkHOulJurMY6IYoHGAMJ6A4RNy+4Hfc2HG6R6/a0rV7+09FMc4dOznmqtpLs3H0fq+II5r1LWuAVwYi16dtKE4aXxXggdjiU9HLGURi1NdAQEcSfprDY1AEyLWk72ARBi0ZTf6TJ+GGcratWay3nZ9Mq33wYAdz7n93R0Q+k0BYBCSYyd6EYbMIt1EBAL4Ya8g2P7pN6gfeIwaBkAwFqMCWf5/wWt/jbcWKdB0wXvQiVwMo4x6iSExjYf4sj0XK7d35fjgq2bIcDLX3E0EeN9QMfZ8dqs3KBp/w5O7O3V6uAR5zpKASDGifzXTiPs9V8qrfu5Tt0xOKB1YnmenJNmOmTO5p5dCIOZCxlSWL7FjLIj0.........完整代码请登录后点击上方下载按钮下载查看
网友评论0