diff --git a/gallery/static/sass/components/image-view/info-tab.sass b/gallery/static/sass/components/image-view/info-tab.sass index 86fffca..537d0f1 100644 --- a/gallery/static/sass/components/image-view/info-tab.sass +++ b/gallery/static/sass/components/image-view/info-tab.sass @@ -1,5 +1,5 @@ .info-container - width: 100% + width: 25rem height: 100% display: flex @@ -9,6 +9,10 @@ background-color: RGB($bg-200) overflow-y: auto + transition: transform 0.3s cubic-bezier(.79, .14, .15, .86) + + &.collapsed + transform: translateX(-25rem) .info-tab width: 100% diff --git a/gallery/static/sass/components/image-view/view.sass b/gallery/static/sass/components/image-view/view.sass index 618d687..5bc3da4 100644 --- a/gallery/static/sass/components/image-view/view.sass +++ b/gallery/static/sass/components/image-view/view.sass @@ -7,6 +7,9 @@ .image-grid padding: 0 + width: 100% + height: 100vh + position: relative display: grid @@ -15,10 +18,11 @@ grid-template-rows: 1fr auto gap: 0 - height: 100vh - z-index: 3 + &.collapse + grid-template-columns: 0rem 1fr + #image-info grid-area: info #image-tools diff --git a/gallery/templates/image.html b/gallery/templates/image.html index de2b433..405157c 100644 --- a/gallery/templates/image.html +++ b/gallery/templates/image.html @@ -33,6 +33,20 @@ addNotification("Failed to copy link! Are you on HTTP?", 2); } } + function infoCollapse() { + let info = document.querySelector('.info-container'); + let wrapper = document.querySelector('.image-grid'); + + if (info.classList.contains('collapsed')) { + info.classList.remove('collapsed'); + wrapper.classList.remove('collapsed'); + btn.innerHTML = 'Collapse'; + } else { + info.classList.add('collapsed'); + wrapper.classList.add('collapsed'); + btn.innerHTML = 'Expand'; + } + } {% if current_user.id == image.author_id %} function imageDelete() { @@ -116,51 +130,30 @@
{% endif %} {% if current_user.id == image.author_id %}