Commit b8025775 authored by Prakhar Agarwal's avatar Prakhar Agarwal 🎯
Browse files

added rotate anim to sidebar

parent 622e8e32
......@@ -79,7 +79,7 @@
</div>
<a id="sidebar-collapse" class="m-2" data-toggle="collapse" data-target="#sidebar">
<i class="fa fa-angle-double-left"></i>
<i class="fa fa-angle-double-left" onclick="rotate(this)"></i>
</a>
<!-- Canvas/Pd Windows -->
......@@ -92,7 +92,7 @@
<!-- Console window -->
<div class="card d-flex justify-content-between" id="console-window">
<div class="card-header d-flex justify-content-between">
<h5 class='h-100 w-25' onclick="rotate()">
<h5 class="h-100 w-25" id= "console-heading" onclick="rotate(this)">
<a data-toggle="collapse" data-parent="#windows" href="#console_bottom" class="d-flex align-items-center text-dark">Console
<i class="ml-2 fa fa-angle-double-down text-primary"S id="open-icon"></i>
</a>
......@@ -502,10 +502,15 @@
}
},
};
//Rotate Icon
function rotate() {
var icon = document.getElementById("open-icon");
icon.classList.toggle("rotate");
function rotate(elmnt) {
var cons_head = elmnt.id === "console-heading";
if (cons_head) {
document.getElementById("open-icon").classList.toggle("rotate");
} else {
elmnt.classList.toggle("rotate");
}
}
......@@ -567,16 +572,5 @@
});
</script>
<script>
$(document).ready(function(){
$("#sidebar").on('shown.bs.collapse', function () {
$("#sidebar-collapse").children("i").eq(0).addClass("fa-angle-double-left").removeClass("fa-angle-double-right")
})
$("#sidebar").on('hidden.bs.collapse', function () {
$("#sidebar-collapse").children("i").eq(0).addClass("fa-angle-double-right").removeClass("fa-angle-double-left")
})
});
</script>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment