I would like to simulate a loading effect, so the opacity of the image is changing gradually.
body {
background-color: #aaa;
padding: 10px;
}
#progressbar {
width: 269px;
height: 269px;
background-color: #eee;
clear: both;
}
#progress {
background: #fff; /*-- Color of the bar --*/
height: 269px;
width: 0%;
max-width: 269px;
float: left;
-webkit-animation: progress 2s 1 forwards;
-moz-animation: progress 2s 1 forwards;
-ms-animation: progress 2s 1 forwards;
animation: progress 2s 1 forwards;
}
#pbaranim {
height: 269px;
width: 269px;
overflow: hidden;
background: url("http://i57.tinypic.com/acyid2.jpg");
-moz-opacity: 0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=55);
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=55);
filter: alpha(opacity=55);
}
#-webkit-keyframes progress {
from { }
to { width: 100% }
}
#-moz-keyframes progress {
from { }
to { width: 100% }
}
#-ms-keyframes progress {
from { }
to { width: 100% }
}
#keyframes progress {
from { }
to { width: 100% }
}
<div id="progressbar"><div id="progress" ><div id="pbaranim"></div></div></div>
In my example, the Div is over the image.
I need the image opacity to become clearer, so the inverse of what I have
Image should appear from 0 to 100%
Makes sense?
thanks for any help
You can achieve the effect with the following code:
CSS
#progressBar {
position:relative;
}
#progressImg {
width:391px;
}
#opacObj {
-webkit-animation:opacAnimation 4s 1 cubic-bezier(0, 1.09, .66, .96);
-webkit-animation-fill-mode: forwards;
-moz-animation:opacAnimation 4s 1 cubic-bezier(0, 1.09, .66, .96);
-moz-animation-fill-mode: forwards;
-o-animation:opacAnimation 4s 1 cubic-bezier(0, 1.09, .66, .96);
-o-animation-fill-mode: forwards;
animation:opacAnimation 4s 1 cubic-bezier(0, 1.09, .66, .96);
animation-fill-mode: forwards;
width:391px;
height:364px;
background:#fff;
position:absolute;
top:0;
left:0;
}
#-webkit-keyframes opacAnimation {
0% {
opacity:0.8;
left:0;
}
100% {
opacity:0.0;
left:391px;
}
}
#-moz-keyframes opacAnimation {
0% {
opacity:0.8;
left:0;
}
100% {
opacity:0.0;
left:391px;
}
}
#-o-keyframes opacAnimation {
0% {
opacity:0.8;
left:0;
}
100% {
opacity:0.0;
left:391px;
}
}
#keyframes opacAnimation {
0% {
opacity:0.8;
left:0;
}
100% {
opacity:0.0;
left:391px;
}
}
HTML
<div id="progressbar">
<img src="http://i57.tinypic.com/acyid2.jpg" border="0" id="progressImg">
<div id="opacObj"></div>
</div>
jsFiddle demo
Change the nesting hierarchy of your objects, namedly progress and pbaranim divs, as this
<div id="progressbar"><div id="pbaranim"><div id="progress" ></div></div></div>
You will progress from there on, by adding another image with the from color, and keep current image as the to color (from and to colors of animation) etc...
Related
I'm playing around with CSS animation, and I was wondering if there's a way to make a vertical line (with certain height) to grow in length automatically and turn to left and add an image at the end when the page loads. I was able to draw vertical line but how to turn it to left and add image.
https://jsfiddle.net/29303g27/3/
#cool
{
width:2px;
margin-left:10%;
background-color:#431;
margin-top:35%;
animation:grow 3s forwards;
position:relative;
}
#keyframes grow
{
0% {
height: 0px;
bottom:0;
}
100%{
height: 200px;
bottom:200px;
}
}
<div id=cool>
</div>
By using div inner div
#cool2{
height:0px;
width:1px;
border-bottom:2px solid #000;
-webkit-animation: increase 3s;
-moz-animation: increase 3s;
-o-animation: increase 3s;
animation: increase 3s;
animation-fill-mode: forwards;
margin-left:10%;
margin-top:0px;
animation-delay:5s;
-webkit-animation-delay:3s;
}
#keyframes increase {
100% {
width: 200px;
}
}
.image
{
width:0px;
height:200px;
left:2px;
top:2px;
-webkit-animation: fade 3s;
-moz-animation: fade 3s;
-o-animation: fade 3s;
animation: fade 3s;
animation-fill-mode: forwards;
margin-left:10%;
margin-top:0px;
animation-delay:6s;
-webkit-animation-delay:6s;
position:absolute;}
#keyframes fade {
0% {
opacity: 0;
}
100% {
opacity: 1;
width:200px;
}
}
#cool
{
width:2px;
margin-left:10%;
background-color:#431;
margin-top:35%;
animation:grow 3s forwards;
position:relative;
}
#keyframes grow
{
0% {
height: 0px;
bottom:0;
}
100%{
height: 200px;
bottom:200px;
}
}
<div id=cool>
<div id=cool2>
<img class='image' src='https://www.google.co.in/logos/doodles/2017/sitara-devis-97th-birthday-6469056130449408.5-l.png'>
</div>
</div>
and Check this 2nd way using :after Element
#cool:after{
height:0px;
width:1px;
border-bottom:2px solid #000;
-webkit-animation: increase 3s;
-moz-animation: increase 3s;
-o-animation: increase 3s;
animation: increase 3s;
animation-fill-mode: forwards;
margin-left:10%;
margin-top:0px;
animation-delay:5s;
-webkit-animation-delay:3s;
position:absolute;
content:'';
}
#keyframes increase {
100% {
width: 200px;
}
}
.image
{
width:0px;
height:200px;
left:2px;
top:2px;
-webkit-animation: fade 3s;
-moz-animation: fade 3s;
-o-animation: fade 3s;
animation: fade 3s;
animation-fill-mode: forwards;
margin-left:10%;
margin-top:0px;
animation-delay:6s;
-webkit-animation-delay:6s;
position:absolute;}
#keyframes fade {
0% {
opacity: 0;
}
100% {
opacity: 1;
width:200px;
}
}
#cool
{
width:2px;
margin-left:10%;
background-color:#431;
margin-top:35%;
animation:grow 3s forwards;
position:relative;
}
#keyframes grow
{
0% {
height: 0px;
bottom:0;
}
100%{
height: 200px;
bottom:200px;
}
}
<div id=cool>
<img class='image' src='https://www.google.co.in/logos/doodles/2017/sitara-devis-97th-birthday-6469056130449408.5-l.png'>
</div>
It can be done in many ways. Example
In example I use wrapper element and place line element inside. In this way, line element can use percentage value which relate to wrapper element. It means we don't need to fix height or width just let it grows by image.
<div class='wrapper'>
<img class='image' src='https://images.unsplash.com/photo-1485963631004-f2f00b1d6606?auto=format&fit=crop&w=360&h=180&q=60'>
<div class='line'></div>
</div>
and now animation will be
#keyframes show-up {
0% {
height: 0;
}
50% {
left: 0;
height: 100%;
}
100% {
left: 100%;
height: 100%;
}
}
In the slideshow shown below, there are two images available. Once clicking on a button for the second image after first opening my page, there is a sudden jump to that image with no 5 second transition as expected. Also when doing this, I notice that #slideshowimage-2 is shown in the url (doing this offline) after clicking the button for that image. Here's the code below:
CSS:
.slideshowcontainer {
width:800px;
height:400px;
margin-left:auto;
margin-right:auto;
margin-top:0px;
text-align:center;
overflow:hidden;
position:relative;
top:30px;
border-style:solid;
border-width:10px;
border-color:white;
border-radius:15px;
}
.imagecontainer {
width:1800px;
height:400px;
clear: both;
position:relative;
-webkit-transition:left 3s;
-moz-transition:left 3s;
-o-transition:left 3s;
-ms-transition:left 3s;
transition:left 3s;
animation:scroller 16s infinite;
}
#keyframes scroller {
0% {transform:translateX(0);}
31.25% {transform:translateX(0);}
50% {transform:translateX(-800px);}
81.25% {transform:translateX(-800px);}
100% {transform:translateX(0);}
}
.slideshowimage {
float:left;
margin:0px;
padding:0px;
position:relative;
}
#keyframes change {
0% {
transform: translateX(-800px);
}
100% {
transform: translateX(0);
animation: scroller 16s infinite;
}
}
#keyframes change2 {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-800px);
animation: scroller2 16s infinite;
}
}
#slideshowimage-1:target ~ .imagecontainer {
animation: none;
transform: translateX(0px);
animation: change 3s forwards;
}
#slideshowimage-2:target ~ .imagecontainer {
animation: none;
transform: translateX(-800px);
animation: change2 3s forwards;
}
.buttoncontainer {
position:relative;
top:-20px;
}
.button {
display:inline-block;
height:10px;
width:10px;
border-radius:10px;
background-color:darkgray;
-webkit-transition:background-color 0.25s;
-moz-transition:background-color 0.25s;
-o-transition:background-color 0.25s;
-ms-transition:background-color 0.25s;
transition:background-color 0.25s;
}
.button:hover {
background-color:gray;
}
HTML:
<div class="slideshowcontainer">
<span id="slideshowimage-1"></span>
<span id="slideshowimage-2"></span>
<span id="slideshowimage-3"></span>
<div class="imagecontainer">
<img src="WebServiceSlide.png" class="slideshowimage" style="width:800px;height:400px;">
<img src="es-flag.png" class="slideshowimage" style="width:800px;height:400px;">
</div>
<div class="buttoncontainer">
</div>
</div>
How could I make it so that the transition set upon clicking a button occurs on the first click? Many thanks in advance.
Reason:-
Because the left and translateX both are different. If you apply left:-800px when slide is at translateX(-800px) (2nd slide) then animation will continue at the 2nd part of slideshow. Thats why you are seeing a blank white space(when translateX(-800px) accors when it is already left:-800px).
Solution:-
You either have to use translateX or left. use the same in all the places
Part of code that solved the problem:-
#keyframes change {
0% {
transform: translateX(-800px);
}
100% {
transform: translateX(0);
animation: scroller 16s infinite;
}
}
#keyframes change2 {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-800px);
animation: scroller2 16s infinite;
}
}
#slideshowimage-1:target ~ .imagecontainer {
animation: none;
transform: translateX(0px);
animation: change 3s forwards;
}
#slideshowimage-2:target ~ .imagecontainer {
animation: none;
transform: translateX(-800px);
animation: change2 3s forwards;
}
Explanation:-
This code doesn't do translateX manually. Instead it uses animation to scoll single time by animation: change 3s forwards;
Drawback:-
Once we click on the slide selection button the animation stops. I have even tried it to solve by adding animation in the change keyframes animate end section. But unfortunately it didn't work. So I would suggest an alternate method to overcome the drawback as follows
To overcome the drawback I have added a play button which
will replay the slideshow animation which got paused by the slide
button. (Once we click on play button it takes a little time to slide
as we have given 16s in animation)
DEMO:-
.slideshowcontainer {
width: 800px;
height: 400px;
margin-left: auto;
margin-right: auto;
margin-top: 0px;
text-align: center;
overflow: hidden;
position: relative;
top: 30px;
border-style: solid;
border-width: 10px;
border-color: white;
border-radius: 15px;
}
.imagecontainer {
width: 1800px;
height: 400px;
clear: both;
position: relative;
-webkit-transition: all 3s;
-moz-transition: all 3s;
-o-transition: all 3s;
-ms-transition: all 3s;
transition: all 3s;
transform: translateX(0px);
animation: scroller 16s infinite;
}
#keyframes scroller {
0% {
transform: translateX(0);
}
31.25% {
transform: translateX(0);
}
50% {
transform: translateX(-800px);
}
81.25% {
transform: translateX(-800px);
}
100% {
transform: translateX(0);
}
}
#keyframes scroller2 {
0% {
transform: translateX(-800px);
}
31.25% {
transform: translateX(-800px);
}
50% {
transform: translateX(0);
}
81.25% {
transform: translateX(0);
}
100% {
transform: translateX(-800px);
}
}
#keyframes change {
0% {
transform: translateX(-800px);
}
100% {
transform: translateX(0);
animation: scroller 16s infinite;
}
}
#keyframes change2 {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-800px);
animation: scroller2 16s infinite;
}
}
.slideshowimage {
float: left;
margin: 0px;
padding: 0px;
position: relative;
}
#slideshowimage-1:target ~ .imagecontainer {
animation: none;
transform: translateX(0px);
animation: change 3s forwards;
}
#slideshowimage-2:target ~ .imagecontainer {
animation: none;
transform: translateX(-800px);
animation: change2 3s forwards;
}
#slideshowimage-3:target ~ .imagecontainer {
transform: translateX(0);
animation: scroller 16s infinite;
}
.buttoncontainer {
position: relative;
top: -20px;
}
.button {
display: inline-block;
height: 10px;
width: 10px;
border-radius: 10px;
background-color: darkgray;
-webkit-transition: background-color 0.25s;
-moz-transition: background-color 0.25s;
-o-transition: background-color 0.25s;
-ms-transition: background-color 0.25s;
transition: background-color 0.25s;
}
.button:hover {
background-color: gray;
}
.buttonplay:after {
height: 0;
width: 0;
top: 0;
margin-left: 10px;
position: absolute;
content: ' ';
border-left: solid 13px darkgray;
border-top: solid 8px transparent;
border-bottom: solid 8px transparent;
}
<div class="slideshowcontainer">
<span id="slideshowimage-1"></span>
<span id="slideshowimage-2"></span>
<span id="slideshowimage-3"></span>
<div class="imagecontainer">
<img src="https://placehold.it/800x400" class="slideshowimage" style="width:800px;height:400px;">
<img src="https://placehold.it/900x450" class="slideshowimage" style="width:800px;height:400px;">
</div>
<div class="buttoncontainer">
</div>
</div>
I have an Animated Progress Bar that works fine, but I want to have more than one with different percentages I have had a go at this with no look I have added a jsfiddle below.
Jsfiddle Demo: https://jsfiddle.net/8sja2577/
<p><span class="subtitle"><h3>bar1</h3></span></p>
<div id="progressbar"><div id="other" ><div id="pbaranim"></div></div></div>
<p><span class="subtitle"><h3>bar2</h3></span></p>
<div id="progressbar"><div id="progress" ><div id="pbaranim"></div></div></div>
CSS
#progressbar {
width: 100%;
height: 21px;
background-color: #ccc;
padding: 2px;
margin: .6em 0;
border: 1px #000 double;
clear: both;
border-radius:20px;
}
#progress {
border-radius:20px;
background: red; /*-- Color of the bar --*/
height: 15px;
width: 0%;
max-width: 100%;
float: left;
-webkit-animation: progress 2s 1 forwards;
-moz-animation: progress 2s 1 forwards;
-ms-animation: progress 2s 1 forwards;
animation: progress 2s 1 forwards;
}
#other {
border-radius:20px;
background: red; /*-- Color of the bar --*/
height: 15px;
width: 0%;
max-width: 100%;
float: left;
-webkit-animation: progress 2s 1 forwards;
-moz-animation: progress 2s 1 forwards;
-ms-animation: progress 2s 1 forwards;
animation: progress 2s 1 forwards;
}
#pbaranim {
height: 15px;
width: 100%;
overflow: hidden;
background: url('http://www.cssdeck.com/uploads/media/items/7/7uo1osj.gif') repeat-x;
-moz-opacity: 0.25;
-khtml-opacity: 0.25;
opacity: 0.25;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=25);
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=25);
filter: alpha(opacity=25);
#-webkit-keyframes other { from { } to { width: 100% }}
#-moz-keyframes other { from { } to { width: 100% }}
#-ms-keyframes other { from { } to { width: 100% }}
#keyframes other { from { } to { width: 100% }}
#-webkit-keyframes progress { from { }to { width: 36% }}
#-moz-keyframes progress { from { } to { width: 36% }}
#-ms-keyframes progress { from { } to { width: 36% }}
#keyframes progress { from { } to { width: 36% }}
You need to change the other style to use the other animation:
#other {
border-radius:20px;
background: red;
height: 15px;
width: 0%;
max-width: 100%;
float: left;
-webkit-animation: other 2s 1 forwards;
-moz-animation: other 2s 1 forwards;
-ms-animation: other 2s 1 forwards;
animation: other 2s 1 forwards;
}
Fixed fiddle (using classes instead of ids)
Please note that ids should be unique and h3 cannot be a child of either a p or a span
Id of progressbars is uniqe , you must change other progressbars id to work it successfully
I am trying to slide an image across the screen and then stay at a fixed point. I have looked online and found a few variants on what I have but nothing seems to work.
Have a look at this fiddle.
http://jsfiddle.net/lharby/ysgzpuer/
I had to pass in
-webkit-animation: mini 2s normal;
-moz-animation: mini 3s normal;
-o-animation: mini 3s normal;
animation: mini 2s normal;
to the .mini class to animate the div.
Update: This also has the opacity animated:
http://jsfiddle.net/lharby/ysgzpuer/1/
By editing:
#-webkit-keyframes mini {
from {
left:0px;
opacity:0;
}
to{
left:404px;
opacity:1;
}
#-webkit-keyframes mini {
from {
left:-166px;
}
}
.mini {
background-image: url("http://placehold.it/150x150");
position: absolute;
top: 10px;
left: 404px;
width: 166px;
height: 70px;
z-index: 7;
-webkit-animation: mini 2s linear;
}
<div class=mini></div>
Or this if you don't have overflow: hidden on the parent to avoid the scrollbar
#-webkit-keyframes mini {
from {
left:0px;
-webkit-transform: translateX(-166px)
}
}
.mini {
background-image: url("http://placehold.it/150x150");
position: absolute;
top: 10px;
left: 404px;
width: 166px;
height: 70px;
z-index: 7;
-webkit-animation: mini 2s linear;
}
<div class=mini></div>
this will keep the last frame of the animation after its done
animation-fill-mode: forwards;
#-webkit-keyframes mini {
from{
opacity:0;
}
to{
opacity:1;
}
from {
left:0px;
}
to{
left:404px;
}
}
.frame1 {
-webkit-animation: mini 2s normal forwards;
-moz-animation: mini 30s normal forwards;
-o-animation: mini 30s normal forwards;
animation: mini 2s normal forwards;
opacity:1;
}
.mini {
background-image: url("http://blog.grio.com/wp-content/uploads/2012/09/stackoverflow.png");
position: absolute;
top: 10px;
left: -404px;
width: 166px;
height: 70px;
z-index: 7;
}
<div class="frame1 mini">
</div>
hope this is what you are looking for
Html
<div class="stage">
<figure class="ball"></figure>
</div>
CSS
#keyframes slide {
0% {
left: 0;
top: 0;
}
100% {
left: 488px;
top: 0;
}
}
.stage {
background: #eaeaed;
border-radius: 6px;
height: 150px;
position: relative;
min-width: 538px;
}
.stage:hover .ball {
animation-name: slide;
animation-duration: 2s;
animation-timing-function: ease-in-out;
animation-delay: .5s;
animation-fill-mode: forwards;
}
.stage:active .ball {
animation-play-state: paused;
}
.ball {
background: #2db34a;
border-radius: 50%;
height: 50px;
position: absolute;
width: 50px;
}
Fiddle Demo
I tried to put a "float:right" in the .skill_item_colored_main_wrap part. but it became such a mess. I think it has something to do with -webkit-animation part.
how can i modify it so it will transit from right to left?
.shortcode_skill {
position:relative;
overflow:hidden;
}
.shortcode_skill:before {
position:absolute;
top:0;
left:27%;
margin:15px 0 0;
width:1px;
height:95%;
background:rgba(0, 0, 0, .1);
content:"";
}
.skill_item {
overflow:hidden;
width:100%;
}
.skill_item > span {
float:left;
padding:24px 4.7% 0 0;
width:25%;
text-align:right;
}
.skill_item_colored_main_wrap {
float:left;
padding:15px 0 5px;
width:70%;
}
.skill_item_colored_wrap {
position:relative;
height:33px;
}
.skill_item_colored {
position:absolute;
width:100%;
height:100%;
-webkit-animation:move 2s linear .1s normal none 1 ;
-moz-animation:move 2s linear .1s normal none 1 ;
-ms-animation:move 2s linear .1s normal none 1 ;
-o-animation:move 2s linear .1s normal none 1 ;
animation:move 2s linear .1s normal none 1 ;
}
#-webkit-keyframes move {
from {width:0;}
to {width:100%;}
}
#-ms-keyframes move {
from {width:0;}
to {width:100%;}
}
#-o-keyframes move {
from {width:0;}
to {width:100%;}
}
#keyframes move {
from {width:0;}
to {width:100%;}
}
.skill_item_colored_wrap > span {
position:relative;
display:block;
}
.skill_item_colored > span {
display:block;
padding:8px 10px;
text-align:right;
-webkit-animation:opacity 2.5s linear .1s normal none 1 ;
-moz-animation:opacity 2.5s linear .1s normal none 1 ;
-ms-animation:opacity 2.5s linear .1s normal none 1 ;
-o-animation:opacity 2.5s linear .1s normal none 1 ;
animation:opacity 2.5s linear .1s normal none 1 ;
}
#-webkit-keyframes opacity {
0% {opacity:0;}
90% {opacity:0;}
100% {opacity:1;}
}
#-moz-keyframes opacity {
0% {opacity:0;}
90% {opacity:0;}
100% {opacity:1;}
}
#-ms-keyframes opacity {
0% {opacity:0;}
90% {opacity:0;}
100% {opacity:1;}
}
#-o-keyframes opacity {
0% {opacity:0;}
90% {opacity:0;}
100% {opacity:1;}
}
#keyframes opacity {
0% {opacity:0;}
90% {opacity:0;}
100% {opacity:1;}
}
<div class="skill_item">
<span>hello world </span>
<div class="skill_item_colored_main_wrap">
<div class="skill_item_colored_wrap" style="width:95%;">
<div class="skill_item_colored" style="background-color:#f97a14;">
<span>95%</span>
</div>
</div>
</div>
</div>
A quick and easy way to do this would be to rotate the parent element 180deg and then rotate the child element negative -180deg.
Assuming you want the text aligned to the left, I added text-align: left. Omit that if you want it aligned to the right.
.skill_item_colored_wrap {
transform: rotate(180deg);
}
.skill_item_colored_wrap .skill_item_colored > span {
text-align: left;
transform: rotate(-180deg);
}
.skill_item_colored_wrap {
transform: rotate(180deg);
}
.skill_item_colored_wrap .skill_item_colored > span {
text-align: left;
transform: rotate(-180deg);
}
.shortcode_skill {
position: relative;
overflow: hidden;
}
.shortcode_skill:before {
position: absolute;
top: 0;
left: 27%;
margin: 15px 0 0;
width: 1px;
height: 95%;
background: rgba(0, 0, 0, .1);
content: "";
}
.skill_item {
overflow: hidden;
width: 100%;
}
.skill_item > span {
float: left;
padding: 24px 4.7% 0 0;
width: 25%;
text-align: right;
}
.skill_item_colored_main_wrap {
float: left;
padding: 15px 0 5px;
width: 70%;
}
.skill_item_colored_wrap {
position: relative;
height: 33px;
}
.skill_item_colored {
position: absolute;
width: 100%;
height: 100%;
-webkit-animation: move 2s linear .1s normal none 1;
-moz-animation: move 2s linear .1s normal none 1;
-ms-animation: move 2s linear .1s normal none 1;
-o-animation: move 2s linear .1s normal none 1;
animation: move 2s linear .1s normal none 1;
}
#-webkit-keyframes move {
from {
width: 0;
}
to {
width: 100%;
}
}
#-ms-keyframes move {
from {
width: 0;
}
to {
width: 100%;
}
}
#-o-keyframes move {
from {
width: 0;
}
to {
width: 100%;
}
}
#keyframes move {
from {
width: 0;
}
to {
width: 100%;
}
}
.skill_item_colored_wrap > span {
position: relative;
display: block;
}
.skill_item_colored > span {
display: block;
padding: 8px 10px;
text-align: right;
-webkit-animation: opacity 2.5s linear .1s normal none 1;
-moz-animation: opacity 2.5s linear .1s normal none 1;
-ms-animation: opacity 2.5s linear .1s normal none 1;
-o-animation: opacity 2.5s linear .1s normal none 1;
animation: opacity 2.5s linear .1s normal none 1;
}
#-webkit-keyframes opacity {
0% {
opacity: 0;
}
90% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#-moz-keyframes opacity {
0% {
opacity: 0;
}
90% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#-ms-keyframes opacity {
0% {
opacity: 0;
}
90% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#-o-keyframes opacity {
0% {
opacity: 0;
}
90% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#keyframes opacity {
0% {
opacity: 0;
}
90% {
opacity: 0;
}
100% {
opacity: 1;
}
}
<div class="skill_item">
<span>hello world </span>
<div class="skill_item_colored_main_wrap">
<div class="skill_item_colored_wrap" style="width:95%;">
<div class="skill_item_colored" style="background-color:#f97a14;">
<span>95%</span>
</div>
</div>
</div>
</div>
As an alternative, you could also set direction: rtl on the .skill_item element, and then set the .skill_item_colored_main_wrap element's display to inline-block and remove float: left:
.skill_item {
overflow: hidden;
width: 100%;
direction: rtl;
}
.skill_item_colored_main_wrap {
display: inline-block;
}
.skill_item {
overflow: hidden;
width: 100%;
direction: rtl;
}
.skill_item_colored_main_wrap {
display: inline-block;
}
.shortcode_skill {
position: relative;
overflow: hidden;
}
.shortcode_skill:before {
position: absolute;
top: 0;
left: 27%;
margin: 15px 0 0;
width: 1px;
height: 95%;
background: rgba(0, 0, 0, .1);
content: "";
}
.skill_item > span {
float: left;
padding: 24px 4.7% 0 0;
width: 25%;
}
.skill_item_colored_main_wrap {
padding: 15px 0 5px;
width: 70%;
}
.skill_item_colored_wrap {
position: relative;
height: 33px;
}
.skill_item_colored {
position: absolute;
width: 100%;
height: 100%;
-webkit-animation: move 2s linear .1s normal none 1;
-moz-animation: move 2s linear .1s normal none 1;
-ms-animation: move 2s linear .1s normal none 1;
-o-animation: move 2s linear .1s normal none 1;
animation: move 2s linear .1s normal none 1;
}
#-webkit-keyframes move {
from {
width: 0;
}
to {
width: 100%;
}
}
#-ms-keyframes move {
from {
width: 0;
}
to {
width: 100%;
}
}
#-o-keyframes move {
from {
width: 0;
}
to {
width: 100%;
}
}
#keyframes move {
from {
width: 0;
}
to {
width: 100%;
}
}
.skill_item_colored_wrap > span {
position: relative;
display: block;
}
.skill_item_colored > span {
display: block;
padding: 8px 10px;
text-align: right;
-webkit-animation: opacity 2.5s linear .1s normal none 1;
-moz-animation: opacity 2.5s linear .1s normal none 1;
-ms-animation: opacity 2.5s linear .1s normal none 1;
-o-animation: opacity 2.5s linear .1s normal none 1;
animation: opacity 2.5s linear .1s normal none 1;
}
#-webkit-keyframes opacity {
0% {
opacity: 0;
}
90% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#-moz-keyframes opacity {
0% {
opacity: 0;
}
90% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#-ms-keyframes opacity {
0% {
opacity: 0;
}
90% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#-o-keyframes opacity {
0% {
opacity: 0;
}
90% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#keyframes opacity {
0% {
opacity: 0;
}
90% {
opacity: 0;
}
100% {
opacity: 1;
}
}
<div class="skill_item">
<span>hello world </span>
<div class="skill_item_colored_main_wrap">
<div class="skill_item_colored_wrap" style="width:95%;">
<div class="skill_item_colored" style="background-color:#f97a14;">
<span>95%</span>
</div>
</div>
</div>
</div>
Here an alternative,
<div class="progress">
<div class="progress-bar progress-bar-info" role="progressbar" style="width:95%%;"></div>
</div>
And add this to your CSS
.progress-middle .progress-bar {
position: relative;
}
.progress-right .progress-bar {
float: right;
}
What we did here is make sure the position is relative then float the progress-bar to right instead of left.