mirror of
https://github.com/zoriya/flood.git
synced 2026-06-12 14:06:10 +00:00
styles: implement sidebar animation for smaller screens
FIXME: This is a very very hacky implementation. I hate it but I am not able to find a better solution. Simpler solutions have performance issues as there are too many elements on the page to be re-rendered.
This commit is contained in:
@@ -41,14 +41,9 @@ class ActionBar extends React.Component {
|
||||
}
|
||||
|
||||
handleSidebarChange() {
|
||||
const sidebar = document.getElementsByClassName('application__sidebar')[0];
|
||||
if (sidebar != null) {
|
||||
const expanded = window.getComputedStyle(sidebar, null).getPropertyValue('display') !== 'none';
|
||||
if (expanded) {
|
||||
sidebar.style.display = 'none';
|
||||
} else {
|
||||
sidebar.style.display = 'block';
|
||||
}
|
||||
const view = document.getElementsByClassName('application__view')[0];
|
||||
if (view != null) {
|
||||
view.classList.toggle('application__view--sidebar-alternative-state');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,36 @@ body {
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
&--sidebar-alternative-state {
|
||||
.application__sidebar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.application__sidebar {
|
||||
display: block;
|
||||
transform: translateX(120px);
|
||||
z-index: unset;
|
||||
}
|
||||
|
||||
.application__content {
|
||||
transform: translateX(120px);
|
||||
|
||||
.modal {
|
||||
transform: translateX(-240px);
|
||||
}
|
||||
|
||||
.context-menu__items {
|
||||
transform: translateX(-240px);
|
||||
}
|
||||
|
||||
.table__heading__resize-line {
|
||||
left: -240px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__content {
|
||||
@@ -37,6 +67,12 @@ body {
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
min-width: 60px;
|
||||
transition: transform 0.2s;
|
||||
|
||||
@media (max-width: 720px) {
|
||||
width: 100vw;
|
||||
transform: translateX(-120px);
|
||||
}
|
||||
}
|
||||
|
||||
&__panel {
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
transition: transform 0.2s;
|
||||
|
||||
display: block;
|
||||
@media (max-width: 720px) {
|
||||
display: none;
|
||||
transform: translateX(-120px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+5
-3
@@ -107,7 +107,12 @@ declare const styles: {
|
||||
readonly app: string;
|
||||
readonly application: string;
|
||||
readonly application__view: string;
|
||||
readonly 'application--sidebar-alternative-state': string;
|
||||
readonly application__sidebar: string;
|
||||
readonly 'application__view--sidebar-alternative-state': string;
|
||||
readonly application__content: string;
|
||||
readonly modal: string;
|
||||
readonly 'table__heading__resize-line': string;
|
||||
readonly application__panel: string;
|
||||
readonly 'application__panel--torrent-list': string;
|
||||
readonly 'is-open': string;
|
||||
@@ -310,7 +315,6 @@ declare const styles: {
|
||||
readonly tooltip__wrapper: string;
|
||||
readonly 'mediainfo__copy-button': string;
|
||||
readonly mediainfo__output: string;
|
||||
readonly modal: string;
|
||||
readonly modal__overlay: string;
|
||||
readonly 'modal--align-center': string;
|
||||
readonly modal__tabs: string;
|
||||
@@ -376,7 +380,6 @@ declare const styles: {
|
||||
readonly search: string;
|
||||
readonly textbox: string;
|
||||
readonly 'is-in-use': string;
|
||||
readonly application__sidebar: string;
|
||||
readonly 'sidebar__icon-button': string;
|
||||
readonly 'sidebar__icon-button--interactive': string;
|
||||
readonly 'sidebar__action--last': string;
|
||||
@@ -413,7 +416,6 @@ declare const styles: {
|
||||
readonly 'table__heading--fill': string;
|
||||
readonly table__heading__handle: string;
|
||||
readonly table__heading__label: string;
|
||||
readonly 'table__heading__resize-line': string;
|
||||
readonly 'table__heading__column-fill': string;
|
||||
readonly table__cell: string;
|
||||
readonly 'textbox-repeater': string;
|
||||
|
||||
Reference in New Issue
Block a user