Skip to content

Commit

Permalink
feat(project): remove posterFading, shelfTitles and dynamicBlur settings
Browse files Browse the repository at this point in the history
- dynamicBlur=false, posterFading=true and shelfTitles=true are used by default in the codebase
  • Loading branch information
AntonLantukh committed Jan 18, 2023
1 parent 475a1f5 commit 9b3a315
Show file tree
Hide file tree
Showing 31 changed files with 34 additions and 363 deletions.
22 changes: 0 additions & 22 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,6 @@ Use the `styling` object to define extra styles for your application.
"backgroundColor": null,
"highlightColor": null,
"headerBackground": null,
"dynamicBlur": true,
"posterFading": true,
"shelfTitles": true,
"footerText": "Blender Foundation"
}
```
Expand Down Expand Up @@ -211,25 +208,6 @@ Text that will be placed in the footer of the site. Markdown links are supported

---

**styling.dynamicBlur** (optional)

Set this parameter to `true` if you want to enable the Dynamic Blur feature. The Dynamic Blur feature is a blurred image of the current item on the background of the screen. When a user hovers a card, the blurred image changes to the selected item.

---

**styling.posterFading** (optional)

Set this parameter to `true` if you want to enable the Poster Fading feature. By default, a boxed preview is shown on the video and series detail page. With posterFading set to `true`, this image is placed on the background instead and fills a larger portion of the screen.


---

**styling.shelfTitles** (optional)

Set this parameter to `false` if you want to disable titles below the cards on the home, playlist and search screen.

---

**features**

Use the `features` object to define extra properties for your app.
Expand Down
6 changes: 2 additions & 4 deletions src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ type CardProps = {
isCurrent?: boolean;
isLocked?: boolean;
currentLabel?: string;
enableTitle?: boolean;
};

function Card({
Expand All @@ -44,7 +43,6 @@ function Card({
episodeNumber,
progress,
posterAspect = '16:9',
enableTitle = true,
featured = false,
disabled = false,
loading = false,
Expand Down Expand Up @@ -94,7 +92,7 @@ function Card({
{isCurrent && <div className={styles.currentLabel}>{currentLabel}</div>}
{!loading && (
<div className={styles.meta}>
{featured && !disabled && enableTitle && <div className={classNames(styles.title, { [styles.loading]: loading })}>{title}</div>}
{featured && !disabled && <div className={classNames(styles.title, { [styles.loading]: loading })}>{title}</div>}
<div className={styles.tags}>
{isLocked && (
<div className={classNames(styles.tag, styles.lock)} aria-label={t('card_lock')} role="status">
Expand All @@ -111,7 +109,7 @@ function Card({
</div>
) : null}
</div>
{!featured && !disabled && enableTitle && (
{!featured && !disabled && (
<div className={styles.titleContainer}>
<div className={classNames(styles.title, { [styles.loading]: loading })}>{title}</div>
</div>
Expand Down
3 changes: 0 additions & 3 deletions src/components/CardGrid/CardGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ type CardGridProps = {
onCardClick: (item: PlaylistItem, playlistId?: string) => void;
watchHistory?: { [key: string]: number };
isLoading: boolean;
enableCardTitles?: boolean;
cols?: Breakpoints;
currentCardItem?: PlaylistItem;
currentCardLabel?: string;
Expand All @@ -43,7 +42,6 @@ function CardGrid({
onCardClick,
onCardHover,
watchHistory,
enableCardTitles = true,
isLoading = false,
cols = defaultCols,
currentCardItem,
Expand All @@ -70,7 +68,6 @@ function CardGrid({
<div role="cell">
<Card
title={title}
enableTitle={enableCardTitles}
duration={duration}
image={shelfImage}
progress={watchHistory ? watchHistory[mediaid] : undefined}
Expand Down
16 changes: 0 additions & 16 deletions src/components/DynamicBlur/DynamicBlur.module.scss

This file was deleted.

12 changes: 0 additions & 12 deletions src/components/DynamicBlur/DynamicBlur.test.tsx

This file was deleted.

79 changes: 0 additions & 79 deletions src/components/DynamicBlur/DynamicBlur.tsx

This file was deleted.

This file was deleted.

16 changes: 2 additions & 14 deletions src/components/Favorites/Favorites.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ type Props = {
isLoading: boolean;
accessModel: AccessModel;
hasSubscription: boolean;
shelfTitles?: boolean;
onCardClick: (item: PlaylistItem) => void;
onCardHover: (item: PlaylistItem) => void;
onCardHover?: (item: PlaylistItem) => void;
onClearFavoritesClick: () => void;
};

Expand All @@ -31,17 +30,7 @@ const cols: Breakpoints = {
[Breakpoint.xl]: 3,
};

const Favorites = ({
playlist,
error,
isLoading,
shelfTitles,
accessModel,
hasSubscription,
onCardClick,
onCardHover,
onClearFavoritesClick,
}: Props): JSX.Element => {
const Favorites = ({ playlist, error, isLoading, accessModel, hasSubscription, onCardClick, onCardHover, onClearFavoritesClick }: Props): JSX.Element => {
const { t } = useTranslation('user');

if (isLoading) return <LoadingOverlay />;
Expand All @@ -63,7 +52,6 @@ const Favorites = ({
onCardHover={onCardHover}
cols={cols}
isLoading={isLoading}
enableCardTitles={shelfTitles}
accessModel={accessModel}
isLoggedIn={true}
hasSubscription={hasSubscription}
Expand Down
17 changes: 1 addition & 16 deletions src/components/Shelf/Shelf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const Shelf = ({
title,
watchHistory,
enableTitle = true,
enableCardTitles = true,
featured = false,
loading = false,
error = null,
Expand All @@ -76,7 +75,6 @@ const Shelf = ({
<Card
key={item.mediaid}
title={item.title}
enableTitle={enableCardTitles}
duration={item.duration}
progress={watchHistory ? watchHistory[item.mediaid] : undefined}
image={item.shelfImage}
Expand All @@ -92,20 +90,7 @@ const Shelf = ({
posterAspect={posterAspect}
/>
),
[
enableCardTitles,
watchHistory,
onCardHover,
featured,
loading,
accessModel,
isLoggedIn,
hasSubscription,
posterAspect,
onCardClick,
playlist.feedid,
type,
],
[watchHistory, onCardHover, featured, loading, accessModel, isLoggedIn, hasSubscription, posterAspect, onCardClick, playlist.feedid, type],
);

const renderRightControl = useCallback(
Expand Down
63 changes: 14 additions & 49 deletions src/components/VideoDetails/VideoDetails.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
&.hidden {
display: none;
}

&.posterNormal {
position: relative;
}
}

.info {
Expand Down Expand Up @@ -143,61 +139,30 @@
position: absolute;
top: 0;
right: 0;

z-index: -1;

width: 80vw;
height: calc(85vw / 16 * 9);

background-repeat: no-repeat;
background-position: center center;
background-size: cover;
// fix for Safari (poster will render below the dynamic blur)
transform: translateZ(0);

&.normal {
right: 56px;
width: auto;
height: 100%;
border-radius: 4px;
mask-image: linear-gradient(-90deg, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 100%);
-webkit-mask-image: linear-gradient(-90deg, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 100%); /* stylelint-disable-line */

@include responsive.desktop-small-only() {
right: 34px;
}

@include responsive.tablet-only() {
right: 24px;
max-width: 80vw;
max-height: 350px;
}
mask-image: radial-gradient(farthest-corner at 80% 20%, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0) 60%);
//noinspection CssInvalidPropertyValue
-webkit-mask-image: radial-gradient(farthest-corner at 80% 20%, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0) 60%); /* stylelint-disable-line */

@include responsive.mobile-only() {
top: -#{variables.$header-height-mobile + 16};
right: -16px;
left: -16px;
width: 100vw;
height: 400px;
border-radius: 0;

mask-image: radial-gradient(191% 141% at 100% 10%, rgb(0, 0, 0) 40%, rgba(0, 0, 0, 0) 60%);
//noinspection CssInvalidPropertyValue
-webkit-mask-image: radial-gradient(191% 141% at 100% 10%, rgb(0, 0, 0) 40%, rgba(0, 0, 0, 0) 60%); /* stylelint-disable-line */
}
}

&.fading {
@include responsive.tablet-only() {
width: 80vw;
height: calc(85vw / 16 * 9);
mask-image: radial-gradient(farthest-corner at 80% 20%, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0) 60%);
//noinspection CssInvalidPropertyValue
-webkit-mask-image: radial-gradient(farthest-corner at 80% 20%, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0) 60%); /* stylelint-disable-line */

@include responsive.tablet-only() {
width: 80vw;
height: calc(140vw / 16 * 9);
}
height: calc(140vw / 16 * 9);
}

@include responsive.mobile-only() {
width: 110vw;
height: calc(180vw / 16 * 9);
}
@include responsive.mobile-only() {
width: 110vw;
height: calc(180vw / 16 * 9);
}
}

Expand Down
Loading

0 comments on commit 9b3a315

Please sign in to comment.