From 2211da243d6cd90ec037d9a38848650a0130cf1e Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Tue, 5 Jan 2021 18:13:57 +0100 Subject: [PATCH] Globally rendering the app via React --- shared/css/static/frame-chat.scss | 1 + shared/css/static/main-layout.scss | 203 +----------------- shared/html/templates.html | 30 --- shared/js/ConnectionHandler.ts | 68 +++--- shared/js/ConnectionManager.ts | 21 +- shared/js/main.tsx | 17 +- shared/js/tree/ChannelTree.tsx | 21 +- shared/js/ui/AppController.ts | 115 ++++++++++ shared/js/ui/AppDefinitions.ts | 11 + shared/js/ui/AppRenderer.scss | 68 ++++++ shared/js/ui/AppRenderer.tsx | 114 ++++++++++ shared/js/ui/frames/HostBannerRenderer.scss | 2 + shared/js/ui/frames/SideBarController.ts | 11 +- shared/js/ui/frames/SideBarRenderer.scss | 2 + shared/js/ui/frames/SideBarRenderer.tsx | 5 +- .../connection-handler-list/Controller.ts | 14 +- shared/js/ui/frames/control-bar/Renderer.tsx | 2 +- shared/js/ui/frames/footer/Renderer.scss | 25 ++- shared/js/ui/frames/footer/Renderer.tsx | 1 + shared/js/ui/frames/log/Renderer.scss | 13 +- shared/js/ui/frames/side/HeaderController.ts | 2 +- shared/js/ui/tree/Controller.tsx | 34 +-- 22 files changed, 447 insertions(+), 333 deletions(-) create mode 100644 shared/js/ui/AppController.ts create mode 100644 shared/js/ui/AppDefinitions.ts create mode 100644 shared/js/ui/AppRenderer.scss create mode 100644 shared/js/ui/AppRenderer.tsx diff --git a/shared/css/static/frame-chat.scss b/shared/css/static/frame-chat.scss index 9f0fba27..64b8e6e7 100644 --- a/shared/css/static/frame-chat.scss +++ b/shared/css/static/frame-chat.scss @@ -3,6 +3,7 @@ /* FIXME: Resolve variable usage! */ html:root { + --side-background: #353535; --side-info-background: #2e2e2e; --side-info-shadow: rgba(0, 0, 0, 0.25); --side-info-title: #8b8b8b; diff --git a/shared/css/static/main-layout.scss b/shared/css/static/main-layout.scss index d65b1a08..ec1c50a4 100644 --- a/shared/css/static/main-layout.scss +++ b/shared/css/static/main-layout.scss @@ -7,8 +7,6 @@ $animation_length: .5s; html:root { --app-background: #1e1e1e; - --control-bar-background: #454545; - --chat-background: #353535; --channel-tree-background: #353535; --server-log-background: #353535; @@ -20,201 +18,16 @@ html:root { --channel-chat-seperator-selected: #707070; } -.app { - min-width: 600px; - min-height: 330px; +.hide-small { + opacity: 1; + transition: opacity $animation_length linear; +} - padding: 5px; +.show-small { + display: none; - .container-app-main { - height: 100%; - width: 100%; - - min-height: 500px; - margin-top: 5px; - - position: relative; - display: flex; - flex-direction: column; - justify-content: stretch; - - - .container-channel-chat { - height: 80%; /* "default" settings */ - width: 100%; - - min-height: 27em; /* fits with the music bot interface */ - min-width: 100px; - - display: flex; - flex-direction: row; - justify-content: stretch; - - & > * { - height: 100%; - min-height: 250px; - - border-radius: 5px; - } - - > .container-channel-tree { - width: 50%; /* "default" settings */ - height: 100%; - - background: var(--channel-tree-background); - min-width: 200px; - - display: flex; - flex-direction: column; - justify-content: stretch; - - min-height: 100px; - - overflow: hidden; - - > .hostbanner { - flex-grow: 0; - flex-shrink: 0; - - max-height: 9em; /* same size as the info pannel */ - - display: flex; - flex-direction: column; - justify-content: stretch; - } - - > .channel-tree { - min-height: 5em; - - flex-grow: 1; - flex-shrink: 1; - - .channel-tree-container { - height: 100%; - flex-grow: 1; - flex-shrink: 1; - overflow: hidden; - overflow-y: auto; - } - } - } - - > .container-chat { - width: 50%; /* "default" settings */ - height: 100%; - - background: var(--chat-background); - min-width: 350px; - - display: flex; - flex-direction: column; - justify-content: stretch; - } - } - - - > .container-bottom { - height: 20%; - - min-height: 1.5em; - width: 100%; - - display: flex; - flex-direction: column; - justify-content: stretch; - - > .container-server-log { - display: flex; - flex-direction: column; - justify-content: stretch; - - flex-shrink: 1; - flex-grow: 1; - - min-height: 0; - width: 100%; - - overflow: hidden; - - border-radius: 5px 5px 0 0; - - padding-right: 5px; - padding-left: 5px; - - background: var(--server-log-background); - } - - > .container-footer { - flex-shrink: 0; - flex-grow: 0; - - height: 1.5em; - - background: var(--footer-background); - color: var(--footer-text); - - border-radius: 0 0 5px 5px; - padding-right: 5px; - padding-left: 5px; - padding-top: 2px; - - -webkit-box-shadow: inset 0 2px 5px 0 rgba(0,0,0,0.125); - -moz-box-shadow: inset 0 2px 5px 0 rgba(0,0,0,0.125); - box-shadow: inset 0 2px 5px 0 rgba(0,0,0,0.125); - - display: flex; - flex-direction: row; - justify-content: space-between; - - > * { - align-self: center; - } - - > span { - display: flex; - flex-direction: row; - justify-content: flex-start; - - > a { - margin-right: .5em; - } - } - - a[href], a[href]:visited { - color: var(--footer-text)!important; - } - } - } - } - - .container-control-bar { - z-index: 200; - - flex-shrink: 0; - - border-radius: 5px; - - height: 2em; - width: 100%; - - background-color: var(--control-bar-background); - - display: flex; - flex-direction: column; - justify-content: center; - } - - .hide-small { - opacity: 1; - transition: opacity $animation_length linear; - } - - .show-small { - display: none; - - opacity: 0; - transition: opacity $animation_length linear; - } + opacity: 0; + transition: opacity $animation_length linear; } .app-container { diff --git a/shared/html/templates.html b/shared/html/templates.html index 430340cc..a645b952 100644 --- a/shared/html/templates.html +++ b/shared/html/templates.html @@ -7,36 +7,6 @@