Skip to content

Commit

Permalink
feat(zStack): custom border radius for pushElement (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-rr committed Nov 3, 2022
1 parent bc8d5ca commit 1eb1f4c
Show file tree
Hide file tree
Showing 17 changed files with 31 additions and 22 deletions.
2 changes: 1 addition & 1 deletion dist/core/index.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions dist/cupertino-pane.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* Released under the MIT License
*
* Released on: October 29, 2022
* Released on: November 3, 2022
*/

/******************************************************************************
Expand Down Expand Up @@ -1107,6 +1107,7 @@ class ZStackModule {
this.zStackDefaults = {
pushElements: null,
minPushHeight: null,
cardBorderRadius: null,
cardYOffset: 0,
cardZScale: 0.93,
cardContrast: 0.85,
Expand Down Expand Up @@ -1158,6 +1159,7 @@ class ZStackModule {
pushTransition(pushElement, newPaneY, transition) {
let zStack = this.settings.zStack.pushElements;
pushElement.style.transition = transition;
pushElement.style.overflow = this.settings.zStack.cardBorderRadius && 'hidden';
newPaneY = this.instance.screenHeightOffset - newPaneY;
const topHeight = this.settings.zStack.minPushHeight
? this.settings.zStack.minPushHeight : this.instance.screenHeightOffset - this.breakpoints.bottomer;
Expand Down Expand Up @@ -1204,7 +1206,7 @@ class ZStackModule {
val = min;
return val;
};
setStyles(getXbyY(scaleNew, scaleNormal), getXbyY(yNew, yNormal), getXbyY(contrastNew, contrastNormal), getXbyY(-10, 0) * -1);
setStyles(getXbyY(scaleNew, scaleNormal), getXbyY(yNew, yNormal), getXbyY(contrastNew, contrastNormal), getXbyY(this.settings.zStack.cardBorderRadius * -1, 0) * -1);
}
// Z-Stack: Pushed elements multiplicators
setPushMultiplicators() {
Expand Down Expand Up @@ -1408,7 +1410,7 @@ class BackdropModule {
this.backdropEl.style.transition = `all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`;
this.backdropEl.style.backgroundColor = `rgba(0,0,0, ${this.settings.backdropOpacity})`;
this.instance.wrapperEl.appendChild(this.backdropEl);
this.backdropEl.addEventListener('click', () => this.instance.emit('onBackdropTap'));
this.backdropEl.addEventListener('click', (event) => this.instance.emit('onBackdropTap', event));
}
isBackdropPresented() {
return document.querySelector(`.cupertino-pane-wrapper .backdrop`)
Expand Down
4 changes: 2 additions & 2 deletions dist/cupertino-pane.esm.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cupertino-pane.esm.min.js.map

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions dist/cupertino-pane.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cupertino-pane.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/cupertino-pane.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/modules/backdrop.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1eb1f4c

Please sign in to comment.