hy-pattern-lib
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -1,1 +0,1 @@ | ||
{"happy-yoga-main.svg":"./dist/images/happy-yoga-main-8a212ef3eec3f83a7b774188f7289e3c.svg","hero-image-1-optimized.jpg.webp":"./dist/images/hero-image-1-optimized.jpg-4d7ccd7272ba95be9a84af4e2fffb5f7.webp","hero-image-1.jpg":"./dist/images/hero-image-1-d7348840d4fb3953cf06989b5646a365.jpg","hy-components.js":"./dist/hy-components-757ee966161f7fd52f3c4b3194dec8b8.js","hy-pattern-lib.css":"./dist/hy-pattern-lib-c6871ddb935aa2faebec292a6322b392.css"} | ||
{"happy-yoga-main.svg":"./dist/images/happy-yoga-main-8a212ef3eec3f83a7b774188f7289e3c.svg","hero-image-1-optimized.jpg.webp":"./dist/images/hero-image-1-optimized.jpg-4d7ccd7272ba95be9a84af4e2fffb5f7.webp","hero-image-1.jpg":"./dist/images/hero-image-1-d7348840d4fb3953cf06989b5646a365.jpg","hy-components.js":"./dist/hy-components-35713d5e2365f1aea993df6353e576b8.js","hy-pattern-lib.css":"./dist/hy-pattern-lib-836ef81b7c62116b009bdd9625b8dfcb.css"} |
@@ -20,2 +20,3 @@ /* global HTMLElement, customElements */ | ||
window.addEventListener('resize', this.viewChangeListener) | ||
this.updateImagePosition() | ||
} catch (e) { | ||
@@ -32,13 +33,15 @@ console.warn(e.message) | ||
onViewChange () { | ||
const id = Math.ceil(Math.random() * 1000) | ||
if (!this.updating) { | ||
window.requestAnimationFrame(() => this.updateImagePosition(id)) | ||
this.updating = true | ||
window.requestAnimationFrame(() => this.updateImagePosition()) | ||
} | ||
} | ||
updateImagePosition (id) { | ||
const { top } = this.getBoundingClientRect() | ||
const windowSizeFactor = Math.min(Math.max(0.5, window.innerWidth / 500), 5) | ||
const imageTopAdjustment = Math.min(-1 * this.adjustmentSpeedFactor * top, this.image.getBoundingClientRect().x / windowSizeFactor) | ||
updateImagePosition () { | ||
const { top: containerTop } = this.getBoundingClientRect() | ||
const { height: imageHeight } = this.image.getBoundingClientRect() | ||
const windowWidthBasedModifier = Math.min(1 + window.innerWidth / 1000, 2) | ||
const imageTopAdjustment = Math.min(-1 * this.adjustmentSpeedFactor * containerTop, imageHeight / windowWidthBasedModifier) | ||
this.image.style.bottom = `${-1 * imageTopAdjustment}px` | ||
@@ -45,0 +48,0 @@ this.updating = false |
{ | ||
"name": "hy-pattern-lib", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
856773
41
652