@web3modal/scaffold
Advanced tools
Comparing version 3.3.0-5ccf4c52 to 3.3.0-bd261c2c
@@ -15,3 +15,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
super(); | ||
this.resizeObserver = undefined; | ||
this.bodyObserver = undefined; | ||
this.unsubscribe = []; | ||
@@ -28,3 +28,3 @@ this.iframe = document.getElementById('w3m-iframe'); | ||
this.unsubscribe.forEach(unsubscribe => unsubscribe()); | ||
this.resizeObserver?.unobserve(window.document.body); | ||
this.bodyObserver?.unobserve(window.document.body); | ||
} | ||
@@ -34,7 +34,7 @@ firstUpdated() { | ||
const blueprint = this.renderRoot.querySelector('div'); | ||
this.resizeObserver = new ResizeObserver(() => { | ||
this.bodyObserver = new ResizeObserver(() => { | ||
const data = blueprint?.getBoundingClientRect(); | ||
const dimensions = data ?? { left: 0, top: 0, width: 0, height: 0 }; | ||
this.iframe.style.width = `${dimensions.width}px`; | ||
this.iframe.style.height = `${dimensions.height}px`; | ||
this.iframe.style.height = `${dimensions.height - 50}px`; | ||
this.iframe.style.left = `${dimensions.left}px`; | ||
@@ -44,3 +44,3 @@ this.iframe.style.top = `${dimensions.top}px`; | ||
}); | ||
this.resizeObserver.observe(window.document.body); | ||
this.bodyObserver.observe(window.document.body); | ||
} | ||
@@ -51,15 +51,17 @@ render() { | ||
} | ||
return html `<div></div>`; | ||
return html `<div data-ready=${this.ready}></div>`; | ||
} | ||
onShowIframe() { | ||
const isMobile = window.innerWidth <= 430; | ||
this.iframe.animate([ | ||
{ opacity: 0, transform: 'scale(.95)' }, | ||
{ opacity: 1, transform: 'scale(1)' } | ||
{ opacity: 0, transform: isMobile ? 'translateY(50px)' : 'scale(.95)' }, | ||
{ opacity: 1, transform: isMobile ? 'translateY(0)' : 'scale(1)' } | ||
], { duration: 200, easing: 'ease', fill: 'forwards', delay: 300 }); | ||
} | ||
async onHideIframe() { | ||
await this.iframe.animate([ | ||
{ opacity: 1, transform: 'scale(1)' }, | ||
{ opacity: 0, transform: 'scale(.95)' } | ||
], { duration: 200, easing: 'ease', fill: 'forwards' }).finished; | ||
await this.iframe.animate([{ opacity: 1 }, { opacity: 0 }], { | ||
duration: 200, | ||
easing: 'ease', | ||
fill: 'forwards' | ||
}).finished; | ||
this.iframe.style.display = 'none'; | ||
@@ -66,0 +68,0 @@ } |
@@ -7,3 +7,13 @@ import { css } from 'lit'; | ||
} | ||
[data-ready='false'] { | ||
transform: scale(1.05); | ||
} | ||
@media (max-width: 430px) { | ||
[data-ready='false'] { | ||
transform: translateY(-50px); | ||
} | ||
} | ||
`; | ||
//# sourceMappingURL=styles.js.map |
import { LitElement } from 'lit'; | ||
export declare class W3mApproveTransactionView extends LitElement { | ||
static styles: import("lit").CSSResult; | ||
private resizeObserver?; | ||
private bodyObserver?; | ||
private unsubscribe; | ||
@@ -6,0 +6,0 @@ private iframe; |
{ | ||
"name": "@web3modal/scaffold", | ||
"version": "3.3.0-5ccf4c52", | ||
"version": "3.3.0-bd261c2c", | ||
"type": "module", | ||
@@ -19,8 +19,8 @@ "main": "./dist/esm/index.js", | ||
"dependencies": { | ||
"@web3modal/core": "3.3.0-5ccf4c52", | ||
"@web3modal/ui": "3.3.0-5ccf4c52", | ||
"@web3modal/core": "3.3.0-bd261c2c", | ||
"@web3modal/ui": "3.3.0-bd261c2c", | ||
"lit": "3.0.2" | ||
}, | ||
"devDependencies": { | ||
"@web3modal/smart-account": "3.3.0-5ccf4c52" | ||
"@web3modal/smart-account": "3.3.0-bd261c2c" | ||
}, | ||
@@ -27,0 +27,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
281939
4745
+ Added@web3modal/core@3.3.0-bd261c2c(transitive)
+ Added@web3modal/ui@3.3.0-bd261c2c(transitive)
- Removed@web3modal/core@3.3.0-5ccf4c52(transitive)
- Removed@web3modal/ui@3.3.0-5ccf4c52(transitive)
Updated@web3modal/ui@3.3.0-bd261c2c