JSFiddle - React, Tailwind, and code Playground
by envira
HTML
<div class="buzzthemepanel">
<div class="buzzthemebutton">Color Panel</div>
<div class="buzzthemeoptions">[The Site Map Goes Here]</div>
</div>
CSS
.buzzthemepanel {
width:200px;
position:fixed;
left:-200px;
top:60px;
display:block;
color:#FFF;
z-index:2;
opacity: 0.95;
}
.buzzthemepanel .buzzthemebutton {
display:block;
color:#333;
background-color:#ACACAC;
padding:2px 5px;
height:20px;
width:70px;
text-align:center;
position:relative;
left: 100%;
margin-top:30px;
cursor:pointer;
transform-origin: 0% 0%;
-ms-transform-origin: 0% 0%;
-webkit-transform-origin: 0% 0%;
-moz-transform-origin: 0% 0%;
-o-transform-origin: 0% 0%;
transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
}
.buzzthemepanel .buzzthemeoptions {
width:100%;
height:350px;
background-color:#666;
margin-top:-104px;
}
JavaScript
$(document).ready(function() {
$('.buzzthemebutton').click(function() {
var mapPos = parseInt($('.buzzthemepanel').css('left'), 10);
if (mapPos < 0) {
$('.buzzthemepanel').animate({
left: '+=200'
}, 458, 'swing', function() {
// Animation complete.
});
}
else {
$('.buzzthemepanel').animate({
left: '-=200'
}, 458, 'swing', function() {
// Animation complete.
});
}
});
});