소스 검색

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 년 전
부모
커밋
400c86ad5e
No account linked to committer's email address
5개의 변경된 파일104개의 추가작업 그리고 6개의 파일을 삭제
  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 파일 보기

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 파일 보기

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

+ 1
- 0
css/main.scss 파일 보기

101
 @import 'modals/security/security';
101
 @import 'modals/security/security';
102
 @import 'premeeting-screens';
102
 @import 'premeeting-screens';
103
 @import 'e2ee';
103
 @import 'e2ee';
104
+@import 'responsive';
104
 
105
 
105
 /* Modules END */
106
 /* Modules END */

+ 7
- 0
modules/UI/UI.js 파일 보기

6
 import EventEmitter from 'events';
6
 import EventEmitter from 'events';
7
 import Logger from 'jitsi-meet-logger';
7
 import Logger from 'jitsi-meet-logger';
8
 
8
 
9
+import { isMobileBrowser } from '../../react/features/base/environment/utils';
9
 import { getLocalParticipant } from '../../react/features/base/participants';
10
 import { getLocalParticipant } from '../../react/features/base/participants';
10
 import { toggleChat } from '../../react/features/chat';
11
 import { toggleChat } from '../../react/features/chat';
11
 import { setDocumentUrl } from '../../react/features/etherpad';
12
 import { setDocumentUrl } from '../../react/features/etherpad';
154
 
155
 
155
     sharedVideoManager = new SharedVideoManager(eventEmitter);
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
     if (interfaceConfig.filmStripOnly) {
164
     if (interfaceConfig.filmStripOnly) {
158
         $('body').addClass('filmstrip-only');
165
         $('body').addClass('filmstrip-only');
159
         APP.store.dispatch(setNotificationsEnabled(false));
166
         APP.store.dispatch(setNotificationsEnabled(false));

+ 20
- 6
react/features/toolbox/components/web/Toolbox.js 파일 보기

1209
         const buttonsLeft = [];
1209
         const buttonsLeft = [];
1210
         const buttonsRight = [];
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
         const maxNumberOfButtonsPerGroup = Math.floor(
1226
         const maxNumberOfButtonsPerGroup = Math.floor(
1213
             (
1227
             (
1214
                 this.state.windowWidth
1228
                 this.state.windowWidth
1215
                     - 168 // the width of the central group by design
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
             / 2 // divide by the number of groups(left and right group)
1233
             / 2 // divide by the number of groups(left and right group)
1220
         );
1234
         );
1221
 
1235
 
1232
         if (this._shouldShowButton('closedcaptions')) {
1246
         if (this._shouldShowButton('closedcaptions')) {
1233
             buttonsLeft.push('closedcaptions');
1247
             buttonsLeft.push('closedcaptions');
1234
         }
1248
         }
1235
-        if (overflowHasItems) {
1249
+        if (overflowHasItems && this.state.windowWidth >= verySmallThreshold) {
1236
             buttonsRight.push('overflowmenu');
1250
             buttonsRight.push('overflowmenu');
1237
         }
1251
         }
1238
         if (this._shouldShowButton('invite')) {
1252
         if (this._shouldShowButton('invite')) {
1255
             movedButtons.push(...buttonsLeft.splice(
1269
             movedButtons.push(...buttonsLeft.splice(
1256
                 maxNumberOfButtonsPerGroup,
1270
                 maxNumberOfButtonsPerGroup,
1257
                 buttonsLeft.length - maxNumberOfButtonsPerGroup));
1271
                 buttonsLeft.length - maxNumberOfButtonsPerGroup));
1258
-            if (buttonsRight.indexOf('overflowmenu') === -1) {
1272
+            if (buttonsRight.indexOf('overflowmenu') === -1 && this.state.windowWidth >= verySmallThreshold) {
1259
                 buttonsRight.unshift('overflowmenu');
1273
                 buttonsRight.unshift('overflowmenu');
1260
             }
1274
             }
1261
         }
1275
         }
1262
 
1276
 
1263
         if (buttonsRight.length > maxNumberOfButtonsPerGroup) {
1277
         if (buttonsRight.length > maxNumberOfButtonsPerGroup) {
1264
-            if (buttonsRight.indexOf('overflowmenu') === -1) {
1278
+            if (buttonsRight.indexOf('overflowmenu') === -1 && this.state.windowWidth >= verySmallThreshold) {
1265
                 buttonsRight.unshift('overflowmenu');
1279
                 buttonsRight.unshift('overflowmenu');
1266
             }
1280
             }
1267
 
1281
 
1332
                             tooltip = { t('toolbar.invite') } /> }
1346
                             tooltip = { t('toolbar.invite') } /> }
1333
                     { buttonsRight.indexOf('security') !== -1
1347
                     { buttonsRight.indexOf('security') !== -1
1334
                         && <SecurityDialogButton customClass = 'security-toolbar-button' /> }
1348
                         && <SecurityDialogButton customClass = 'security-toolbar-button' /> }
1335
-                    { buttonsRight.indexOf('overflowmenu') !== -1
1349
+                    { buttonsRight.indexOf('overflowmenu') !== -1 && this.state.windowWidth >= verySmallThreshold
1336
                         && <OverflowMenuButton
1350
                         && <OverflowMenuButton
1337
                             isOpen = { _overflowMenuVisible }
1351
                             isOpen = { _overflowMenuVisible }
1338
                             onVisibilityChange = { this._onSetOverflowVisible }>
1352
                             onVisibilityChange = { this._onSetOverflowVisible }>

Loading…
취소
저장