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

added rotate anim to sidebar

parent 622e8e32
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</div> </div>
<a id="sidebar-collapse" class="m-2" data-toggle="collapse" data-target="#sidebar"> <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> </a>
<!-- Canvas/Pd Windows --> <!-- Canvas/Pd Windows -->
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
<!-- Console window --> <!-- Console window -->
<div class="card d-flex justify-content-between" id="console-window"> <div class="card d-flex justify-content-between" id="console-window">
<div class="card-header d-flex justify-content-between"> <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 <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> <i class="ml-2 fa fa-angle-double-down text-primary"S id="open-icon"></i>
</a> </a>
...@@ -502,10 +502,15 @@ ...@@ -502,10 +502,15 @@
} }
}, },
}; };
//Rotate Icon //Rotate Icon
function rotate() { function rotate(elmnt) {
var icon = document.getElementById("open-icon"); var cons_head = elmnt.id === "console-heading";
icon.classList.toggle("rotate"); if (cons_head) {
document.getElementById("open-icon").classList.toggle("rotate");
} else {
elmnt.classList.toggle("rotate");
}
} }
...@@ -567,16 +572,5 @@ ...@@ -567,16 +572,5 @@
}); });
</script> </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> </body>
</html> </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