Bladeren bron

Adding responsive to jitsi logo, buttons and hiding some part of the interface (#7380)

* Adding responsive to jitsi logo, buttons and hiding some part of the interface
* moving media types thresholds to variables and apply only to screen
* hide chrome extension banner on very small view
* Hide filmstrip only on desktop narrow windows
master
Jesús Espino 4 jaren geleden
bovenliggende
commit
400c86ad5e
No account linked to committer's email address
5 gewijzigde bestanden met toevoegingen van 104 en 6 verwijderingen
  1. 70
    0
      css/_responsive.scss
  2. 6
    0
      css/_variables.scss
  3. 1
    0
      css/main.scss
  4. 7
    0
      modules/UI/UI.js
  5. 20
    6
      react/features/toolbox/components/web/Toolbox.js

+ 70
- 0
css/_responsive.scss Bestand weergeven

@@ -0,0 +1,70 @@
1
+@media only screen and (max-width: $smallScreen) {
2
+    .watermark {
3
+        width: 20%;
4
+        height: 20%;
5
+    }
6
+
7
+    .new-toolbox {
8
+        .toolbox-content {
9
+            .button-group-center, .button-group-left, .button-group-right {
10
+                .toolbox-button {
11
+                    .toolbox-icon {
12
+                        width: 28px;
13
+                        height: 28px;
14
+                        svg {
15
+                            width: 18px;
16
+                            height: 18px;
17
+                        }
18
+                    }
19
+
20
+                    &:nth-child(2) {
21
+                        .toolbox-icon {
22
+                            width: 30px;
23
+                            height: 30px;
24
+                        }
25
+                    }
26
+                }
27
+            }
28
+        }
29
+    }
30
+}
31
+
32
+@media only screen and (max-width: $verySmallScreen) {
33
+    #videoResolutionLabel {
34
+        display: none;
35
+    }
36
+    .desktop-browser {
37
+        .vertical-filmstrip .filmstrip {
38
+            display: none;
39
+        }
40
+    }
41
+    .new-toolbox {
42
+        .toolbox-content {
43
+            .button-group-center, .button-group-left, .button-group-right {
44
+                .settings-button-small-icon {
45
+                    display: none;
46
+                }
47
+                .toolbox-button {
48
+                    .toolbox-icon {
49
+                        width: 18px;
50
+                        height: 18px;
51
+                        svg {
52
+                            width: 12px;
53
+                            height: 12px;
54
+                        }
55
+                    }
56
+
57
+                    &:nth-child(2) {
58
+                        .toolbox-icon {
59
+                            width: 20px;
60
+                            height: 20px;
61
+                        }
62
+                    }
63
+                }
64
+            }
65
+        }
66
+    }
67
+    .chrome-extension-banner {
68
+        display: none;
69
+    }
70
+}

+ 6
- 0
css/_variables.scss Bestand weergeven

@@ -269,3 +269,9 @@ $chromeExtensionBannerTop: 80px;
269 269
 $chromeExtensionBannerRight: 16px;
270 270
 $chromeExtensionBannerTopInMeeting: 10px;
271 271
 $chromeExtensionBannerRightInMeeeting: 10px;
272
+
273
+/**
274
+* media type thresholds
275
+*/
276
+$smallScreen: 700px;
277
+$verySmallScreen: 500px;

+ 1
- 0
css/main.scss Bestand weergeven

@@ -101,5 +101,6 @@ $flagsImagePath: "../images/";
101 101
 @import 'modals/security/security';
102 102
 @import 'premeeting-screens';
103 103
 @import 'e2ee';
104
+@import 'responsive';
104 105
 
105 106
 /* Modules END */

+ 7
- 0
modules/UI/UI.js Bestand weergeven

@@ -6,6 +6,7 @@ const UI = {};
6 6
 import EventEmitter from 'events';
7 7
 import Logger from 'jitsi-meet-logger';
8 8
 
9
+import { isMobileBrowser } from '../../react/features/base/environment/utils';
9 10
 import { getLocalParticipant } from '../../react/features/base/participants';
10 11
 import { toggleChat } from '../../react/features/chat';
11 12
 import { setDocumentUrl } from '../../react/features/etherpad';
