@brandocms/jupiter 3.42.4 → 3.42.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ #### 3.42.5
2
+
3
+ - Links: Fade out header/footer (if found) in default transition
4
+ - Moonwalk: Don't wait for images with `data-placeholder`, render right away
5
+ and let Lazyload do the image reveal.
6
+
1
7
  #### 3.42.4
2
8
 
3
9
  - Moonwalk: Fix fallback selector. This could have broken devices with
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brandocms/jupiter",
3
- "version": "3.42.4",
3
+ "version": "3.42.5",
4
4
  "description": "Frontend helpers.",
5
5
  "author": "Univers/Twined",
6
6
  "license": "UNLICENSED",
@@ -32,19 +32,19 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@egjs/hammerjs": "^2.0.17",
35
- "body-scroll-lock": "^3.1.5",
36
- "gsap": "3.6.1",
35
+ "body-scroll-lock": "^4.0.0-beta.0",
36
+ "gsap": "3.8.0",
37
37
  "lodash.defaultsdeep": "^4.6.1"
38
38
  },
39
39
  "devDependencies": {
40
- "@babel/core": "^7.14.2",
41
- "@babel/preset-env": "^7.14.2",
42
- "babel-jest": "^26.6.3",
43
- "eslint": "7.26.0",
44
- "eslint-config-airbnb-base": "^14.2.1",
45
- "eslint-plugin-import": "^2.23.1",
40
+ "@babel/core": "^7.16.0",
41
+ "@babel/preset-env": "^7.16.4",
42
+ "babel-jest": "^27.3.1",
43
+ "eslint": "8.3.0",
44
+ "eslint-config-airbnb-base": "^15.0.0",
45
+ "eslint-plugin-import": "^2.25.3",
46
46
  "eslint-plugin-node": "^11.1.0",
47
- "eslint-plugin-promise": "^5.1.0",
48
- "jest": "^26.6.3"
47
+ "eslint-plugin-promise": "^5.1.1",
48
+ "jest": "^27.3.1"
49
49
  }
50
50
  }
@@ -17,7 +17,10 @@ const DEFAULT_OPTIONS = {
17
17
 
18
18
  onTransition: href => {
19
19
  const main = document.querySelector('main')
20
+ const header = document.querySelector('header[data-nav]')
21
+ const footer = document.querySelector('footer')
20
22
  const fader = document.querySelector('#fader')
23
+ console.log('transition')
21
24
 
22
25
  if (fader) {
23
26
  gsap.set(fader, { display: 'block', opacity: 0 })
@@ -26,6 +29,15 @@ const DEFAULT_OPTIONS = {
26
29
  y: 25,
27
30
  ease: 'power3.out'
28
31
  })
32
+
33
+ if (header) {
34
+ gsap.to(header, { duration: 0.2, opacity: 0 })
35
+ }
36
+
37
+ if (footer) {
38
+ gsap.to(footer, { duration: 0.2, opacity: 0 })
39
+ }
40
+
29
41
  gsap.to(fader, {
30
42
  duration: 0.2,
31
43
  opacity: 1,
@@ -39,6 +51,15 @@ const DEFAULT_OPTIONS = {
39
51
  y: 25,
40
52
  ease: 'power3.out'
41
53
  })
54
+
55
+ if (header) {
56
+ gsap.to(header, { duration: 0.2, opacity: 0 })
57
+ }
58
+
59
+ if (footer) {
60
+ gsap.to(footer, { duration: 0.2, opacity: 0 })
61
+ }
62
+
42
63
  gsap.to(main, {
43
64
  duration: 0.2,
44
65
  opacity: 0,
@@ -617,13 +617,19 @@ export default class Moonwalk {
617
617
  // ensure image is loaded before we tween
618
618
  imageIsLoaded(entry.target).then(() => wrappedTweenFn())
619
619
  } else {
620
- const imagesInEntry = entry.target.querySelectorAll('img')
621
- if (imagesInEntry.length) {
622
- // entry has children elements that are images
623
- imagesAreLoaded(imagesInEntry).then(() => wrappedTweenFn())
624
- } else {
625
- // regular entry, just tween it
620
+ if (entry.target.hasAttribute('data-placeholder')) {
621
+ // if the moonwalked element has data-placeholder, we don't want to wait
622
+ // for the image to load before tweening
626
623
  wrappedTweenFn()
624
+ } else {
625
+ const imagesInEntry = entry.target.querySelectorAll('img')
626
+ if (imagesInEntry.length) {
627
+ // entry has children elements that are images
628
+ imagesAreLoaded(imagesInEntry).then(() => wrappedTweenFn())
629
+ } else {
630
+ // regular entry, just tween it
631
+ wrappedTweenFn()
632
+ }
627
633
  }
628
634
  }
629
635
  self.unobserve(entry.target)