hy-pattern-lib
Advanced tools
Comparing version 1.6.1 to 1.6.2
@@ -1,1 +0,1 @@ | ||
{"happy-yoga.svg":"./dist/images/happy-yoga-17249743358378d3bc23666e5ad0d13f.svg","hy-components.js":"./dist/hy-components-35713d5e2365f1aea993df6353e576b8.js","hy-pattern-lib.css":"./dist/hy-pattern-lib-fc906ae29c401e51489e0b375d3058b1.css"} | ||
{"happy-yoga.svg":"./dist/images/happy-yoga-17249743358378d3bc23666e5ad0d13f.svg","hy-components.js":"./dist/hy-components-f8042089a71c64a18d6cf0194c5b103a.js","hy-pattern-lib.css":"./dist/hy-pattern-lib-3ac5db2af0e90c0173daa2f37e16fb75.css"} |
import './wandering-teaser-image.js' | ||
import './scroll-foam.js' | ||
import './nav-button.js' | ||
// import './top-page-menu.js' | ||
import './top-page-menu.js' |
@@ -1,7 +0,36 @@ | ||
// /* global HTMLElement, customElements */ | ||
// export class TopPageMenu extends HTMLElement { | ||
// async connectedCallback () { | ||
// } | ||
// } | ||
/* global HTMLElement, customElements, IntersectionObserver */ | ||
export class TopPageMenu extends HTMLElement { | ||
constructor () { | ||
super() | ||
// customElements.define('top-page-menu', TopPageMenu) | ||
const options = { | ||
root: null, | ||
// rootMargin: '0px', | ||
threshold: 0.2 | ||
} | ||
if (('IntersectionObserver' in window)) { | ||
this.observer = new IntersectionObserver((entries) => this.isVisible(entries), options) | ||
console.log(this.observer) | ||
} | ||
} | ||
async connectedCallback () { | ||
const firstMeaningfulContent = document.querySelector('scroll-foam main') | ||
this.observer?.observe(firstMeaningfulContent) | ||
} | ||
disconnectedCallback () { | ||
this.observer?.disconnect() | ||
} | ||
isVisible (entries) { | ||
if (entries[0].intersectionRatio < 0.2) { | ||
document.body?.classList.remove('main-content-visible') | ||
} else { | ||
document.body?.classList.add('main-content-visible') | ||
} | ||
} | ||
} | ||
customElements.define('top-page-menu', TopPageMenu) |
{ | ||
"name": "hy-pattern-lib", | ||
"version": "1.6.1", | ||
"version": "1.6.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
104029
988