@@ -154,6 +155,12 @@ UI.start = function() {
154 155
 
155 156
     sharedVideoManager = new SharedVideoManager(eventEmitter);
156 157
 
158
+    if (isMobileBrowser()) {
159
+        $('body').addClass('mobile-browser');
160
+    } else {
161
+        $('body').addClass('desktop-browser');
162
+    }
163
+
157 164
     if (interfaceConfig.filmStripOnly) {
158 165
         $('body').addClass('filmstrip-only');
159 166
         APP.store.dispatch(setNotificationsEnabled(false));

+ 20
- 6
react/features/toolbox/components/web/Toolbox.js Bestand weergeven

@@ -1209,13 +1209,27 @@ class Toolbox extends Component<Props, State> {
1209 1209
         const buttonsLeft = [];
1210 1210
         const buttonsRight = [];
1211 1211
 
1212
+        const smallThreshold = 700;
1213
+        const verySmallThreshold = 500;
1214
+
1215
+        let minSpaceBetweenButtons = 48;
1216
+        let widthPlusPaddingOfButton = 56;
1217
+
1218
+        if (this.state.windowWidth <= verySmallThreshold) {
1219
+            minSpaceBetweenButtons = 26;
1220
+            widthPlusPaddingOfButton = 28;
1221
+        } else if (this.state.windowWidth <= smallThreshold) {
1222
+            minSpaceBetweenButtons = 36;
1223
+            widthPlusPaddingOfButton = 40;
1224
+        }
1225
+
1212 1226
         const maxNumberOfButtonsPerGroup = Math.floor(
1213 1227
             (
1214 1228
                 this.state.windowWidth
1215 1229
                     - 168 // the width of the central group by design
1216
-                    - 48 // the minimum space between the button groups
1230
+                    - minSpaceBetweenButtons // the minimum space between the button groups
1217 1231
             )
1218
-            / 56 // the width + padding of a button
1232
+            / widthPlusPaddingOfButton // the width + padding of a button
1219 1233
             / 2 // divide by the number of groups(left and right group)
1220 1234
         );
1221 1235
 
@@ -1232,7 +1246,7 @@ class Toolbox extends Component<Props, State> {
1232 1246
         if (this._shouldShowButton('closedcaptions')) {
1233 1247
             buttonsLeft.push('closedcaptions');
1234 1248
         }
1235
-        if (overflowHasItems) {
1249
+        if (overflowHasItems && this.state.windowWidth >= verySmallThreshold) {
1236 1250
             buttonsRight.push('overflowmenu');
1237 1251
         }
1238 1252
         if (this._shouldShowButton('invite')) {
@@ -1255,13 +1269,13 @@ class Toolbox extends Component<Props, State> {
1255 1269
             movedButtons.push(...buttonsLeft.splice(
1256 1270
                 maxNumberOfButtonsPerGroup,
1257 1271
                 buttonsLeft.length - maxNumberOfButtonsPerGroup));
1258
-            if (buttonsRight.indexOf('overflowmenu') === -1) {
1272
+            if (buttonsRight.indexOf('overflowmenu') === -1 && this.state.windowWidth >= verySmallThreshold) {
1259 1273
                 buttonsRight.unshift('overflowmenu');
1260 1274
             }
1261 1275
         }
1262 1276
 
1263 1277
         if (buttonsRight.length > maxNumberOfButtonsPerGroup) {
1264
-            if (buttonsRight.indexOf('overflowmenu') === -1) {
1278
+            if (buttonsRight.indexOf('overflowmenu') === -1 && this.state.windowWidth >= verySmallThreshold) {
1265 1279
                 buttonsRight.unshift('overflowmenu');
1266 1280
             }
1267 1281
 
@@ -1332,7 +1346,7 @@ class Toolbox extends Component<Props, State> {
1332 1346
                             tooltip = { t('toolbar.invite') } /> }
1333 1347
                     { buttonsRight.indexOf('security') !== -1
1334 1348
                         && <SecurityDialogButton customClass = 'security-toolbar-button' /> }
1335
-                    { buttonsRight.indexOf('overflowmenu') !== -1
1349
+                    { buttonsRight.indexOf('overflowmenu') !== -1 && this.state.windowWidth >= verySmallThreshold
1336 1350
                         && <OverflowMenuButton
1337 1351
                             isOpen = { _overflowMenuVisible }
1338 1352
                             onVisibilityChange = { this._onSetOverflowVisible }>

Laden…
Annuleren
Opslaan