Sidebar animation is not triggered when loading page

This commit is contained in:
reverend 2020-08-16 11:41:03 +02:00
parent 97a5052ad8
commit 7a432921d1
2 changed files with 24 additions and 8 deletions

View File

@ -53,8 +53,6 @@ body {
margin: 0; } }
@media (max-width: 650px) {
.LP-Wrapper__Site {
grid-template-columns: 0 1fr; }
@keyframes slide_out_siedebar {
from {
left: -250px; }
@ -65,6 +63,8 @@ body {
left: 0; }
to {
left: -250px; } }
.LP-Wrapper__Site {
grid-template-columns: 0 1fr; }
.LP-Main__Sidebar {
grid-area: unset;
width: 250px;
@ -74,6 +74,8 @@ body {
height: 100vh;
top: 60px;
border-right: 1px solid #C09F80; }
.LP-Main__Sidebar--hidden {
visibility: hidden; }
#toggle_sidebar:checked ~ .LP-Main__Sidebar {
animation-name: slide_out_siedebar;
animation-duration: .3s;
@ -87,7 +89,7 @@ body {
z-index: 20;
height: 60px;
width: 60px;
background-image: url("icons/hamburger_menu.svg");
background-image: url("/icons/hamburger_menu.svg");
background-repeat: no-repeat;
background-clip: content-box;
background-position: center;
@ -271,19 +273,19 @@ body {
overflow: hidden; }
.LP-Message--error .LP-Message__Icon {
background-color: #02979e;
background-image: url("icons/error.png"); }
background-image: url("/icons/error.png"); }
.LP-Message--warning .LP-Message__Icon {
background-color: #0047e7;
background-image: url("icons/error.png"); }
background-image: url("/icons/error.png"); }
.LP-Message--info .LP-Message__Icon {
background-color: #522719;
background-image: url("icons/information.svg"); }
background-image: url("/icons/information.svg"); }
.LP-Message--success .LP-Message__Icon {
background-color: #6937ff;
background-image: url("icons/success.svg"); }
background-image: url("/icons/success.svg"); }
.LP-Message--debug .LP-Message__Icon {
background-color: #046a2f;
background-image: url("icons/debug.png"); }
background-image: url("/icons/debug.png"); }
.LP-Message .LP-Message__Icon {
background-size: 40px 40px;
background-repeat: no-repeat;

View File

@ -12,6 +12,20 @@
{% block additional_head %}
{% endblock additional_head %}
<script>
document.addEventListener("DOMContentLoaded", function(){
Array.from(document.getElementsByClassName('LP-Main__Sidebar')).forEach(function(element){
element.classList.add('LP-Main__Sidebar--hidden')
})
setTimeout(function(){
Array.from(document.getElementsByClassName('LP-Main__Sidebar')).forEach(function(element){
element.classList.remove('LP-Main__Sidebar--hidden')
})
}, 500)
})
</script>
</head>
<body>