diff --git a/files.php b/files.php index 92983355..97b7dd72 100644 --- a/files.php +++ b/files.php @@ -9,6 +9,24 @@ "path" => "./", "local-path" => "./shared/html/" ], + + [ /* javascript loader */ + "type" => "js", + "search-pattern" => "/.*\.js$/", + "build-target" => "dev", + + "path" => "loader/", + "local-path" => "./shared/loader/" + ], + [ /* javascript loader for releases */ + "type" => "js", + "search-pattern" => "/.*loader_[\S]+.min.js$/", + "build-target" => "rel", + + "path" => "loader/", + "local-path" => "./shared/generated/" + ], + [ /* shared javascript files (WebRTC adapter) */ "type" => "js", "search-pattern" => "/.*\.js$/", @@ -17,6 +35,7 @@ "path" => "adapter/", "local-path" => "./shared/adapter/" ], + [ /* shared javascript files (development mode only) */ "type" => "js", "search-pattern" => "/.*\.js$/", @@ -36,6 +55,7 @@ "local-path" => "./shared/js/", "req-parm" => ["--mappings"] ], + [ /* shared generated worker codec */ "type" => "js", "search-pattern" => "/(WorkerPOW.js)$/", @@ -231,16 +251,6 @@ "path" => "js/", "local-path" => "./web/generated/" ], - [ /* Add the shared generated files. Exclude the shared file because we're including it already */ - "web-only" => true, - "type" => "js", - "search-pattern" => "/.*\.js$/", - "search-exclude" => "/shared\.js(.map)?$/", - "build-target" => "rel", - - "path" => "js/", - "local-path" => "./shared/generated/" - ], [ /* web css files */ "web-only" => true, "type" => "css", diff --git a/package.json b/package.json index 1069de96..2598dbfd 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "ttsc": "ttsc", "csso": "csso", "rebuild-structure-web-dev": "php files.php generate web dev", - "minify-web-rel-file": "minify web/generated/client.js --outFile web/generated/client.min.js --evaluate --removeDebugger --undefinedToVoid --mangle.keepClassName --deadcode.keepFnArgs" + "minify-web-rel-file": "terser --compress --mangle --ecma 6 --keep_classnames --keep_fnames --output" }, "author": "TeaSpeak (WolverinDEV)", "license": "ISC", @@ -25,15 +25,15 @@ "@types/node": "^12.7.2", "@types/sha256": "^0.2.0", "@types/websocket": "0.0.40", - "babel-minify": "^0.5.1", + "clean-css": "^4.2.1", "csso-cli": "^2.0.2", "gulp": "^4.0.2", "sass": "^1.22.10", "sha256": "^0.2.0", + "terser": "^4.2.1", "ttypescript": "^1.5.7", "typescript": "^3.5.3", - "wat2wasm": "^1.0.2", - "clean-css": "^4.2.1" + "wat2wasm": "^1.0.2" }, "repository": { "type": "git", diff --git a/scripts/build_declarations.sh b/scripts/build_declarations.sh index 747d5b21..9e97fc26 100755 --- a/scripts/build_declarations.sh +++ b/scripts/build_declarations.sh @@ -61,4 +61,7 @@ fi #Last but not least the client imports generate_link shared/declarations/exports.d.ts web/declarations/imports_shared.d.ts -generate_link shared/declarations/exports.d.ts client/declarations/imports_shared.d.ts \ No newline at end of file +generate_link shared/declarations/exports_loader_app.d.ts web/declarations/imports_shared_loader.d.ts + +generate_link shared/declarations/exports.d.ts client/declarations/imports_shared.d.ts +generate_link shared/declarations/exports_loader_app.d.ts client/declarations/imports_shared_loader.d.ts \ No newline at end of file diff --git a/shared/css/generate_packed.sh b/shared/css/generate_packed.sh new file mode 100755 index 00000000..ec0ba838 --- /dev/null +++ b/shared/css/generate_packed.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash + +cd $(dirname $0) +#find css/static/ -name '*.css' -exec cat {} \; | npm run csso -- --output `pwd`/generated/static/base.css + +#File order +files=( + "css/static/main-layout.css" + "css/static/helptag.css" + "css/static/scroll.css" + "css/static/channel-tree.css" + "css/static/ts/tab.css" + "css/static/ts/chat.css" + "css/static/ts/icons.css" + "css/static/ts/icons_em.css" + "css/static/ts/country.css" + "css/static/general.css" + "css/static/modal.css" + "css/static/modals.css" + "css/static/modal-about.css" + "css/static/modal-avatar.css" + "css/static/modal-icons.css" + "css/static/modal-bookmarks.css" + "css/static/modal-connect.css" + "css/static/modal-channel.css" + "css/static/modal-query.css" + "css/static/modal-invite.css" + "css/static/modal-playlist.css" + "css/static/modal-banlist.css" + "css/static/modal-bancreate.css" + "css/static/modal-clientinfo.css" + "css/static/modal-serverinfo.css" + "css/static/modal-identity.css" + "css/static/modal-settings.css" + "css/static/modal-poke.css" + "css/static/modal-server.css" + "css/static/modal-keyselect.css" + "css/static/modal-permissions.css" + "css/static/modal-group-assignment.css" + "css/static/music/info_plate.css" + "css/static/frame/SelectInfo.css" + "css/static/control_bar.css" + "css/static/context_menu.css" + "css/static/frame-chat.css" + "css/static/connection_handlers.css" + "css/static/server-log.css" + "css/static/htmltags.css" + "css/static/hostbanner.css" + "css/static/menu-bar.css" +) + +target_file=`pwd`/../generated/static/base.css +echo "/* Auto generated merged CSS file */" > ${target_file} +for file in "${files[@]}"; do + if [[ ${file} =~ css/* ]]; then + file="./${file:4}" + fi + cat ${file} >> ${target_file} +done + +cat ${target_file} | npm run csso -- --output `pwd`/../generated/static/base.css \ No newline at end of file diff --git a/shared/css/loader/loader.scss b/shared/css/loader/loader.scss index 34e70e0e..f9ec5b67 100644 --- a/shared/css/loader/loader.scss +++ b/shared/css/loader/loader.scss @@ -1,300 +1,362 @@ -$thickness : 5px; -$duration : 2500; -$delay : $duration/6; +$thickness: 5px; +$duration: 2500; +$delay: $duration/6; $background: #222222; -@mixin polka($size, $dot, $base, $accent){ - background: $base; - background-image: radial-gradient($accent $dot, transparent 0); - background-size:$size $size; - background-position: 0 -2.5px; +@mixin polka($size, $dot, $base, $accent) { + background: $base; + background-image: radial-gradient($accent $dot, transparent 0); + background-size: $size $size; + background-position: 0 -2.5px; } .loader { - margin: 0; + margin: 0; - display: block; - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; + display: block; + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; - z-index: 900; - text-align: center; + z-index: 900; + text-align: center; } .loader .half { - position: fixed; - background: #222222; - top: 0; - bottom: 0; - width: 50%; - height: 100%; + position: fixed; + background: #222222; + top: 0; + bottom: 0; + width: 50%; + height: 100%; } .loader .half.right { - right: 0; + right: 0; } + .loader .half.left { - left: 0; + left: 0; } .bookshelf_wrapper { - position: relative; - top: 40%; - left: 50%; - transform: translate(-50%, -50%); + position: relative; + top: 40%; + left: 50%; + transform: translate(-50%, -50%); } .books_list { - margin: 0 auto; - width: 300px; - padding: 0; + margin: 0 auto; + width: 300px; + padding: 0; } .book_item { - position: absolute; - top: -120px; - box-sizing: border-box; - list-style: none; - width: 40px; - height: 120px; - opacity: 0; - background-color: #1e6cc7; - border: $thickness solid white; - transform-origin: bottom left; - transform: translateX(300px); - animation: travel #{$duration}ms linear infinite; + position: absolute; + top: -120px; + box-sizing: border-box; + list-style: none; + width: 40px; + height: 120px; + opacity: 0; + background-color: #1e6cc7; + border: $thickness solid white; + transform-origin: bottom left; + transform: translateX(300px); + animation: travel #{$duration}ms linear infinite; - &.first { - top: -140px; - height: 140px; + &.first { + top: -140px; + height: 140px; - &:before, - &:after { - content:''; - position: absolute; - top: 10px; - left: 0; - width: 100%; - height: $thickness; - background-color: white; - } + &:before, + &:after { + content: ''; + position: absolute; + top: 10px; + left: 0; + width: 100%; + height: $thickness; + background-color: white; + } - &:after { - top: initial; - bottom: 10px; - } - } + &:after { + top: initial; + bottom: 10px; + } + } - &.second, - &.fifth { - &:before, - &:after { - box-sizing: border-box; - content:''; - position: absolute; - top: 10px; - left: 0; - width: 100%; - height: $thickness*3.5; - border-top: $thickness solid white; - border-bottom: $thickness solid white; - } + &.second, + &.fifth { + &:before, + &:after { + box-sizing: border-box; + content: ''; + position: absolute; + top: 10px; + left: 0; + width: 100%; + height: $thickness*3.5; + border-top: $thickness solid white; + border-bottom: $thickness solid white; + } - &:after { - top: initial; - bottom: 10px; - } - } + &:after { + top: initial; + bottom: 10px; + } + } - &.third { - &:before, - &:after { - box-sizing: border-box; - content:''; - position: absolute; - top: 10px; - left: 9px; - width: 12px; - height: 12px; - border-radius: 50%; - border: $thickness solid white; - } + &.third { + &:before, + &:after { + box-sizing: border-box; + content: ''; + position: absolute; + top: 10px; + left: 9px; + width: 12px; + height: 12px; + border-radius: 50%; + border: $thickness solid white; + } - &:after { - top: initial; - bottom: 10px; - } - } + &:after { + top: initial; + bottom: 10px; + } + } - &.fourth { - top: -130px; - height: 130px; + &.fourth { + top: -130px; + height: 130px; - &:before { - box-sizing: border-box; - content:''; - position: absolute; - top: 46px; - left: 0; - width: 100%; - height: $thickness*3.5; - border-top: $thickness solid white; - border-bottom: $thickness solid white; - } - } + &:before { + box-sizing: border-box; + content: ''; + position: absolute; + top: 46px; + left: 0; + width: 100%; + height: $thickness*3.5; + border-top: $thickness solid white; + border-bottom: $thickness solid white; + } + } - &.fifth { - top: -100px; - height: 100px; - } + &.fifth { + top: -100px; + height: 100px; + } - &.sixth { - top: -140px; - height: 140px; + &.sixth { + top: -140px; + height: 140px; - &:before { - box-sizing: border-box; - content:''; - position: absolute; - bottom: 31px; - left: 0px; - width: 100%; - height: $thickness; - background-color: white; - } + &:before { + box-sizing: border-box; + content: ''; + position: absolute; + bottom: 31px; + left: 0px; + width: 100%; + height: $thickness; + background-color: white; + } - &:after { - box-sizing: border-box; - content:''; - position: absolute; - bottom: 10px; - left: 9px; - width: 12px; - height: 12px; - border-radius: 50%; - border: $thickness solid white; - } - } + &:after { + box-sizing: border-box; + content: ''; + position: absolute; + bottom: 10px; + left: 9px; + width: 12px; + height: 12px; + border-radius: 50%; + border: $thickness solid white; + } + } - &:nth-child(2) { - animation-delay: #{$delay*1}ms; - } + &:nth-child(2) { + animation-delay: #{$delay*1}ms; + } - &:nth-child(3) { - animation-delay: #{$delay*2}ms; - } + &:nth-child(3) { + animation-delay: #{$delay*2}ms; + } - &:nth-child(4) { - animation-delay: #{$delay*3}ms; - } + &:nth-child(4) { + animation-delay: #{$delay*3}ms; + } - &:nth-child(5) { - animation-delay: #{$delay*4}ms; - } + &:nth-child(5) { + animation-delay: #{$delay*4}ms; + } - &:nth-child(6) { - animation-delay: #{$delay*5}ms; - } + &:nth-child(6) { + animation-delay: #{$delay*5}ms; + } } .shelf { - width: 300px; - height: $thickness; - margin: 0 auto; - background-color: white; - position: relative; + width: 300px; + height: $thickness; + margin: 0 auto; + background-color: white; + position: relative; - &:before, - &:after { - content:''; - position : absolute; - width: 100%; - height: 100%; - @include polka(10px, 30%, $background, rgba(255,255,255,0.5)); - top: 200%; - left: 5%; - animation: move #{$duration/10}ms linear infinite; - } + &:before, + &:after { + content: ''; + position: absolute; + width: 100%; + height: 100%; + @include polka(10px, 30%, $background, rgba(255, 255, 255, 0.5)); + top: 200%; + left: 5%; + animation: move #{$duration/10}ms linear infinite; + } - &:after { - top: 400%; - left: 7.5%; - } + &:after { + top: 400%; + left: 7.5%; + } } @keyframes move { - from { - background-position-x: 0; - } + from { + background-position-x: 0; + } - to { - background-position-x: 10px; - } + to { + background-position-x: 10px; + } } @keyframes travel { - 0% { - opacity: 0; - transform: translateX(300px) rotateZ(0deg) scaleY(1); - } + 0% { + opacity: 0; + transform: translateX(300px) rotateZ(0deg) scaleY(1); + } - 6.5% { - transform: translateX(279.5px) rotateZ(0deg) scaleY(1.1); - } + 6.5% { + transform: translateX(279.5px) rotateZ(0deg) scaleY(1.1); + } - 8.8% { - transform: translateX(273.6px) rotateZ(0deg) scaleY(1); - } + 8.8% { + transform: translateX(273.6px) rotateZ(0deg) scaleY(1); + } - 10% { - opacity: 1; - transform: translateX(270px) rotateZ(0deg); - } + 10% { + opacity: 1; + transform: translateX(270px) rotateZ(0deg); + } - 17.6% { - transform: translateX(247.2px) rotateZ(-30deg); - } + 17.6% { + transform: translateX(247.2px) rotateZ(-30deg); + } - 45% { - transform: translateX(165px) rotateZ(-30deg); - } + 45% { + transform: translateX(165px) rotateZ(-30deg); + } - 49.5% { - transform: translateX(151.5px) rotateZ(-45deg); - } + 49.5% { + transform: translateX(151.5px) rotateZ(-45deg); + } - 61.5% { - transform: translateX(115.5px) rotateZ(-45deg); - } + 61.5% { + transform: translateX(115.5px) rotateZ(-45deg); + } - 67% { - transform: translateX(99px) rotateZ(-60deg); - } + 67% { + transform: translateX(99px) rotateZ(-60deg); + } - 76% { - transform: translateX(72px) rotateZ(-60deg); - } + 76% { + transform: translateX(72px) rotateZ(-60deg); + } - 83.5% { - opacity: 1; - transform: translateX(49.5px) rotateZ(-90deg); - } + 83.5% { + opacity: 1; + transform: translateX(49.5px) rotateZ(-90deg); + } - 90% { - opacity: 0; - } + 90% { + opacity: 0; + } - 100% { - opacity: 0; - transform: translateX(0px) rotateZ(-90deg); - } + 100% { + opacity: 0; + transform: translateX(0px) rotateZ(-90deg); + } +} + +/* Automated loader timeout */ +$loader_timeout: 2.5s; +.loader:not(.started) { + &, & > .half, & > .bookshelf_wrapper { + -moz-animation: _loader_hide 0s ease-in $loader_timeout forwards; + -webkit-animation: _loader_hide 0s ease-in $loader_timeout forwards; + -o-animation: _loader_hide 0s ease-in $loader_timeout forwards; + animation: _loader_hide 0s ease-in $loader_timeout forwards; + -webkit-animation-fill-mode: forwards; + animation-fill-mode: forwards; + } +} + +.loader:not(.started) + #critical-load { + display: block !important; + opacity: 0; + + -moz-animation: _loader_show 0s ease-in $loader_timeout forwards; + -webkit-animation: _loader_show 0s ease-in $loader_timeout forwards; + -o-animation: _loader_show 0s ease-in $loader_timeout forwards; + animation: _loader_show 0s ease-in $loader_timeout forwards; + -webkit-animation-fill-mode: forwards; + animation-fill-mode: forwards; + + .error::before { + content: 'Failed to startup app loader!'; + } + + .detail::before { + content: 'Lookup the console for more details'; + } +} + +@keyframes _loader_hide { + to { + width: 0; + height: 0; + overflow: hidden; + } +} + +@-webkit-keyframes _loader_hide { + to { + width: 0; + height: 0; + visibility: hidden; + } +} + +@keyframes _loader_show { + to { + opacity: 1; + } +} + +@-webkit-keyframes _loader_show { + to { + opacity: 1; + } } \ No newline at end of file diff --git a/shared/css/static/frame-chat.scss b/shared/css/static/frame-chat.scss index f91e468a..10a60d86 100644 --- a/shared/css/static/frame-chat.scss +++ b/shared/css/static/frame-chat.scss @@ -51,11 +51,21 @@ $client_info_avatar_size: 10em; &.right { text-align: right; + + &.mode-client_info { + max-width: calc(50% - #{$client_info_avatar_size / 2}); + margin-left: calc(#{$client_info_avatar_size / 2}); + } } &.left { text-align: left; padding-right: 10px; + + &.mode-client_info { + max-width: calc(50% - #{$client_info_avatar_size / 2}); + margin-right: calc(#{$client_info_avatar_size} / 2); + } } .title, .value, .small-value { @@ -167,11 +177,6 @@ $client_info_avatar_size: 10em; } @include transition(background-color $button_hover_animation_time ease-in-out); } - - &.mode-client_info { - min-width: 50%; - margin-right: calc(#{$client_info_avatar_size} / 2); - } } } } @@ -507,6 +512,21 @@ $client_info_avatar_size: 10em; flex-direction: column; min-height: 2em; + + .container-typing { + font-size: .85em; + padding-left: .6em; + line-height: 1; + color: hsla(0, 0%, 30%, 1); + + opacity: 1; + + &.hidden { + opacity: 0; + } + + @include transition($button_hover_animation_time ease-in-out); + } } } @@ -1201,8 +1221,6 @@ $client_info_avatar_size: 10em; } } - - .button-close { font-size: 4em; @@ -1243,6 +1261,32 @@ $client_info_avatar_size: 10em; transform: rotate(-45deg); } } + + .button-more { + flex-grow: 0; + flex-shrink: 0; + + height: 1.5em; + font-size: 1.25em; + + text-align: center; + + color: #999999; + cursor: pointer; + + margin-left: -5px; + margin-right: -5px; + + background-color: #2d2d2d; + + border-bottom-right-radius: 5px; + border-bottom-left-radius: 5px; + + &:hover { + background-color: #393939; + } + @include transition($button_hover_animation_time ease-in-out); + } } .container-private-conversations, .container-channel-chat { diff --git a/shared/css/static/hostbanner.scss b/shared/css/static/hostbanner.scss index ebedfe4b..18e7db2a 100644 --- a/shared/css/static/hostbanner.scss +++ b/shared/css/static/hostbanner.scss @@ -1,6 +1,6 @@ @import "./mixin.scss"; -#hostbanner { +.hostbanner { .container-hostbanner { position: relative; diff --git a/shared/css/static/modal-clientinfo.scss b/shared/css/static/modal-clientinfo.scss new file mode 100644 index 00000000..6d281273 --- /dev/null +++ b/shared/css/static/modal-clientinfo.scss @@ -0,0 +1,618 @@ +@import "mixin"; +@import "properties"; + +.modal-body.modal-client-info { + padding: 0!important; + + $avatar_size: 12em; + .head { + flex-shrink: 0; + flex-grow: 0; + + z-index: 1; + + height: 7em; + background-color: #212125; + + .status-row { + flex-shrink: 0; + flex-grow: 0; + + display: flex; + flex-direction: row; + justify-content: flex-start; + + .status-entry { + font-size: 1.5em; + + margin: .25em; + + width: 1em; + height: 1em; + } + } + + .container-away-message { + $offset_left: (.25em) * 1.5 /* 1.5 is the font size of the icons */; + + position: relative; + margin-left: $offset_left; + margin-top: .25em; + + background-color: #1c1c1c; + border: 1px solid #161515; + border-radius: 3px; + + max-width: calc(50% - #{$avatar_size / 2 + $offset_left + 1em}); /* do actual 1em space to the avatar */ + max-height: 4em; /* else it will overflow the header */ + + display: flex; + flex-direction: column; + justify-content: start; + + width: max-content; + padding: .15em; + + overflow: hidden; + + //A verry long away message, because I want to tell a story. There was a child.... + a { + font-size: .85em; + } + + &:hover { + max-height: 200em; + } + + @include transition(.5s ease-in-out); + } + } + + .body { + flex-shrink: 1; + flex-grow: 0; + + //TODO: Min height here! + + display: flex; + flex-direction: column; + justify-content: stretch; + + background-color: #2f2f35; + + .container-avatar { + z-index: 2; /* overlay the header */ + + flex-grow: 0; + flex-shrink: 0; + + position: relative; + display: inline-block; + margin: calc(#{$avatar_size} / -2) 0.75em 0.5em 0.5em; + align-self: center; + + .avatar { + height: $avatar_size; + width: $avatar_size; + + border-radius: 50%; + overflow: hidden; + } + } + + .container-name { + flex-grow: 0; + flex-shrink: 0; + + display: flex; + flex-direction: row; + justify-content: center; + + .htmltag-client { + text-align: center; + font-size: 1.5em; + color: #cccccc; + font-weight: bold; + } + } + + .container-description { + flex-grow: 0; + flex-shrink: 0; + + padding-right: calc(10em / 2); + padding-left: calc(10em / 2); + + text-align: center; + + display: flex; + flex-direction: column; + justify-content: stretch; + + .client-description { + color: #6f6f6f; + max-width: 100%; + flex-shrink: 1; + flex-grow: 1; + overflow-wrap: break-word; + } + } + + + .container-categories { + margin-top: 1em; + + display: flex; + flex-direction: column; + justify-content: stretch; + + min-height: 14em; + + .categories { + height: 2.5em; + + flex-grow: 0; + flex-shrink: 0; + + display: flex; + flex-direction: row; + justify-content: stretch; + + padding-left: 2.5em; + padding-right: 2.5em; + + border-bottom: 1px solid #1d1d1d; + + .entry { + padding: .5em; + + text-align: center; + + flex-grow: 1; + flex-shrink: 1; + + cursor: pointer; + + &:hover { + color: #b6c4d6; + } + + &.selected { + border-bottom: 3px solid #245184; + margin-bottom: -2px; + + color: #245184; + } + + @include transition(color $button_hover_animation_time, border-bottom-color $button_hover_animation_time); + } + } + + .bodies { + position: relative; + + flex-shrink: 1; + flex-grow: 1; + + display: flex; + justify-content: stretch; + + padding-left: .5em; + padding-right: .5em; + + min-height: 10em; + height: 21em; /* body size 20 + .5 padding */ + + .container-tooltip { + flex-shrink: 0; + flex-grow: 0; + + font-size: .8em; /* shrink the tip a bit */ + + position: relative; + width: 1.6em; + margin-left: .5em; + + display: flex; + flex-direction: column; + justify-content: center; + + img { + height: 1em; + width: 1em; + + align-self: center; + font-size: 1.2em; + } + + .tooltip { + display: none; + } + } + + .body { + position: absolute; + + top: 0; + left: 0; + right: 0; + bottom: 0; + + padding: .5em; + + display: flex; + justify-content: stretch; + + overflow: auto; /* else the tooltip will trigger the scrollbar */ + @include chat-scrollbar-vertical(); + + &.hidden { + display: none; + } + + &.container-basic { + flex-direction: row; + + .spacer { + flex-grow: 0; + flex-shrink: 0; + width: 1em; + } + + .left, .right { + height: 20em; + width: calc(50% - .5em); /* the spacer in the middle thats why -.5 em */ + + flex-grow: 1; + flex-shrink: 1; + + + border-radius: .2em; + border: 1px solid #1f2122; + background-color: #28292b; + padding: .5em; + + .property { + flex-shrink: 0; + flex-grow: 0; + + display: flex; + flex-direction: column; + justify-content: flex-start; + + .title, .value { + display: flex; + flex-direction: row; + justify-content: stretch; + + white-space: nowrap; + overflow: hidden; + + > * { + flex-shrink: 0; + flex-grow: 0; + + align-self: center; + } + + a { + flex-shrink: 1; + + overflow: hidden; + text-overflow: ellipsis; + } + } + + .title { + color: #254d7b; + text-transform: uppercase; + } + + .value { + color: #bdbdbd; + + a, a:visited { + color: #bdbdbd!important; + } + + .button { + width: 1.6em; + height: 1.6em; + + display: flex; + flex-direction: column; + justify-content: space-around; + + cursor: pointer; + opacity: .5; + + > div { + align-self: center; + } + + &:hover { + opacity: 1; + } + + @include transition($button_hover_animation_time ease-in-out); + } + + .country { + margin-right: .25em; + } + } + + &:not(:first-of-type) { + margin-top: .5em; + } + + &.property-unique-id, &.property-ip { + .value { + justify-content: space-between; + } + } + + &.property-version { + .a-on { + flex-shrink: 0; + flex-grow: 0; + margin-left: .25em; + margin-right: .25em; + } + } + } + } + } + + &.container-packets { + flex-direction: row; + + .spacer { + flex-grow: 0; + flex-shrink: 0; + width: 1em; + } + + .left, .right { + height: 20em; + width: calc(50% - .5em); /* the spacer in the middle thats why -.5 em */ + + flex-grow: 1; + flex-shrink: 1; + + + border-radius: .2em; + border: 1px solid #1f2122; + background-color: #28292b; + padding: .5em; + + .statistic { + flex-shrink: 0; + flex-grow: 0; + + display: flex; + flex-direction: column; + justify-content: flex-start; + + .title, .upstream, .downstream { + display: flex; + flex-direction: row; + justify-content: stretch; + + white-space: nowrap; + overflow: hidden; + + > * { + flex-shrink: 0; + flex-grow: 0; + + align-self: center; + } + + a { + flex-shrink: 1; + + overflow: hidden; + text-overflow: ellipsis; + } + } + + .title { + color: #254d7b; + text-transform: uppercase; + } + + .upstream, .downstream { + padding-top: .25em; + + + display: flex; + flex-direction: row; + justify-content: space-between; + + > a { + align-self: center; + } + } + + .upstream { + color: #fd3913; + } + + .downstream { + color: #0e8afd; + } + + &:not(:first-of-type) { + margin-top: .5em; + } + } + } + } + + &.container-groups { + flex-direction: row; + + .spacer { + flex-grow: 0; + flex-shrink: 0; + width: 1em; + } + + .left, .right { + height: 20em; + width: calc(50% - .5em); /* the spacer in the middle thats why -.5 em */ + + flex-grow: 1; + flex-shrink: 1; + + .title { + align-self: center; + color: #254d7b; + text-transform: uppercase; + } + + .container { + margin-top: .5em; + } + } + + .left { + display: flex; + flex-direction: column; + justify-content: stretch; + + .container { + border-radius: .2em .2em 0 0; + border: 1px solid #1f2122; + border-bottom: 0; + + padding: 0!important; + background-color: #28292b; + + flex-grow: 1; + flex-shrink: 1; + overflow-y: auto; + + min-height: 4em; + position: relative; + + @include chat-scrollbar-vertical(); + + .entries { + flex-grow: 1; + flex-shrink: 1; + + min-height: 4em; + + .entry { + display: flex; + flex-direction: row; + justify-content: stretch; + + height: 1.6em; + padding-left: .5em; + padding-right: .5em; + + &:hover { + background-color: #232425; + } + + > * { + align-self: center; + } + + .icon-container { + margin-right: .25em; + } + + .name { + flex-grow: 1; + flex-shrink: 1; + + min-width: 1em; + line-height: normal; + + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + + .button-delete { + height: 1.3em; + width: 1.3em; + + cursor: pointer; + border-radius: .2em; + + &:hover { + background-color: #2c2d2e; + } + + display: flex; + flex-direction: row; + justify-content: space-around; + + > div { + align-self: center; + } + + @include transition($button_hover_animation_time ease-in-out); + } + } + } + + .container-default-groups { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: flex; + flex-direction: column; + justify-content: center; + + a { + align-self: center; + font-size: 1.25em; + color: hsla(0, 0%, 30%, 1); + } + } + } + + .buttons { + flex-grow: 0; + flex-shrink: 0; + + border-radius: 0 0 .2em .2em; + border: 1px solid #1f2122; + background-color: #28292b; + + padding: .5em; + + display: flex; + flex-direction: row; + justify-content: space-around; + + .button { + align-self: center; + } + } + } + + .right { + .container { + padding: 0!important; + + select { + font-size: .8em; + width: 100%; + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/shared/css/static/modal-connect.scss b/shared/css/static/modal-connect.scss index 55bd8693..88dd4810 100644 --- a/shared/css/static/modal-connect.scss +++ b/shared/css/static/modal-connect.scss @@ -259,7 +259,7 @@ align-self: center; .country, .icon-container { align-self: center; - margin-right: 0.1em; + margin-right: 0.25em; } diff --git a/shared/css/static/modal-identity.scss b/shared/css/static/modal-identity.scss new file mode 100644 index 00000000..6f6a0e18 --- /dev/null +++ b/shared/css/static/modal-identity.scss @@ -0,0 +1,188 @@ +@import "mixin"; + +.modal-body.modal-identity-improve { + padding: 0!important; + + display: flex; + flex-direction: column; + justify-content: flex-start; + + .container-tooltip { + flex-grow: 0!important; + flex-shrink: 0!important; + min-width: unset!important; + + position: relative; + width: .8em; + margin-right: .5em; + font-size: .9em; + + display: inline-flex; + flex-direction: column; + justify-content: center; + vertical-align: middle; + margin-bottom: .1em; + + img { + height: 1em; + width: 1em; + + align-self: center; + font-size: 1.2em; + } + + .tooltip { + display: none; + } + } + + .options, .status { + flex-grow: 0; + flex-shrink: 0; + + padding: 1em; + + .title { + color: #387fb5; + } + + .row { + display: flex; + flex-direction: row; + justify-content: stretch; + + div { + flex-grow: 1; + flex-shrink: 1; + min-width: 4em; + + &:not(:first-of-type) { + margin-left: 1em; + } + } + } + } + + .status { + border-top: 3px solid #20262d; + } + + .buttons { + flex-grow: 0; + flex-shrink: 0; + + margin: 0 1em 1em; + + display: flex; + flex-direction: row; + justify-content: flex-end; + + button { + min-width: 8em; + + &:not(:first-of-type) { + margin-left: 1em; + } + } + } +} + +.modal-body.modal-identity-import { + padding: 0!important; + + display: flex; + flex-direction: column; + justify-content: flex-start; + + @include user-select(none); + + .container-status { + display: flex; + flex-direction: row; + justify-content: center; + + margin: 1em 1em -1em; + height: 1.6em; + + overflow: hidden; + + color: #389738; + &.error { + color: #973838; + } + + &.loading { + color: #96903a; + } + + &.hidden { + height: 0; + } + + a { + align-self: center; + } + + @include transition(.2s ease-in-out); + } + + .container-text, .container-file { + display: flex; + flex-direction: row; + justify-content: stretch; + + > label { + flex-shrink: 0; + flex-grow: 0; + + width: 10em; + + display: flex; + flex-direction: row; + justify-content: flex-start; + + padding-left: .25em; + align-self: center; + + margin-right: 1em; + + .radio-button { + align-self: center; + margin-right: .5em; + } + } + + > * { + align-self: center; + } + + .form-group { + margin-bottom: 1.75em; + width: 100%; + } + + button { + min-width: 8em; + margin-right: 1em; + } + } + + .footer { + flex-shrink: 0; + flex-grow: 0; + + padding: 1em; + + display: flex; + flex-direction: row; + justify-content: flex-end; + + button { + min-width: 8em; + } + } + + .file-selector { + display: none; + } +} \ No newline at end of file diff --git a/shared/css/static/modal-serverinfo.scss b/shared/css/static/modal-serverinfo.scss new file mode 100644 index 00000000..c874e944 --- /dev/null +++ b/shared/css/static/modal-serverinfo.scss @@ -0,0 +1,229 @@ +@import "mixin"; + +.modal-body.modal-server-info { + padding: 0!important; + width: 55em; + + display: flex; + flex-direction: column; + justify-content: flex-start; + + background-color: #2f2f35; + + .container-tooltip { + flex-shrink: 0; + flex-grow: 0; + + position: relative; + width: 1.6em; + margin-left: .5em; + font-size: .9em; + + display: flex; + flex-direction: column; + justify-content: center; + + img { + height: 1em; + width: 1em; + + align-self: center; + font-size: 1.2em; + } + + .tooltip { + display: none; + } + } + + .hostbanner { + flex-grow: 0; + flex-shrink: 0; + + max-height: 9em; + //width: 30em; /* set a default width where we have to grow/shrink */ + + display: flex; + flex-direction: column; + justify-content: stretch; + + .container-hostbanner { + border: none; + border-radius: 0; + //background-color: #261f30; + background-color: hsla(265, 10%, 15%, 1); + } + + &.hidden { + display: none; + } + } + + .group { + flex-grow: 0; + flex-shrink: 0; + + margin: 1em; + padding: .5em; + + border-radius: .2em; + border: 1px solid #1f2122; + + background-color: #28292b; + + display: flex; + flex-direction: row; + justify-content: stretch; + + height: 10em; + max-height: 10em; + + .container-image { + flex-grow: 0; + flex-shrink: 0; + + max-width: 15em; + max-height: 9em; /* minus one padding */ + + display: flex; + flex-direction: column; + justify-content: center; + + img { + object-fit: contain; + max-height: 100%; + max-width: 100%; + } + + margin-right: 2em; + @include transition(.25s ease-in-out); + } + + .container-properties { + flex-shrink: 1; + flex-grow: 1; + + min-width: 25em; + + display: flex; + flex-direction: column; + justify-content: flex-start; + + height: inherit; + + .row { + flex-grow: 0; + flex-shrink: 0; + + height: 1.8em; + + display: flex; + flex-direction: row; + justify-content: flex-start; + + .key { + flex-shrink: 0; + flex-grow: 0; + + color: #557edc; + text-transform: uppercase; + align-self: center; + + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + + width: 15em; + } + + .value { + color: #d6d6d7; + align-self: center; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + + .country { + display: inline-block; + margin-right: .25em; + } + + &.server-version { + display: flex; + flex-direction: row; + justify-content: flex-start; + } + } + } + + .container-network { + display: flex; + flex-direction: row; + justify-content: center; + + .container-button { + margin-right: 1em; + + flex-shrink: 1; + min-width: 5em; + + display: flex; + flex-direction: column; + justify-content: flex-end; + + button { + height: 2.5em; + width: 12em; + + max-width: 100%; + + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + } + + .right { + flex-grow: 1; + } + } + } + + &.reverse { + flex-direction: row-reverse; + text-align: right; + + .container-image { + margin-right: 0; + margin-left: 2em; + } + + .container-properties { + .row { + flex-direction: row-reverse; + } + } + } + } + + .container-buttons { + margin: 1em; + + display: flex; + flex-direction: row; + justify-content: flex-end; + + button { + min-width: 8em; + } + } +} + +@media all and (max-width: 50em) { + .modal-body.modal-server-info { + .container-image { + margin: 0!important; + max-width: 0!important; + } + } +} \ No newline at end of file diff --git a/shared/css/static/modal.scss b/shared/css/static/modal.scss index ca109ec1..4e5115d2 100644 --- a/shared/css/static/modal.scss +++ b/shared/css/static/modal.scss @@ -119,6 +119,10 @@ flex-shrink: 1; color: #9d9d9e; + + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } h5 { @@ -461,7 +465,7 @@ box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12); &:hover { - background-color: #151515; + background-color: #0a0a0a; } &:disabled { @@ -473,21 +477,36 @@ } } - &.btn-success { + &.btn-success, &.btn-green { border-bottom-width: 2px; border-bottom-color: #389738; } - &.btn-info { + &.btn-info, &.btn-blue { border-bottom-width: 2px; border-bottom-color: #386896; } - &.btn-warning, &.btn-danger { + &.btn-warning, &.btn-danger, &.btn-red { border-bottom-width: 2px; border-bottom-color: #973838; } + &.btn-purple { + border-bottom-width: 2px; + border-bottom-color: #5f3586; + } + + &.btn-brown { + border-bottom-width: 2px; + border-bottom-color: #965238; + } + + &.btn-yellow { + border-bottom-width: 2px; + border-bottom-color: #96903a; + } + @include transition(background-color $button_hover_animation_time ease-in-out); } @@ -595,8 +614,8 @@ } } -/* general ratio button look */ -.ratio-button { +/* general radio button look */ +.ratio-button, .radio-button { $button_size: 1.2em; $mark_size: .6em; @@ -647,14 +666,18 @@ box-shadow: inset 0 0 4px 0 rgba(0, 0, 0, 0.5); } -label:hover > .ratio-button, .ratio-button:hover { - &.ratio-button, > .ratio-button { +label:hover > .ratio-button, .ratio-button:hover, +label:hover > .radio-button, .radio-button:hover{ + &.ratio-button, > .ratio-button, + &.radio-button, > .radio-button{ background-color: #2c2b2b; } } -label.disabled > .ratio-button, .ratio-button.disabled, .ratio-button:disabled { - &.ratio-button, > .ratio-button { +label.disabled > .ratio-button, .ratio-button.disabled, .ratio-button:disabled, +label.disabled > .radio-button, .radio-button.disabled, .radio-button:disabled { + &.ratio-button, > .ratio-button, + &.radio-button, > .radio-button { pointer-events: none!important; background-color: #1a1919!important; } diff --git a/shared/generate_packed.sh b/shared/generate_packed.sh index 86da58ae..4c1ad88a 100755 --- a/shared/generate_packed.sh +++ b/shared/generate_packed.sh @@ -5,7 +5,7 @@ cd "$BASEDIR" source ../scripts/resolve_commands.sh #Generate the loader definitions first -LOADER_FILE="declarations/exports_loader.d.ts" +LOADER_FILE="declarations/exports_loader_app.d.ts" if [[ -e ${LOADER_FILE} ]]; then rm ${LOADER_FILE} if [[ $? -ne 0 ]]; then @@ -13,10 +13,9 @@ if [[ -e ${LOADER_FILE} ]]; then fi fi -npm run dtsgen -- --config $(pwd)/tsconfig/dtsconfig_loader.json -v +npm run dtsgen -- --config $(pwd)/tsconfig/dtsconfig_loader_app.json -v if [[ ! -e ${LOADER_FILE} ]]; then echo "Failed to generate definitions" - echo "$result" exit 1 fi @@ -26,12 +25,19 @@ if [[ $? -ne 0 ]]; then exit 1 fi -execute_ttsc -p tsconfig/tsconfig_packed_loader.json +execute_ttsc -p tsconfig/tsconfig_packed_loader_app.json if [[ $? -ne 0 ]]; then echo "Failed to generate packed loader file!" exit 1 fi +npm run minify-web-rel-file `pwd`/generated/loader_app.min.js `pwd`/generated/loader_app.js +if [[ $? -ne 0 ]]; then + echo "Failed to minimize packed loader file!" + exit 1 +fi + + execute_ttsc -p tsconfig/tsconfig_packed.json if [[ $? -ne 0 ]]; then echo "Failed to generate packed file!" @@ -49,7 +55,7 @@ if [[ ! -d generated/static/ ]]; then fi # Create packed CSS file -find css/static/ -name '*.css' -exec cat {} \; | npm run csso -- --output `pwd`/generated/static/base.css +./css/generate_packed.sh echo "Packed file generated!" exit 0 \ No newline at end of file diff --git a/shared/html/index.php b/shared/html/index.php index 6cd78a9e..0ee6701f 100644 --- a/shared/html/index.php +++ b/shared/html/index.php @@ -93,7 +93,9 @@