Skip to content

Commit

Permalink
fixes #399
Browse files Browse the repository at this point in the history
  • Loading branch information
razwan committed Jul 6, 2022
1 parent 71f59b4 commit 51d5511
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@

> :is(.nb-supernova-item__content, .nb-supernova-item__media-wrapper) {
position: static !important;
grid-area: 1 / 1 / span 1 / span 1;

width: auto;
height: auto;

grid-area: 1 / 1 / span 1 / span 1;
align-self: stretch;
}

> .nb-supernova-item__content {
Expand Down
4 changes: 4 additions & 0 deletions packages/scrolling-effect/src/editor-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,7 @@
.nb-scrolling-preview-control {
margin-bottom: 24px;
}

.novablocks-doppler__wrapper > div {
height: 100%;
}
22 changes: 5 additions & 17 deletions packages/scrolling-effect/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ export const getIntermediateFocalPoint = ( focalPoint1, focalPoint2, progress )
};

export const getStyles = ( config, attributes ) => {
const { scrollingEffect } = attributes;

if ( 'static' === scrollingEffect ) {
return {};
}

const props = getProps( config, attributes );

Expand Down Expand Up @@ -154,26 +159,9 @@ export const getProps = function( config, attributes, fixed ) {

const {
scrollingEffect,
initialBackgroundScale,
} = attributes;

const newFocalPoint = getFocalPoint( attributes, progress );

if ( scrollingEffect === 'static' ) {

return {
width: containerBox.width,
height: containerBox.height,
scale: initialBackgroundScale || 1,
moveX: 0,
moveY: 0,
offsetX: 0,
offsetY: 0,
parallaxAmount: 0,
focalPoint: newFocalPoint,
};
}

const parallaxAmount = userPrefersReducedMotion() ? 0 : scrollingEffect === 'parallax' ? 0.75 : 1;
const { maxScale, newScale } = getScales( attributes, progress );
const newImageHeight = getNewImageHeight( config, parallaxAmount );
Expand Down

0 comments on commit 51d5511

Please sign in to comment.