Kaynağa Gözat

feat(toolbox): Redesign.

master
Hristo Terezov 6 yıl önce
ebeveyn
işleme
f7b930409b

+ 187
- 138
css/_toolbars.scss Dosyayı Görüntüle

@@ -23,192 +23,241 @@
23 23
  * TODO: when the old filmstrip has been removed, remove the "new-" prefix.
24 24
  */
25 25
 .new-toolbox {
26
-    background-color: $newToolbarBackgroundColor;
27 26
     bottom: calc((#{$newToolbarSize} * 2) * -1);
28
-    box-sizing: border-box;
29
-    display: flex;
30
-    justify-content: space-between;
31 27
     left: 0;
32
-    margin-left: auto;
33
-    margin-right: auto;
34
-    padding: 12px 8px;
35 28
     position: absolute;
36 29
     right: 0;
37 30
     transition: bottom .3s ease-in;
38 31
     width: 100%;
39
-    z-index: $toolbarZ;
32
+
40 33
 
41 34
     &.visible {
42 35
         bottom: 0;
36
+        .toolbox-background {
37
+            bottom: 0px;
38
+        }
43 39
     }
44 40
 
45 41
     &.no-buttons {
46 42
         display: none;
47 43
     }
48 44
 
49
-    .button-group-center,
50
-    .button-group-left,
51
-    .button-group-right {
52
-        display: flex;
53
-        width: 33%;
54
-    }
55
-
56
-    .button-group-center {
57
-        justify-content: center;
58
-    }
59
-
60
-    .button-group-right {
61
-        justify-content: flex-end;
45
+    .toolbox-background {
46
+        background-image: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
47
+        transition: bottom .3s ease-in;
48
+        height: 160px;
49
+        width: 100%;
50
+        bottom: -160px;
51
+        position: absolute;
52
+        z-index: $toolbarBackgroundZ;
62 53
     }
63 54
 
64
-    i {
65
-        border-radius: 5px;
66
-        cursor: pointer;
67
-        display: block;
68
-        font-size: inherit;
69
-        height: 100%;
70
-        line-height: inherit;
55
+    .toolbox-content {
56
+        box-sizing: border-box;
57
+        display: flex;
58
+        justify-content: space-between;
59
+        margin-left: auto;
60
+        margin-right: auto;
61
+        padding: 20px 16px;
62
+        position: relative;
71 63
         width: 100%;
72
-    }
64
+        z-index: $toolbarZ;
73 65
 
74
-    i:hover {
75
-        background-color: $newToolbarButtonHoverColor;
76
-    }
66
+        .button-group-center,
67
+        .button-group-left,
68
+        .button-group-right {
69
+            display: flex;
70
+            width: 33%;
71
+        }
77 72
 
78
-    i.toggled {
79
-        background: $newToolbarButtonToggleColor;
80
-    }
73
+        .button-group-center {
74
+            justify-content: center;
75
+            .toolbox-icon {
76
+                margin: 0px 12px;
77
+            }
78
+        }
81 79
 
82
-    i.toggled:hover {
83
-        background-color: $newToolbarButtonHoverColor;
84
-    }
80
+        .button-group-right {
81
+            justify-content: flex-end;
82
+        }
85 83
 
86
-    i.disabled {
87
-        cursor: initial;
88
-        color: #3b475c;
89
-    }
84
+        i {
85
+            border-radius: 5px;
86
+            cursor: pointer;
87
+            display: block;
88
+            font-size: inherit;
89
+            height: 100%;
90
+            line-height: inherit;
91
+            width: 100%;
92
+        }
90 93
 
91
-    .disabled i {
92
-        cursor: initial;
93
-        color: #3b475c;
94
-    }
94
+        i:hover {
95
+            background: $newToolbarButtonHoverColor;
96
+        }
95 97
 
96
-    i.disabled:hover {
97
-        background-color: initial;
98
-    }
98
+        i.toggled {
99
+            background: $newToolbarButtonToggleColor;
100
+        }
99 101
 
100
-    .icon-hangup {
101
-        color: $hangupColor;
102
-        font-size: $newToolbarHangupFontSize;
103
-    }
102
+        i.toggled:hover {
103
+            background: $newToolbarButtonHoverColor;
104
+        }
104 105
 
105
-    .overflow-menu {
106
-        font-size: 1.2em;
107
-        list-style-type: none;
108
-        /**
109
-         * Undo atlaskit padding by reducing margins.
110
-         */
111
-        margin: -15px -24px;
112
-        padding: 4px 0;
113
-
114
-        .overflow-menu-item {
115
-            align-items: center;
116
-            color: #B8C7E0;
117
-            cursor: pointer;
118
-            display: flex;
119
-            font-size: 14px;
120
-            height: 22px;
121
-            padding: 5px 12px;
106
+        .icon-hangup {
107
+            background-color: #e12d2d;
108
+            color: #fff;
109
+            border-radius: 50%;
110
+            width: 40px;
111
+            height: 40px;
122 112
 
123
-            div {
124
-                display: flex;
125
-                flex-direction: row;
126
-                align-items: center;
113
+            &:hover {
114
+                background-color: #e54b4b;
127 115
             }
116
+        }
117
+        i.disabled, .disabled i {
118
+            cursor: initial;
119
+            color: #fff;
120
+            background-color: #a4b8d1;
121
+        }
122
+
123
+        .icon-mic-disabled, .icon-microphone, .icon-camera-disabled, .icon-camera {
124
+            background-color: #fff;
125
+            color: #5e6d7a;
126
+            border-radius: 50%;
127
+            border: 1px solid #d1dbe8;
128
+            width: 38px;
129
+            height: 38px;
128 130
 
129 131
             &:hover {
130
-                background: #313D52;
132
+                background-color: #daebfa;
133
+                border: 1px solid #daebfa;
131 134
             }
132 135
 
133
-            &.unclickable {
134
-                cursor: default;
135
-            }
136
-            &.unclickable:hover {
137
-                background: inherit;
136
+            &.toggled {
137
+                background: #2a3a4b;
138
+                color: #fff;
139
+                border: 1px solid #5e6d7a;
140
+
141
+                &:hover {
142
+                    background-color: #5e6d7a;
143
+                }
138 144
             }
139
-            &.disabled {
145
+
146
+            &.disabled, .disabled & {
140 147
                 cursor: initial;
141
-                color: #3b475c;
148
+                color: #fff;
149
+                background-color: #a4b8d1;
142 150
             }
143 151
         }
144 152
 
145
-        .beta-tag {
146
-            background: #B8C7E0;
147
-            border-radius: 2px;
148
-            color: $newToolbarBackgroundColor;
149
-            font-size: 11px;
150
-            font-weight: bold;
151
-            margin-left: 8px;
152
-            padding: 0 6px;
153
-        }
153
+        .overflow-menu {
154
+            font-size: 1.2em;
155
+            list-style-type: none;
156
+            /**
157
+             * Undo atlaskit padding by reducing margins.
158
+             */
159
+            margin: -15px -24px;
160
+            padding: 4px 0;
154 161
 
155
-        .overflow-menu-item-icon {
156
-            margin-right: 10px;
162
+            .overflow-menu-item {
163
+                align-items: center;
164
+                color: #B8C7E0;
165
+                cursor: pointer;
166
+                display: flex;
167
+                font-size: 14px;
168
+                height: 22px;
169
+                padding: 5px 12px;
170
+
171
+                div {
172
+                    display: flex;
173
+                    flex-direction: row;
174
+                    align-items: center;
175
+                }
176
+
177
+                &:hover {
178
+                    background: #313D52;
179
+                }
180
+
181
+                &.unclickable {
182
+                    cursor: default;
183
+                }
184
+                &.unclickable:hover {
185
+                    background: inherit;
186
+                }
187
+                &.disabled {
188
+                    cursor: initial;
189
+                    color: #3b475c;
190
+                }
191
+            }
157 192
 
158
-            i {
159
-                display: inline;
160
-                font-size: 24px;
193
+            .beta-tag {
194
+                background: #B8C7E0;
195
+                border-radius: 2px;
196
+                color: $newToolbarBackgroundColor;
197
+                font-size: 11px;
198
+                font-weight: bold;
199
+                margin-left: 8px;
200
+                padding: 0 6px;
161 201
             }
162 202
 
163
-            i:hover {
164
-                background-color: initial;
203
+            .overflow-menu-item-icon {
204
+                margin-right: 10px;
205
+
206
+                i {
207
+                    display: inline;
208
+                    font-size: 24px;
209
+                }
210
+
211
+                i:hover {
212
+                    background-color: initial;
213
+                }
214
+
215
+                img {
216
+                    max-width: 24px;
217
+                    max-height: 24px;
218
+                }
165 219
             }
166 220
 
167
-            img {
168
-                max-width: 24px;
169
-                max-height: 24px;
221
+            .profile-text {
222
+                max-width: 150px;
223
+                text-overflow: ellipsis;
224
+                overflow: hidden;
225
+                white-space: nowrap;
170 226
             }
171 227
         }
172 228
 
173
-        .profile-text {
174
-            max-width: 150px;
175
-            text-overflow: ellipsis;
176
-            overflow: hidden;
177
-            white-space: nowrap;
229
+        .toolbox-button {
230
+            color: $toolbarButtonColor;
231
+            cursor: pointer;
232
+            display: inline-block;
233
+            line-height: $newToolbarSize;
234
+            margin: 0 8px;
235
+            text-align: center;
178 236
         }
179
-    }
180
-
181
-    .toolbox-button {
182
-        color: $toolbarButtonColor;
183
-        cursor: pointer;
184
-        display: inline-block;
185
-        line-height: $newToolbarSize;
186
-        margin: 0 4px;
187
-        text-align: center;
188
-    }
189 237
 
190
-    .toolbar-button-with-badge {
191
-        position: relative;
192
-
193
-        .badge-round {
194
-            bottom: -5px;
195
-            font-size: 12px;
196
-            line-height: 20px;
197
-            min-width: 20px;
198
-            pointer-events: none;
199
-            position: absolute;
200
-            right: -5px;
238
+        .toolbar-button-with-badge {
239
+            position: relative;
240
+
241
+            .badge-round {
242
+                bottom: -5px;
243
+                font-size: 12px;
244
+                line-height: 20px;
245
+                min-width: 20px;
246
+                pointer-events: none;
247
+                position: absolute;
248
+                right: -5px;
249
+            }
201 250
         }
202
-    }
203 251
 
204
-    .toolbox-button-wth-dialog {
205
-        display: inline-block;
206
-    }
252
+        .toolbox-button-wth-dialog {
253
+            display: inline-block;
254
+        }
207 255
 
208
-    .toolbox-icon {
209
-        height: $newToolbarSize;
210
-        font-size: 24px;
211
-        width: $newToolbarSize;
256
+        .toolbox-icon {
257
+            height: $newToolbarSize;
258
+            font-size: 24px;
259
+            width: $newToolbarSize;
260
+        }
212 261
     }
213 262
 }
214 263
 
@@ -226,15 +275,15 @@
226 275
     }
227 276
 
228 277
     i:hover {
229
-        background-color: $newToolbarButtonHoverColor;
278
+        background-color: $AOTToolbarButtonHoverColor;
230 279
     }
231 280
 
232 281
     i.toggled {
233
-        background: $newToolbarButtonToggleColor;
282
+        background: $AOTToolbarButtonToggleColor;
234 283
     }
235 284
 
236 285
     i.toggled:hover:not(.disabled) {
237
-        background-color: $newToolbarButtonHoverColor;
286
+        background-color: $AOTToolbarButtonHoverColor;
238 287
     }
239 288
 
240 289
     .icon-hangup {

+ 5
- 2
css/_variables.scss Dosyayı Görüntüle

@@ -34,8 +34,10 @@ $defaultDarkColor: #2b3d5c;
34 34
  */
35 35
 $defaultToolbarSize: 50px;
36 36
 $newToolbarBackgroundColor: rgba(22, 38, 55, 0.8);
37
-$newToolbarButtonHoverColor: rgba(14, 20, 35, 0.6);
38
-$newToolbarButtonToggleColor: rgba(14, 20, 35, 1);
37
+$newToolbarButtonHoverColor: rgba(42, 58, 75, 0.15);
38
+$newToolbarButtonToggleColor: rgba(42, 58, 75, 0.2);
39
+$AOTToolbarButtonHoverColor: rgba(14, 20, 35, 0.6);
40
+$AOTToolbarButtonToggleColor: rgba(14, 20, 35, 1);
39 41
 $newToolbarFontSize: 24px;
40 42
 $newToolbarHangupFontSize: 32px;
41 43
 $newToolbarSize: 40px;
@@ -91,6 +93,7 @@ $zindex0: 0;
91 93
 $zindex1: 1;
92 94
 $zindex2: 2;
93 95
 $zindex3: 3;
96
+$toolbarBackgroundZ: 4;
94 97
 $filmstripVideosZ: 5;
95 98
 $zindex10: 10;
96 99
 $reloadZ: 20;

+ 94
- 79
react/features/toolbox/components/web/Toolbox.js Dosyayı Görüntüle

@@ -312,21 +312,9 @@ class Toolbox extends Component<Props> {
312 312
      * @returns {ReactElement}
313 313
      */
314 314
     render() {
315
-        const {
316
-            _chatOpen,
317
-            _hideInviteButton,
318
-            _overflowMenuVisible,
319
-            _raisedHand,
320
-            _visible,
321
-            _visibleButtons,
322
-            t
323
-        } = this.props;
315
+        const { _visible, _visibleButtons } = this.props;
324 316
         const rootClassNames = `new-toolbox ${_visible ? 'visible' : ''} ${
325 317
             _visibleButtons.size ? '' : 'no-buttons'}`;
326
-        const overflowMenuContent = this._renderOverflowMenuContent();
327
-        const overflowHasItems = Boolean(overflowMenuContent.filter(
328
-            child => child).length);
329
-        const toolbarAccLabel = 'toolbar.accessibilityLabel.moreActionsMenu';
330 318
 
331 319
         return (
332 320
             <div
@@ -334,72 +322,8 @@ class Toolbox extends Component<Props> {
334 322
                 id = 'new-toolbox'
335 323
                 onMouseOut = { this._onMouseOut }
336 324
                 onMouseOver = { this._onMouseOver }>
337
-                <div className = 'button-group-left'>
338
-                    { this._shouldShowButton('desktop')
339
-                        && this._renderDesktopSharingButton() }
340
-                    { this._shouldShowButton('raisehand')
341
-                        && <ToolbarButton
342
-                            accessibilityLabel =
343
-                                { t('toolbar.accessibilityLabel.raiseHand') }
344
-                            iconName = { _raisedHand
345
-                                ? 'icon-raised-hand toggled'
346
-                                : 'icon-raised-hand' }
347
-                            onClick = { this._onToolbarToggleRaiseHand }
348
-                            tooltip = { t('toolbar.raiseHand') } /> }
349
-                    { this._shouldShowButton('chat')
350
-                        && <div className = 'toolbar-button-with-badge'>
351
-                            <ToolbarButton
352
-                                accessibilityLabel =
353
-                                    { t('toolbar.accessibilityLabel.chat') }
354
-                                iconName = { _chatOpen
355
-                                    ? 'icon-chat toggled'
356
-                                    : 'icon-chat' }
357
-                                onClick = { this._onToolbarToggleChat }
358
-                                tooltip = { t('toolbar.chat') } />
359
-                            <ChatCounter />
360
-                        </div> }
361
-                    {
362
-                        this._shouldShowButton('closedcaptions')
363
-                            && <ClosedCaptionButton />
364
-                    }
365
-                </div>
366
-                <div className = 'button-group-center'>
367
-                    <AudioMuteButton
368
-                        visible = { this._shouldShowButton('microphone') } />
369
-                    <HangupButton
370
-                        visible = { this._shouldShowButton('hangup') } />
371
-                    <VideoMuteButton
372
-                        visible = { this._shouldShowButton('camera') } />
373
-                </div>
374
-                <div className = 'button-group-right'>
375
-                    { this._shouldShowButton('localrecording')
376
-                        && <LocalRecordingButton
377
-                            onClick = {
378
-                                this._onToolbarOpenLocalRecordingInfoDialog
379
-                            } />
380
-                    }
381
-                    { this._shouldShowButton('tileview')
382
-                        && <TileViewButton /> }
383
-                    { this._shouldShowButton('invite')
384
-                        && !_hideInviteButton
385
-                        && <ToolbarButton
386
-                            accessibilityLabel =
387
-                                { t('toolbar.accessibilityLabel.invite') }
388
-                            iconName = 'icon-add'
389
-                            onClick = { this._onToolbarOpenInvite }
390
-                            tooltip = { t('toolbar.invite') } /> }
391
-                    { this._shouldShowButton('info') && <InfoDialogButton /> }
392
-                    { overflowHasItems
393
-                        && <OverflowMenuButton
394
-                            isOpen = { _overflowMenuVisible }
395
-                            onVisibilityChange = { this._onSetOverflowVisible }>
396
-                            <ul
397
-                                aria-label = { t(toolbarAccLabel) }
398
-                                className = 'overflow-menu'>
399
-                                { overflowMenuContent }
400
-                            </ul>
401
-                        </OverflowMenuButton> }
402
-                </div>
325
+                <div className = 'toolbox-background' />
326
+                { this._renderToolboxContent() }
403 327
             </div>
404 328
         );
405 329
     }
@@ -1000,6 +924,97 @@ class Toolbox extends Component<Props> {
1000 924
         ];
1001 925
     }
1002 926
 
927
+    /**
928
+     * Renders the toolbox content.
929
+     *
930
+     * @returns {Array<ReactElement>}
931
+     */
932
+    _renderToolboxContent() {
933
+        const {
934
+            _chatOpen,
935
+            _hideInviteButton,
936
+            _overflowMenuVisible,
937
+            _raisedHand,
938
+            t
939
+        } = this.props;
940
+        const overflowMenuContent = this._renderOverflowMenuContent();
941
+        const overflowHasItems = Boolean(overflowMenuContent.filter(
942
+            child => child).length);
943
+        const toolbarAccLabel = 'toolbar.accessibilityLabel.moreActionsMenu';
944
+
945
+        return (
946
+            <div className = 'toolbox-content'>
947
+                <div className = 'button-group-left'>
948
+                    { this._shouldShowButton('desktop')
949
+                        && this._renderDesktopSharingButton() }
950
+                    { this._shouldShowButton('raisehand')
951
+                        && <ToolbarButton
952
+                            accessibilityLabel =
953
+                                {
954
+                                    t('toolbar.accessibilityLabel.raiseHand')
955
+                                }
956
+                            iconName = { _raisedHand
957
+                                ? 'icon-raised-hand toggled'
958
+                                : 'icon-raised-hand' }
959
+                            onClick = { this._onToolbarToggleRaiseHand }
960
+                            tooltip = { t('toolbar.raiseHand') } /> }
961
+                    { this._shouldShowButton('chat')
962
+                        && <div className = 'toolbar-button-with-badge'>
963
+                            <ToolbarButton
964
+                                accessibilityLabel =
965
+                                    { t('toolbar.accessibilityLabel.chat') }
966
+                                iconName = { _chatOpen
967
+                                    ? 'icon-chat toggled'
968
+                                    : 'icon-chat' }
969
+                                onClick = { this._onToolbarToggleChat }
970
+                                tooltip = { t('toolbar.chat') } />
971
+                            <ChatCounter />
972
+                        </div> }
973
+                    {
974
+                        this._shouldShowButton('closedcaptions')
975
+                            && <ClosedCaptionButton />
976
+                    }
977
+                </div>
978
+                <div className = 'button-group-center'>
979
+                    <AudioMuteButton
980
+                        visible = { this._shouldShowButton('microphone') } />
981
+                    <HangupButton
982
+                        visible = { this._shouldShowButton('hangup') } />
983
+                    <VideoMuteButton
984
+                        visible = { this._shouldShowButton('camera') } />
985
+                </div>
986
+                <div className = 'button-group-right'>
987
+                    { this._shouldShowButton('localrecording')
988
+                        && <LocalRecordingButton
989
+                            onClick = {
990
+                                this._onToolbarOpenLocalRecordingInfoDialog
991
+                            } />
992
+                    }
993
+                    { this._shouldShowButton('tileview')
994
+                        && <TileViewButton /> }
995
+                    { this._shouldShowButton('invite')
996
+                        && !_hideInviteButton
997
+                        && <ToolbarButton
998
+                            accessibilityLabel =
999
+                                { t('toolbar.accessibilityLabel.invite') }
1000
+                            iconName = 'icon-add'
1001
+                            onClick = { this._onToolbarOpenInvite }
1002
+                            tooltip = { t('toolbar.invite') } /> }
1003
+                    { this._shouldShowButton('info') && <InfoDialogButton /> }
1004
+                    { overflowHasItems
1005
+                        && <OverflowMenuButton
1006
+                            isOpen = { _overflowMenuVisible }
1007
+                            onVisibilityChange = { this._onSetOverflowVisible }>
1008
+                            <ul
1009
+                                aria-label = { t(toolbarAccLabel) }
1010
+                                className = 'overflow-menu'>
1011
+                                { overflowMenuContent }
1012
+                            </ul>
1013
+                        </OverflowMenuButton> }
1014
+                </div>
1015
+            </div>);
1016
+    }
1017
+
1003 1018
     _shouldShowButton: (string) => boolean;
1004 1019
 
1005 1020
     /**

Loading…
İptal
Kaydet