JSFiddle - React, Tailwind, and code Playground
by Eva Nebko
HTML
<div id="menu-holder">
<div id="menu">
<div id="line-holder">
<div id="line"></div>
</div>
<div id="circle1"></div>
<div id="circle2"></div>
<div id="circle3"></div>
</div>
</div>
CSS
.transition-slow{
-webkit-transition-duration: 0.8s;
-moz-transition-duration: 0.8s;
-o-transition-duration: 0.8s;
transition-duration: 0.8s;
}
#menu-holder{
position: fixed;
bottom: 0px;
width: 100%;
height: 70px;
background-color: rgba(0,0,0,0.8);
}
#menu{
height: 50px;
width: 800px;
margin: 10px auto;
}
#line-holder{
position: absolute;
top: 35px;
height: 2px;
width: 800px;
background-color: rgb(198, 198, 198);
}
#line{
width: 0;
height: 2px;
background: rgba(255,175,75,1);
background: -moz-linear-gradient(left, rgba(255,175,75,1) 0%, rgba(255,10,59,1) 100%);
background: -webkit-gradient(left top, right top, color-stop(0%, rgba(255,175,75,1)), color-stop(100%, rgba(255,10,59,1)));
background: -webkit-linear-gradient(left, rgba(255,175,75,1) 0%, rgba(255,10,59,1) 100%);
background: -o-linear-gradient(left, rgba(255,175,75,1) 0%, rgba(255,10,59,1) 100%);
background: -ms-linear-gradient(left, rgba(255,175,75,1) 0%, rgba(255,10,59,1) 100%);
background: linear-gradient(to right, rgba(255,175,75,1) 0%, rgba(255,10,59,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffaf4b', endColorstr='#ff0a3b', GradientType=1 );
}
#circle1{
position: relative;
top: 13px;
left: 100px;
height: 20px;
width: 20px;
border-radius: 15px;
border: 3px solid #F0903A;
background-color: white;
float: left;
}
#circle2{
position: relative;
top: 13px;
left: 200px;
height: 20px;
width: 20px;
border-radius: 15px;
border: 3px solid #F0903A;
background-color: white;
float: left;
}
#circle3{
position: relative;
top: 13px;
left: 350px;
height: 20px;
width: 20px;
border-radius: 15px;
border: 3px solid #F0903A;
background-color: white;
}
JavaScript
$(document).ready(function(){
$('#circle1').click(function(){
$('#line').css('width','101px').addClass('transition-slow');
});
$('#circle2').click(function(){
$('#line').css('width','225px').addClass('transition-slow');
});
$('#circle3').click(function(){
$('#line').css('width','350px').addClass('transition-slow');
});
if ($('#line').width() = 100) {
alert('something should happen with button');
}
});