Quellcode durchsuchen

feat(filmstrip) Updated filmstrip design (#10791)

Added background on hover
Updated toggle button
Made vertical filmstrip full height on desktop
master
Robert Pintilii vor 3 Jahren
Ursprung
Commit
820ff8473c
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden

+ 1
- 1
css/_toolbars.scss Datei anzeigen

@@ -30,7 +30,7 @@
30 30
     transition: bottom .3s ease-in;
31 31
     width: 100%;
32 32
     pointer-events: none;
33
-
33
+    z-index: $toolbarZ + 2;
34 34
 
35 35
     &.visible {
36 36
         bottom: 0;

+ 0
- 30
css/filmstrip/_filmstrip_toolbar.scss Datei anzeigen

@@ -1,30 +0,0 @@
1
-.filmstrip__toolbar {
2
-    @include flex();
3
-    flex-direction: column-reverse;
4
-    flex-wrap: nowrap;
5
-    position: relative;
6
-    width: $filmstripToggleButtonWidth;
7
-
8
-    button {
9
-        font-size: 14px;
10
-        line-height: 1.2;
11
-        text-align: center;
12
-        background: transparent;
13
-        opacity: 0.7;
14
-        height: auto;
15
-        width: 100%;
16
-        padding: 0;
17
-        margin: 0;
18
-        border: none;
19
-
20
-        -webkit-appearance: none;
21
-
22
-        &:hover {
23
-            opacity: 1;
24
-        }
25
-
26
-        i {
27
-            cursor: pointer;
28
-        }
29
-    }
30
-}

+ 1
- 4
css/filmstrip/_horizontal_filmstrip.scss Datei anzeigen

@@ -6,11 +6,8 @@
6 6
 }
7 7
 
8 8
 .horizontal-filmstrip .filmstrip {
9
-    bottom: 0;
10
-    right: 0;
11 9
     padding: 10px 5px;
12 10
     @extend %align-right;
13
-    transition: bottom .3s;
14 11
     z-index: $filmstripVideosZ;
15 12
     box-sizing: border-box;
16 13
     width: 100%;
@@ -58,7 +55,7 @@
58 55
         }
59 56
 
60 57
         &.hidden {
61
-            bottom: calc(-196px - #{$newToolbarSizeWithPadding});
58
+            bottom: calc(-196px - #{$newToolbarSizeWithPadding} + 50px);
62 59
         }
63 60
     }
64 61
 

+ 1
- 2
css/filmstrip/_tile_view_overrides.scss Datei anzeigen

@@ -17,8 +17,7 @@
17 17
     #dominantSpeaker,
18 18
     #filmstripLocalVideoThumbnail,
19 19
     #largeVideoElementsContainer,
20
-    #sharedVideo,
21
-    .filmstrip__toolbar {
20
+    #sharedVideo {
22 21
         display: none;
23 22
     }
24 23
 

+ 0
- 7
css/filmstrip/_vertical_filmstrip.scss Datei anzeigen

@@ -37,7 +37,6 @@
37 37
      */
38 38
     position: fixed;
39 39
     top: 0;
40
-    transition: height .3s ease-in;
41 40
     right: 0;
42 41
     z-index: $filmstripVideosZ;
43 42
 
@@ -52,11 +51,6 @@
52 51
         right: 0;
53 52
         width: auto;
54 53
 
55
-        &.hidden {
56
-            bottom: auto;
57
-            right: -196px;
58
-        }
59
-
60 54
         /**
61 55
          * An id selector is used to match id specificity with existing
62 56
          * filmstrip styles.
@@ -64,7 +58,6 @@
64 58
         &#remoteVideos {
65 59
             border: $thumbnailsBorder solid transparent;
66 60
             padding-left: 0;
67
-            transition: right 2s;
68 61
             width: 100%;
69 62
         }
70 63
     }

+ 0
- 8
css/filmstrip/_vertical_filmstrip_overrides.scss Datei anzeigen

@@ -1,11 +1,3 @@
1
-/**
2
- * Rotate the hide filmstrip icon so it points towards the right edge
3
- * of the screen.
4
- */
5
-.vertical-filmstrip .filmstrip__toolbar {
6
-    transform: rotate(-90deg);
7
-}
8
-
9 1
 /**
10 2
  * Overrides for video containers that should not be centered aligned to avoid=
11 3
  * clashing with the filmstrip.

+ 0
- 1
css/main.scss Datei anzeigen

@@ -69,7 +69,6 @@ $flagsImagePath: "../images/";
69 69
 @import '404';
70 70
 @import 'policy';
71 71
 @import 'popover';
72
-@import 'filmstrip/filmstrip_toolbar';
73 72
 @import 'filmstrip/horizontal_filmstrip';
74 73
 @import 'filmstrip/small_video';
75 74
 @import 'filmstrip/tile_view';

+ 114
- 11
react/features/filmstrip/components/web/Filmstrip.js Datei anzeigen

@@ -1,5 +1,7 @@
1 1
 /* @flow */
2 2
 
3
+import { withStyles } from '@material-ui/styles';
4
+import clsx from 'clsx';
3 5
 import React, { PureComponent } from 'react';
4 6
 import { FixedSizeList, FixedSizeGrid } from 'react-window';
5 7
 import type { Dispatch } from 'redux';
@@ -80,6 +82,11 @@ type Props = {
80 82
      */
81 83
     _isFilmstripButtonEnabled: boolean,
82 84
 
85
+    /**
86
+     * Whether or not the current layout is vertical filmstrip.
87
+     */
88
+    _isVerticalFilmstrip: boolean,
89
+
83 90
     /**
84 91
      * The participants in the call.
85 92
      */
@@ -125,6 +132,11 @@ type Props = {
125 132
      */
126 133
     _isToolboxVisible: Boolean,
127 134
 
135
+    /**
136
+     * An object containing the CSS classes.
137
+     */
138
+    classes: Object,
139
+
128 140
     /**
129 141
      * The redux {@code dispatch} function.
130 142
      */
@@ -136,6 +148,84 @@ type Props = {
136 148
     t: Function
137 149
 };
138 150
 
151
+/**
152
+ * Creates the styles for the component.
153
+ *
154
+ * @param {Object} theme - The current theme.
155
+ * @returns {Object}
156
+ */
157
+const styles = theme => {
158
+    return {
159
+        toggleFilmstripContainer: {
160
+            display: 'flex',
161
+            flexWrap: 'nowrap',
162
+            alignItems: 'center',
163
+            justifyContent: 'center',
164
+            backgroundColor: 'rgba(0, 0, 0, .6)',
165
+            width: '32px',
166
+            height: '24px',
167
+            position: 'absolute',
168
+            borderRadius: '4px',
169
+            top: 'calc(-24px - 2px)',
170
+            left: 'calc(50% - 16px)',
171
+            opacity: 0,
172
+            transition: 'opacity .3s'
173
+        },
174
+
175
+        toggleFilmstripButton: {
176
+            fontSize: '14px',
177
+            lineHeight: 1.2,
178
+            textAlign: 'center',
179
+            background: 'transparent',
180
+            height: 'auto',
181
+            width: '100%',
182
+            padding: 0,
183
+            margin: 0,
184
+            border: 'none',
185
+
186
+            '-webkit-appearance': 'none',
187
+
188
+            '& svg': {
189
+                fill: theme.palette.icon02
190
+            }
191
+        },
192
+
193
+        toggleVerticalFilmstripContainer: {
194
+            transform: 'rotate(-90deg)',
195
+            left: 'calc(-24px - 2px - 5px)',
196
+            top: 'calc(50% - 16px)'
197
+        },
198
+
199
+        filmstrip: {
200
+            transition: 'background .2s ease-in-out, right 1s, bottom 1s, height .3s ease-in',
201
+            right: 0,
202
+            bottom: 0,
203
+
204
+            '&:hover': {
205
+                backgroundColor: 'rgba(0, 0, 0, .6)',
206
+
207
+                '& .toggleFilmstripContainer': {
208
+                    opacity: 1
209
+                }
210
+            },
211
+
212
+            '.horizontal-filmstrip &.hidden': {
213
+                bottom: '-50px',
214
+
215
+                '&:hover': {
216
+                    backgroundColor: 'transparent'
217
+                }
218
+            },
219
+
220
+            '&.hidden': {
221
+                '& .toggleFilmstripContainer': {
222
+                    opacity: 1
223
+                }
224
+            }
225
+        }
226
+    };
227
+};
228
+
139 229
 /**
140 230
  * Implements a React {@link Component} which represents the filmstrip on
141 231
  * Web/React.
@@ -195,7 +285,7 @@ class Filmstrip extends PureComponent <Props> {
195 285
      */
196 286
     render() {
197 287
         const filmstripStyle = { };
198
-        const { _currentLayout, _disableSelfView } = this.props;
288
+        const { _currentLayout, _disableSelfView, classes, _visible } = this.props;
199 289
         const tileViewActive = _currentLayout === LAYOUTS.TILE_VIEW;
200 290
 
201 291
         switch (_currentLayout) {
@@ -203,18 +293,24 @@ class Filmstrip extends PureComponent <Props> {
203 293
             // Adding 18px for the 2px margins, 2px borders on the left and right and 5px padding on the left and right.
204 294
             // Also adding 7px for the scrollbar.
205 295
             filmstripStyle.maxWidth = (interfaceConfig.FILM_STRIP_MAX_HEIGHT || 120) + 25;
296
+
297
+            if (!_visible) {
298
+                filmstripStyle.right = `-${filmstripStyle.maxWidth + 2}px`;
299
+            }
206 300
             break;
207 301
         }
208 302
 
209 303
         let toolbar = null;
210 304
 
211
-        if (!this.props._iAmRecorder && this.props._isFilmstripButtonEnabled) {
305
+        if (!this.props._iAmRecorder && this.props._isFilmstripButtonEnabled && _currentLayout !== LAYOUTS.TILE_VIEW) {
212 306
             toolbar = this._renderToggleButton();
213 307
         }
214 308
 
215 309
         return (
216 310
             <div
217
-                className = { `filmstrip ${this.props._className}` }
311
+                className = { clsx('filmstrip',
312
+                    this.props._className,
313
+                    classes.filmstrip) }
218 314
                 style = { filmstripStyle }>
219 315
                 { toolbar }
220 316
                 <div
@@ -534,17 +630,20 @@ class Filmstrip extends PureComponent <Props> {
534 630
      */
535 631
     _renderToggleButton() {
536 632
         const icon = this.props._visible ? IconMenuDown : IconMenuUp;
537
-        const { t } = this.props;
633
+        const { t, classes, _isVerticalFilmstrip } = this.props;
538 634
         const actions = isMobileBrowser()
539 635
             ? { onTouchStart: this._onToggleButtonTouch }
540 636
             : { onClick: this._onToolbarToggleFilmstrip };
541 637
 
542 638
         return (
543 639
             <div
544
-                className = 'filmstrip__toolbar'>
640
+                className = { clsx(classes.toggleFilmstripContainer,
641
+                    _isVerticalFilmstrip && classes.toggleVerticalFilmstripContainer,
642
+                    'toggleFilmstripContainer') }>
545 643
                 <button
546 644
                     aria-expanded = { this.props._visible }
547 645
                     aria-label = { t('toolbar.accessibilityLabel.toggleFilmstrip') }
646
+                    className = { classes.toggleFilmstripButton }
548 647
                     id = 'toggleFilmstripButton'
549 648
                     onFocus = { this._onTabIn }
550 649
                     tabIndex = { 0 }
@@ -600,10 +699,13 @@ function _mapStateToProps(state) {
600 699
         && isMobileBrowser()
601 700
         && clientWidth <= ASPECT_RATIO_BREAKPOINT;
602 701
 
603
-    const className = `${remoteVideosVisible ? '' : 'hide-videos'} ${
604
-        reduceHeight ? 'reduce-height' : ''
605
-    } ${shiftRight ? 'shift-right' : ''} ${collapseTileView ? 'collapse' : ''}`.trim();
702
+    const shouldReduceHeight = reduceHeight && (
703
+        isMobileBrowser() || _currentLayout !== LAYOUTS.VERTICAL_FILMSTRIP_VIEW);
704
+
606 705
     const videosClassName = `filmstrip__videos${visible ? '' : ' hidden'}`;
706
+    const className = `${remoteVideosVisible ? '' : 'hide-videos'} ${
707
+        shouldReduceHeight ? 'reduce-height' : ''
708
+    } ${shiftRight ? 'shift-right' : ''} ${collapseTileView ? 'collapse' : ''} ${visible ? '' : 'hidden'}`.trim();
607 709
     let _thumbnailSize, remoteFilmstripHeight, remoteFilmstripWidth;
608 710
 
609 711
     switch (_currentLayout) {
@@ -616,7 +718,7 @@ function _mapStateToProps(state) {
616 718
         const { remote, remoteVideosContainer } = state['features/filmstrip'].verticalViewDimensions;
617 719
 
618 720
         _thumbnailSize = remote;
619
-        remoteFilmstripHeight = remoteVideosContainer?.height - (reduceHeight ? TOOLBAR_HEIGHT : 0);
721
+        remoteFilmstripHeight = remoteVideosContainer?.height - (shouldReduceHeight ? TOOLBAR_HEIGHT : 0);
620 722
         remoteFilmstripWidth = remoteVideosContainer?.width;
621 723
         break;
622 724
     }
@@ -647,8 +749,9 @@ function _mapStateToProps(state) {
647 749
         _thumbnailsReordered: enableThumbnailReordering,
648 750
         _videosClassName: videosClassName,
649 751
         _visible: visible,
650
-        _isToolboxVisible: isToolboxVisible(state)
752
+        _isToolboxVisible: isToolboxVisible(state),
753
+        _isVerticalFilmstrip: _currentLayout === LAYOUTS.VERTICAL_FILMSTRIP_VIEW
651 754
     };
652 755
 }
653 756
 
654
-export default translate(connect(_mapStateToProps)(Filmstrip));
757
+export default withStyles(styles)(translate(connect(_mapStateToProps)(Filmstrip)));

Laden…
Abbrechen
Speichern