मिनीटेक सही है जिसमें animation-delayएनीमेशन शुरू होने से पहले देरी को निर्दिष्ट करता है और पुनरावृत्तियों के बीच देरी नहीं । कल्पना के संपादकों के मसौदे में इसका अच्छी तरह से वर्णन किया गया है और इस विशेषता की चर्चा है कि आप यहाँ वर्णन कर रहे हैं जो इस चलना विलंब सुविधा का सुझाव दे रहा है।
जबकि JS में वर्कअराउंड हो सकता है, आप केवल CSS का उपयोग करते हुए प्रगति बार फ्लेयर के लिए इस पुनरावृत्ति विलंब को नकली कर सकते हैं।
भड़कीले डिव position:absoluteऔर पैरेंट डिव की घोषणा करके overflow: hidden, प्रगति बार की चौड़ाई की तुलना में 100% कीफ्रेम राज्य की स्थापना, और क्यूबिक-बेज़ियर टाइमिंग फ़ंक्शन और ऑफ़सेट वैल्यूज़ के साथ चारों ओर खेलना , आप एक ease-in-outया linearसमय का अनुकरण करने में सक्षम हैं देरी"।
यह बिल्कुल सही पाने के लिए बाईं ओर ऑफसेट और समय फ़ंक्शन की गणना करने के लिए एक कम / scss मिक्सिन लिखना दिलचस्प होगा, लेकिन मेरे पास इसके साथ फ़ाइड करने के लिए समय नहीं है। हालांकि ऐसा कुछ देखना पसंद करेंगे!
यहाँ एक डेमो है जिसे मैंने इसे दिखाने के लिए एक साथ फेंक दिया। (मैंने विंडोज 7 प्रगति बार का अनुकरण करने की कोशिश की और थोड़ा कम हो गया, लेकिन यह दर्शाता है कि मैं किस बारे में बात कर रहा हूं)
डेमो:
http://codepen.io/timothyasp/full/HlzGu
<!-- HTML -->
<div class="bar">
<div class="progress">
<div class="flare"></div>
</div>
</div>
/* CSS */
@keyframes progress {
from {
width: 0px;
}
to {
width: 600px;
}
}
@keyframes barshine {
0% {
left: -100px;
}
100% {
left: 1000px;
}
}
.flare {
animation-name: barshine;
animation-duration: 3s;
animation-direction: normal;
animation-fill-mode: forwards;
animation-timing-function: cubic-bezier(.14, .75, .2, 1.01);
animation-iteration-count: infinite;
left: 0;
top: 0;
height: 40px;
width: 100px;
position: absolute;
background: -moz-radial-gradient(center, ellipse cover, rgba(255,255,255,0.69) 0%, rgba(255,255,255,0) 87%); /* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,rgba(255,255,255,0.69)), color-stop(87%,rgba(255,255,255,0))); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover, rgba(255,255,255,0.69) 0%,rgba(255,255,255,0) 87%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover, rgba(255,255,255,0.69) 0%,rgba(255,255,255,0) 87%); /* Opera 12+ */
background: -ms-radial-gradient(center, ellipse cover, rgba(255,255,255,0.69) 0%,rgba(255,255,255,0) 87%); /* IE10+ */
background: radial-gradient(ellipse at center, rgba(255,255,255,0.69) 0%,rgba(255,255,255,0) 87%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b0ffffff', endColorstr='#00ffffff',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
z-index: 10;
}
.progress {
animation-name: progress;
animation-duration: 10s;
animation-delay: 1s;
animation-timing-function: linear;
animation-iteration-count: infinite;
overflow: hidden;
position:relative;
z-index: 1;
height: 100%;
width: 100%;
border-right: 1px solid
background:
background: -moz-linear-gradient(top,
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,
background: -webkit-linear-gradient(top,
background: -o-linear-gradient(top,
background: -ms-linear-gradient(top,
background: linear-gradient(to bottom,
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#caf7ce', endColorstr='#2ab22a',GradientType=0 ); /* IE6-9 */
}
.progress:after {
content: "";
width: 100%;
height: 29px;
right: 0;
bottom: 0;
position: absolute;
z-index: 3;
background: -moz-linear-gradient(left, rgba(202,247,206,0) 0%, rgba(42,178,42,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(202,247,206,0)), color-stop(100%,rgba(42,178,42,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, rgba(202,247,206,0) 0%,rgba(42,178,42,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, rgba(202,247,206,0) 0%,rgba(42,178,42,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, rgba(202,247,206,0) 0%,rgba(42,178,42,1) 100%); /* IE10+ */
background: linear-gradient(to right, rgba(202,247,206,0) 0%,rgba(42,178,42,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00caf7ce', endColorstr='#2ab22a',GradientType=1 ); /* IE6-9 */
}
.bar {
margin-top: 30px;
height: 40px;
width: 600px;
position: relative;
border: 1px solid
border-radius: 3px;
}
animation-delayएनीमेशन शुरू होने से पहले देरी हो रही है, और इसकी तरह कोई अन्य संपत्ति नहीं है। वहाँ जावास्क्रिप्ट के साथ कि आप शायद बजाय का उपयोग नहीं होता :) एक बुरा workaround है