diff --git a/app/javascript/mastodon/components/modal_root.js b/app/javascript/mastodon/components/modal_root.js
index fe573ffdaf..9bfc0e49ff 100644
--- a/app/javascript/mastodon/components/modal_root.js
+++ b/app/javascript/mastodon/components/modal_root.js
@@ -1,12 +1,18 @@
import React from 'react';
import PropTypes from 'prop-types';
import 'wicg-inert';
+import { normal } from 'color-blend';
export default class ModalRoot extends React.PureComponent {
static propTypes = {
children: PropTypes.node,
onClose: PropTypes.func.isRequired,
+ backgroundColor: PropTypes.shape({
+ r: PropTypes.number,
+ g: PropTypes.number,
+ b: PropTypes.number,
+ }),
};
activeElement = this.props.children ? document.activeElement : null;
@@ -62,9 +68,7 @@ export default class ModalRoot extends React.PureComponent {
Promise.resolve().then(() => {
this.activeElement.focus({ preventScroll: true });
this.activeElement = null;
- }).catch((error) => {
- console.error(error);
- });
+ }).catch(console.error);
}
}
@@ -91,10 +95,16 @@ export default class ModalRoot extends React.PureComponent {
);
}
+ let backgroundColor = null;
+
+ if (this.props.backgroundColor) {
+ backgroundColor = normal({ ...this.props.backgroundColor, a: 1 }, { r: 0, g: 0, b: 0, a: 0.3 });
+ }
+
return (
diff --git a/app/javascript/styles/mastodon/boost.scss b/app/javascript/styles/mastodon/boost.scss
index f94c0aa464..fb1451cb24 100644
--- a/app/javascript/styles/mastodon/boost.scss
+++ b/app/javascript/styles/mastodon/boost.scss
@@ -1,22 +1,32 @@
-button.icon-button i.fa-retweet {
- background-image: url("data:image/svg+xml;utf8,
");
+button.icon-button {
+ i.fa-retweet {
+ background-image: url("data:image/svg+xml;utf8,
");
+ }
- &:hover {
+ &:hover i.fa-retweet {
background-image: url("data:image/svg+xml;utf8,
");
}
-}
-button.icon-button.reblogPrivate i.fa-retweet {
- background-image: url("data:image/svg+xml;utf8,
");
+ &.reblogPrivate {
+ i.fa-retweet {
+ background-image: url("data:image/svg+xml;utf8,
");
+ }
- &:hover {
- background-image: url("data:image/svg+xml;utf8,
");
- }
-}
-
-button.icon-button.disabled i.fa-retweet {
- &,
- &:hover {
- background-image: url("data:image/svg+xml;utf8,
");
+ &:hover i.fa-retweet {
+ background-image: url("data:image/svg+xml;utf8,
");
+ }
+ }
+
+ &.disabled {
+ i.fa-retweet,
+ &:hover i.fa-retweet {
+ background-image: url("data:image/svg+xml;utf8,
");
+ }
+ }
+
+ .media-modal__overlay .picture-in-picture__footer & {
+ i.fa-retweet {
+ background-image: url("data:image/svg+xml;utf8,
");
+ }
}
}
diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss
index ab2a5ac617..2fc1c12de9 100644
--- a/app/javascript/styles/mastodon/components.scss
+++ b/app/javascript/styles/mastodon/components.scss
@@ -1652,11 +1652,11 @@ a.account__display-name {
}
}
-.star-icon.active {
+.icon-button.star-icon.active {
color: $gold-star;
}
-.bookmark-icon.active {
+.icon-button.bookmark-icon.active {
color: $red-bookmark;
}
@@ -3007,7 +3007,6 @@ button.icon-button i.fa-retweet {
&::before {
display: none !important;
}
-
}
button.icon-button.active i.fa-retweet {
@@ -4487,16 +4486,19 @@ a.status-card.compact:hover {
height: 100%;
position: relative;
- .extended-video-player {
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
+ &__close,
+ &__zoom-button {
+ color: rgba($white, 0.7);
- video {
- max-width: $media-modal-media-max-width;
- max-height: $media-modal-media-max-height;
+ &:hover,
+ &:focus,
+ &:active {
+ color: $white;
+ background-color: rgba($white, 0.15);
+ }
+
+ &:focus {
+ background-color: rgba($white, 0.3);
}
}
}
@@ -4533,10 +4535,10 @@ a.status-card.compact:hover {
}
.media-modal__nav {
- background: rgba($base-overlay-background, 0.5);
+ background: transparent;
box-sizing: border-box;
border: 0;
- color: $primary-text-color;
+ color: rgba($primary-text-color, 0.7);
cursor: pointer;
display: flex;
align-items: center;
@@ -4547,6 +4549,12 @@ a.status-card.compact:hover {
position: absolute;
top: 0;
bottom: 0;
+
+ &:hover,
+ &:focus,
+ &:active {
+ color: $primary-text-color;
+ }
}
.media-modal__nav--left {
@@ -4557,58 +4565,86 @@ a.status-card.compact:hover {
right: 0;
}
-.media-modal__pagination {
- width: 100%;
- text-align: center;
+.media-modal__overlay {
+ max-width: 600px;
position: absolute;
left: 0;
- bottom: 20px;
- pointer-events: none;
-}
+ right: 0;
+ bottom: 0;
+ margin: 0 auto;
-.media-modal__meta {
- text-align: center;
- position: absolute;
- left: 0;
- bottom: 20px;
- width: 100%;
- pointer-events: none;
+ .picture-in-picture__footer {
+ border-radius: 0;
+ background: transparent;
+ padding: 20px 0;
- &--shifted {
- bottom: 62px;
- }
+ .icon-button {
+ color: $white;
- a {
- pointer-events: auto;
- text-decoration: none;
- font-weight: 500;
- color: $ui-secondary-color;
+ &:hover,
+ &:focus,
+ &:active {
+ color: $white;
+ background-color: rgba($white, 0.15);
+ }
- &:hover,
- &:focus,
- &:active {
- text-decoration: underline;
+ &:focus {
+ background-color: rgba($white, 0.3);
+ }
+
+ &.active {
+ color: $highlight-text-color;
+
+ &:hover,
+ &:focus,
+ &:active {
+ background: rgba($highlight-text-color, 0.15);
+ }
+
+ &:focus {
+ background: rgba($highlight-text-color, 0.3);
+ }
+ }
+
+ &.star-icon.active {
+ color: $gold-star;
+
+ &:hover,
+ &:focus,
+ &:active {
+ background: rgba($gold-star, 0.15);
+ }
+
+ &:focus {
+ background: rgba($gold-star, 0.3);
+ }
+ }
}
}
}
-.media-modal__page-dot {
- display: inline-block;
+.media-modal__pagination {
+ display: flex;
+ justify-content: center;
+ margin-bottom: 20px;
}
-.media-modal__button {
- background-color: $primary-text-color;
- height: 12px;
- width: 12px;
- border-radius: 6px;
- margin: 10px;
+.media-modal__page-dot {
+ flex: 0 0 auto;
+ background-color: $white;
+ opacity: 0.4;
+ height: 6px;
+ width: 6px;
+ border-radius: 50%;
+ margin: 0 4px;
padding: 0;
border: 0;
font-size: 0;
-}
+ transition: opacity .2s ease-in-out;
-.media-modal__button--active {
- background-color: $highlight-text-color;
+ &.active {
+ opacity: 1;
+ }
}
.media-modal__close {
diff --git a/package.json b/package.json
index f4ca18e4d8..7b8f49dd8b 100644
--- a/package.json
+++ b/package.json
@@ -83,6 +83,7 @@
"babel-runtime": "^6.26.0",
"blurhash": "^1.1.3",
"classnames": "^2.2.5",
+ "color-blend": "^3.0.0",
"compression-webpack-plugin": "^6.1.1",
"cross-env": "^7.0.2",
"css-loader": "^5.0.1",
diff --git a/yarn.lock b/yarn.lock
index d6c175ea74..1a0ef66e25 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2941,6 +2941,11 @@ collection-visit@^1.0.0:
map-visit "^1.0.0"
object-visit "^1.0.0"
+color-blend@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/color-blend/-/color-blend-3.0.0.tgz#077073ee59ebce15e084f00590c5bf7577899cb5"
+ integrity sha512-m21ytRyjsIkVOGG1jrrpijhx7icji0MljlxUoa0ER7lgGW11as0GPLrXQQuMULH1BWJ7OsR11Dy2S6A5lehg5A==
+
color-convert@^1.9.0, color-convert@^1.9.1:
version "1.9.3"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"