Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Move backdrop filter to a canvas based solution #6262

Merged
merged 41 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
27ee7c5
Move backdrop filter to a canvas based solution
germain-gg Jun 24, 2021
652ad36
Backdrop filter compatibility for Firefox and Safari
germain-gg Jun 25, 2021
e628cac
Improve image drawing fill strategy
germain-gg Jun 25, 2021
6d293d1
Merge branch 'develop' into gsouquet/fix-backdrop-filter
germain-gg Jun 25, 2021
31a363d
mock canvas filter polyfill in tests
germain-gg Jun 25, 2021
bf89aa9
Add BackdropPanel copyright header
germain-gg Jun 25, 2021
a17b13f
Add drawable copyright header
germain-gg Jun 25, 2021
533d5ad
Specify return type for drawable promise
germain-gg Jun 25, 2021
5932b93
make backdrop closer to what is happening in production
germain-gg Jun 25, 2021
edae9a4
Merge branch 'develop' into gsouquet/fix-backdrop-filter
germain-gg Jul 6, 2021
7e6d378
Update benchmark action for lockfile diff
germain-gg Jul 6, 2021
dc17bfe
Update benchmark action for lockfile diff
germain-gg Jul 6, 2021
fbac730
Merge branch 'develop' into gsouquet/fix-backdrop-filter
germain-gg Jul 6, 2021
d6c3a22
fix lockfiles
germain-gg Jul 6, 2021
36ba65b
Merge branch 'develop' into gsouquet/fix-backdrop-filter
germain-gg Jul 12, 2021
8f345dc
Rework backdrop to draw one image with two different level of blur
germain-gg Jul 12, 2021
5f9b55e
Merge remote-tracking branch 'origin/develop' into gsouquet/fix-backd…
Palid Aug 13, 2021
7f58a21
Improve BackdropPanel performance by ignoring React
Palid Aug 13, 2021
94a5013
temp
Palid Aug 13, 2021
8bd5441
Merge branch 'develop' into gsouquet/fix-backdrop-filter
Palid Aug 16, 2021
582b5c9
Properly sepearate left column from timeline
Palid Aug 16, 2021
bad37e6
Add missing position:relative;
Palid Aug 16, 2021
a279779
Add proper glass-like look
Palid Aug 16, 2021
bdb5f3b
Refactor GroupFilterPanel to typescript
Palid Aug 17, 2021
a999cad
Properly cache blur effect
Palid Aug 17, 2021
2ee26d0
Make the blur as-close to the css one as possible
Palid Aug 17, 2021
de2eb5b
Satisfy linter
Palid Aug 17, 2021
515fc24
Revert useless change
Palid Aug 17, 2021
78d48b1
Fix weird code style
Palid Aug 17, 2021
eb24204
Fix missing background tonality without avatar
Palid Aug 17, 2021
3fd95ad
Fix missing coma
Palid Aug 17, 2021
a7bda2b
Better blur values for nicer experience
Palid Aug 17, 2021
b1c724a
Fix invalid width for blurred sidebar
Palid Aug 17, 2021
6310949
Fix background blur not being shown on first load
Palid Aug 17, 2021
b5178a3
Fix fonts for inputs being of wrong colors
Palid Aug 17, 2021
e83722e
Fix missing background color in GroupFilterPanel
Aug 18, 2021
455a914
Merge remote-tracking branch 'origin/develop' into gsouquet/fix-backd…
Aug 19, 2021
d65f6dd
Fix bad merge
Aug 19, 2021
468bb5c
Fix mr comments
Aug 19, 2021
fe1d0e6
Remove useless constructor
Aug 19, 2021
fa03b10
Fix missing type for state
Aug 19, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"cheerio": "^1.0.0-rc.9",
"classnames": "^2.2.6",
"commonmark": "^0.29.3",
"context-filter-polyfill": "^0.2.4",
"counterpart": "^0.18.6",
"diff-dom": "^4.2.2",
"diff-match-patch": "^1.0.5",
Expand Down Expand Up @@ -193,6 +194,7 @@
"decoderWorker\\.min\\.js": "<rootDir>/__mocks__/empty.js",
"decoderWorker\\.min\\.wasm": "<rootDir>/__mocks__/empty.js",
"waveWorker\\.min\\.js": "<rootDir>/__mocks__/empty.js",
"context-filter-polyfill": "<rootDir>/__mocks__/empty.js",
"workers/(.+)\\.worker\\.ts": "<rootDir>/__mocks__/workerMock.js",
"RecorderWorklet": "<rootDir>/__mocks__/empty.js"
},
Expand Down
2 changes: 1 addition & 1 deletion res/css/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ input[type=text]:focus, input[type=password]:focus, textarea:focus {
// it has the appearance of a text box so the controls
// appear to be part of the input

.mx_Dialog, .mx_MatrixChat {
.mx_Dialog, .mx_MatrixChat_wrapper {
.mx_textinput > input[type=text],
.mx_textinput > input[type=search] {
border: none;
Expand Down
1 change: 1 addition & 0 deletions res/css/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
@import "./structures/_LeftPanelWidget.scss";
@import "./structures/_MainSplit.scss";
@import "./structures/_MatrixChat.scss";
@import "./structures/_BackdropPanel.scss";
@import "./structures/_MyGroups.scss";
@import "./structures/_NonUrgentToastContainer.scss";
@import "./structures/_NotificationPanel.scss";
Expand Down
51 changes: 51 additions & 0 deletions res/css/structures/_BackdropPanel.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
Copyright 2021 New Vector Ltd

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

.mx_BackdropPanel {
position: absolute;
left: 0;
top: 0;
height: 100vh;
width: 100%;
overflow: hidden;

&::before {
content: " ";
position: absolute;
left: 0;
top: 0;
height: 100vh;
width: 100%;
background-color: var(--lp-background-overlay);
}
}

.mx_BackdropPanel--canvas {
position: absolute;
top: 0;
left: 0;
min-height: 100%;
z-index: 0;
pointer-events: none;
overflow: hidden;

&:nth-of-type(2n-1) {
opacity: 0.2;
}
&:nth-of-type(2n) {
opacity: 0.1;
}
}
9 changes: 8 additions & 1 deletion res/css/structures/_GroupFilterPanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

.mx_MatrixChat--with-avatar {
.mx_GroupFilterPanel {
background-color: transparent;
}
}

.mx_GroupFilterPanel {
flex: 1;
background-color: $groupFilterPanel-bg-color;
flex: 1;
cursor: pointer;
position: relative;

display: flex;
flex-direction: column;
Expand Down
9 changes: 8 additions & 1 deletion res/css/structures/_LeftPanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,22 @@ limitations under the License.
$groupFilterPanelWidth: 56px; // only applies in this file, used for calculations
$roomListCollapsedWidth: 68px;

.mx_MatrixChat--with-avatar {
.mx_LeftPanel,
.mx_LeftPanel .mx_LeftPanel_roomListContainer {
background-color: transparent;
}
}

.mx_LeftPanel {
background-color: $roomlist-bg-color;
// TODO decrease this once Spaces launches as it'll no longer need to include the 56px Community Panel
min-width: 206px;
max-width: 50%;

// Create a row-based flexbox for the GroupFilterPanel and the room list
display: flex;
contain: content;
position: relative;

.mx_LeftPanel_GroupFilterPanelContainer {
flex-grow: 0;
Expand Down
7 changes: 3 additions & 4 deletions res/css/structures/_MatrixChat.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ limitations under the License.
.mx_MatrixChat_wrapper {
display: flex;

flex-direction: column;

width: 100%;
height: 100%;
}
Expand All @@ -42,15 +40,16 @@ limitations under the License.
}

.mx_MatrixChat {
position: relative;
width: 100%;
height: 100%;

display: flex;

order: 2;

flex: 1;
flex-grow: 0;
min-height: 0;
max-width: 50%;
}

.mx_MatrixChat_syncError {
Expand Down
2 changes: 2 additions & 0 deletions res/css/structures/_RoomView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ limitations under the License.
word-wrap: break-word;
display: flex;
flex-direction: column;
flex: 1;
position: relative;
}


Expand Down
9 changes: 8 additions & 1 deletion res/css/structures/_SpacePanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,18 @@ $activeBorderTransparentGap: 1px;
$activeBackgroundColor: $roomtile-selected-bg-color;
$activeBorderColor: $secondary-fg-color;

.mx_MatrixChat--with-avatar {
.mx_SpacePanel {
background-color: transparent;
}
}

.mx_SpacePanel {
flex: 0 0 auto;
background-color: $groupFilterPanel-bg-color;
flex: 0 0 auto;
padding: 0;
margin: 0;
position: relative;

// Create another flexbox so the Panel fills the container
display: flex;
Expand Down
9 changes: 6 additions & 3 deletions res/themes/dark/css/_dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,12 @@ $voice-playback-button-fg-color: $message-body-panel-icon-fg-color;
// Appearance tab colors
$appearance-tab-border-color: $room-highlight-color;

// blur amounts for left left panel (only for element theme, used in _mods.scss)
$roomlist-background-blur-amount: 60px;
$groupFilterPanel-background-blur-amount: 30px;
// blur amounts for left left panel (only for element theme)
:root {
--llp-background-blur: 160px;
--lp-background-blur: 90px;
--lp-background-overlay: rgba(255, 255, 255, 0.055);
}

$composer-shadow-color: rgba(0, 0, 0, 0.28);

Expand Down
4 changes: 0 additions & 4 deletions res/themes/dark/css/dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
@import "../../light/css/_paths.scss";
@import "../../light/css/_fonts.scss";
@import "../../light/css/_light.scss";
// important this goes before _mods,
// as $groupFilterPanel-background-blur-amount and
// $roomlist-background-blur-amount
// are overridden in _dark.scss
@import "_dark.scss";
@import "../../light/css/_mods.scss";
@import "../../../../res/css/_components.scss";
Expand Down
10 changes: 6 additions & 4 deletions res/themes/light/css/_light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,12 @@ $voice-playback-button-fg-color: $message-body-panel-icon-fg-color;
// FontSlider colors
$appearance-tab-border-color: $input-darker-bg-color;

// blur amounts for left left panel (only for element theme, used in _mods.scss)
$roomlist-background-blur-amount: 40px;
$groupFilterPanel-background-blur-amount: 20px;

// blur amounts for left left panel (only for element theme)
:root {
--llp-background-blur: 120px;
--lp-background-blur: 60px;
--lp-background-overlay: rgba(0, 0, 0, 0.055);
}
$composer-shadow-color: rgba(0, 0, 0, 0.04);

// Bubble tiles
Expand Down
21 changes: 0 additions & 21 deletions res/themes/light/css/_mods.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,6 @@
// set the user avatar (if any) as a background so
// it can be blurred by the tag panel and room list

@supports (backdrop-filter: none) {
.mx_LeftPanel {
background-image: var(--avatar-url, unset);
background-repeat: no-repeat;
background-size: cover;
background-position: left top;
}

.mx_GroupFilterPanel {
backdrop-filter: blur($groupFilterPanel-background-blur-amount);
}

.mx_SpacePanel {
backdrop-filter: blur($groupFilterPanel-background-blur-amount);
}

.mx_LeftPanel .mx_LeftPanel_roomListContainer {
backdrop-filter: blur($roomlist-background-blur-amount);
}
}

.mx_RoomSublist_showNButton {
background-color: transparent !important;
}
Expand Down
Loading