diff --git a/css/_responsive.scss b/css/_responsive.scss new file mode 100644 index 000000000..01fd767b0 --- /dev/null +++ b/css/_responsive.scss @@ -0,0 +1,70 @@ +@media only screen and (max-width: $smallScreen) { + .watermark { + width: 20%; + height: 20%; + } + + .new-toolbox { + .toolbox-content { + .button-group-center, .button-group-left, .button-group-right { + .toolbox-button { + .toolbox-icon { + width: 28px; + height: 28px; + svg { + width: 18px; + height: 18px; + } + } + + &:nth-child(2) { + .toolbox-icon { + width: 30px; + height: 30px; + } + } + } + } + } + } +} + +@media only screen and (max-width: $verySmallScreen) { + #videoResolutionLabel { + display: none; + } + .desktop-browser { + .vertical-filmstrip .filmstrip { + display: none; + } + } + .new-toolbox { + .toolbox-content { + .button-group-center, .button-group-left, .button-group-right { + .settings-button-small-icon { + display: none; + } + .toolbox-button { + .toolbox-icon { + width: 18px; + height: 18px; + svg { + width: 12px; + height: 12px; + } + } + + &:nth-child(2) { + .toolbox-icon { + width: 20px; + height: 20px; + } + } + } + } + } + } + .chrome-extension-banner { + display: none; + } +} diff --git a/css/_variables.scss b/css/_variables.scss index b5cc22c36..44e34c6e1 100644 --- a/css/_variables.scss +++ b/css/_variables.scss @@ -269,3 +269,9 @@ $chromeExtensionBannerTop: 80px; $chromeExtensionBannerRight: 16px; $chromeExtensionBannerTopInMeeting: 10px; $chromeExtensionBannerRightInMeeeting: 10px; + +/** +* media type thresholds +*/ +$smallScreen: 700px; +$verySmallScreen: 500px; diff --git a/css/main.scss b/css/main.scss index 4b3ed8c4e..160342b7b 100644 --- a/css/main.scss +++ b/css/main.scss @@ -101,5 +101,6 @@ $flagsImagePath: "../images/"; @import 'modals/security/security'; @import 'premeeting-screens'; @import 'e2ee'; +@import 'responsive'; /* Modules END */ diff --git a/modules/UI/UI.js b/modules/UI/UI.js index 7880bc74d..01ff48a62 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -6,6 +6,7 @@ const UI = {}; import EventEmitter from 'events'; import Logger from 'jitsi-meet-logger'; +import { isMobileBrowser } from '../../react/features/base/environment/utils'; import { getLocalParticipant } from '../../react/features/base/participants'; import { toggleChat } from '../../react/features/chat'; import { setDocumentUrl } from '../../react/features/etherpad'; @@ -154,6 +155,12 @@ UI.start = function() { sharedVideoManager = new SharedVideoManager(eventEmitter); + if (isMobileBrowser()) { + $('body').addClass('mobile-browser'); + } else { + $('body').addClass('desktop-browser'); + } + if (interfaceConfig.filmStripOnly) { $('body').addClass('filmstrip-only'); APP.store.dispatch(setNotificationsEnabled(false)); diff --git a/react/features/toolbox/components/web/Toolbox.js b/react/features/toolbox/components/web/Toolbox.js index 5e9dc539d..47a70fa15 100644 --- a/react/features/toolbox/components/web/Toolbox.js +++ b/react/features/toolbox/components/web/Toolbox.js @@ -1209,13 +1209,27 @@ class Toolbox extends Component { const buttonsLeft = []; const buttonsRight = []; + const smallThreshold = 700; + const verySmallThreshold = 500; + + let minSpaceBetweenButtons = 48; + let widthPlusPaddingOfButton = 56; + + if (this.state.windowWidth <= verySmallThreshold) { + minSpaceBetweenButtons = 26; + widthPlusPaddingOfButton = 28; + } else if (this.state.windowWidth <= smallThreshold) { + minSpaceBetweenButtons = 36; + widthPlusPaddingOfButton = 40; + } + const maxNumberOfButtonsPerGroup = Math.floor( ( this.state.windowWidth - 168 // the width of the central group by design - - 48 // the minimum space between the button groups + - minSpaceBetweenButtons // the minimum space between the button groups ) - / 56 // the width + padding of a button + / widthPlusPaddingOfButton // the width + padding of a button / 2 // divide by the number of groups(left and right group) ); @@ -1232,7 +1246,7 @@ class Toolbox extends Component { if (this._shouldShowButton('closedcaptions')) { buttonsLeft.push('closedcaptions'); } - if (overflowHasItems) { + if (overflowHasItems && this.state.windowWidth >= verySmallThreshold) { buttonsRight.push('overflowmenu'); } if (this._shouldShowButton('invite')) { @@ -1255,13 +1269,13 @@ class Toolbox extends Component { movedButtons.push(...buttonsLeft.splice( maxNumberOfButtonsPerGroup, buttonsLeft.length - maxNumberOfButtonsPerGroup)); - if (buttonsRight.indexOf('overflowmenu') === -1) { + if (buttonsRight.indexOf('overflowmenu') === -1 && this.state.windowWidth >= verySmallThreshold) { buttonsRight.unshift('overflowmenu'); } } if (buttonsRight.length > maxNumberOfButtonsPerGroup) { - if (buttonsRight.indexOf('overflowmenu') === -1) { + if (buttonsRight.indexOf('overflowmenu') === -1 && this.state.windowWidth >= verySmallThreshold) { buttonsRight.unshift('overflowmenu'); } @@ -1332,7 +1346,7 @@ class Toolbox extends Component { tooltip = { t('toolbar.invite') } /> } { buttonsRight.indexOf('security') !== -1 && } - { buttonsRight.indexOf('overflowmenu') !== -1 + { buttonsRight.indexOf('overflowmenu') !== -1 && this.state.windowWidth >= verySmallThreshold &&