@brandocms/jupiter 3.42.5 → 3.43.0
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,23 @@
|
|
|
1
|
+
#### 3.43.0
|
|
2
|
+
|
|
3
|
+
- **BREAKING** Marquee: More consistent `speed`. This means you should probably
|
|
4
|
+
verify that the speed you set looks ok with the new config
|
|
5
|
+
- Marquee: Add `paddingLeft` and `slowDownOnHover` options
|
|
6
|
+
- Application: send `widthChanged` and `heightChanged` booleans
|
|
7
|
+
in `APPLICATION:RESIZE` event detail
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
#### 3.42.7
|
|
11
|
+
|
|
12
|
+
- Links: Check for zero opacity body element on back/forward nav
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
#### 3.42.6
|
|
16
|
+
|
|
17
|
+
- Typography: Better defaults
|
|
18
|
+
- MobileMenu: set `this.open` boolean on opening/closing
|
|
19
|
+
|
|
20
|
+
|
|
1
21
|
#### 3.42.5
|
|
2
22
|
|
|
3
23
|
- Links: Fade out header/footer (if found) in default transition
|
package/package.json
CHANGED
|
@@ -15,8 +15,19 @@ gsap.defaults({ overwrite: 'auto', ease: 'sine.out' })
|
|
|
15
15
|
|
|
16
16
|
window.onpageshow = event => {
|
|
17
17
|
if (event.persisted) {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const f = document.querySelector('#fader')
|
|
19
|
+
if (f) {
|
|
20
|
+
gsap.to(f, { duration: 0.35, autoAlpha: 0 })
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const dataFaders = document.querySelectorAll('[data-fader]')
|
|
24
|
+
if (dataFaders.length) {
|
|
25
|
+
gsap.to(dataFaders, { duration: 0.35, autoAlpha: 0 })
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
gsap.set(document.body, {
|
|
29
|
+
clearProps: 'opacity'
|
|
30
|
+
})
|
|
20
31
|
}
|
|
21
32
|
}
|
|
22
33
|
|
|
@@ -496,12 +507,15 @@ export default class Application {
|
|
|
496
507
|
* RAF'ed resize event
|
|
497
508
|
*/
|
|
498
509
|
onResize (e) {
|
|
510
|
+
const widthChanged = (this.size.width !== window.innerWidth)
|
|
511
|
+
const heightChanged = (this.size.height !== window.innerHeight)
|
|
512
|
+
|
|
499
513
|
this.size.width = window.innerWidth
|
|
500
514
|
this.size.height = window.innerHeight
|
|
501
515
|
this.setvh100()
|
|
502
516
|
this.updateZoom()
|
|
503
517
|
|
|
504
|
-
const evt = new CustomEvent(Events.APPLICATION_RESIZE,
|
|
518
|
+
const evt = new CustomEvent(Events.APPLICATION_RESIZE, { detail: { widthChanged, heightChanged } })
|
|
505
519
|
window.dispatchEvent(evt)
|
|
506
520
|
}
|
|
507
521
|
|
|
@@ -3,8 +3,10 @@ import _defaultsDeep from 'lodash.defaultsdeep'
|
|
|
3
3
|
import Dom from '../Dom'
|
|
4
4
|
|
|
5
5
|
const DEFAULT_OPTIONS = {
|
|
6
|
-
speed:
|
|
7
|
-
extraHeight: 0
|
|
6
|
+
speed: 100,
|
|
7
|
+
extraHeight: 0,
|
|
8
|
+
slowDownOnHover: true,
|
|
9
|
+
paddingLeft: 0
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
export default class Marquee {
|
|
@@ -26,18 +28,29 @@ export default class Marquee {
|
|
|
26
28
|
window.addEventListener('APPLICATION:RESIZE', this.updateMarquee.bind(this))
|
|
27
29
|
this.updateMarquee()
|
|
28
30
|
this.setupObserver()
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
if (this.opts.slowDownOnHover) {
|
|
32
|
+
this.elements.$el.addEventListener('mouseenter', this.slowDown.bind(this))
|
|
33
|
+
this.elements.$el.addEventListener('mouseleave', this.speedUp.bind(this))
|
|
34
|
+
}
|
|
31
35
|
}
|
|
32
36
|
|
|
33
|
-
updateMarquee () {
|
|
37
|
+
updateMarquee (e) {
|
|
38
|
+
if (e) {
|
|
39
|
+
// updating cause of a resize. we only care about width change
|
|
40
|
+
if (!e.detail.widthChanged) {
|
|
41
|
+
return
|
|
42
|
+
}
|
|
43
|
+
}
|
|
34
44
|
this.killTweens()
|
|
35
45
|
this.clearHolders()
|
|
36
46
|
this.setHeight()
|
|
37
47
|
this.fillText()
|
|
48
|
+
|
|
38
49
|
const holderWidth = this.elements.$holder.offsetWidth
|
|
39
50
|
const $allHolders = Dom.all(this.elements.$el, '[data-marquee-holder]')
|
|
40
51
|
const marqueeWidth = holderWidth * $allHolders.length
|
|
52
|
+
|
|
53
|
+
this.duration = holderWidth / this.opts.speed
|
|
41
54
|
|
|
42
55
|
gsap.set(this.elements.$marquee, { width: marqueeWidth })
|
|
43
56
|
this.initializeTween()
|
|
@@ -68,7 +81,7 @@ export default class Marquee {
|
|
|
68
81
|
|
|
69
82
|
this.timeline = gsap.timeline({ paused: true })
|
|
70
83
|
this.timeline
|
|
71
|
-
.to($allHolders,
|
|
84
|
+
.to($allHolders, { xPercent: -100, ease: 'none', duration: this.duration })
|
|
72
85
|
.repeat(-1)
|
|
73
86
|
|
|
74
87
|
window.timeline = this.timeline
|
|
@@ -105,6 +105,7 @@ export default class MobileMenu {
|
|
|
105
105
|
this.app = app
|
|
106
106
|
this.opts = _defaultsDeep(opts, DEFAULT_OPTIONS)
|
|
107
107
|
|
|
108
|
+
this.open = false
|
|
108
109
|
this.header = document.querySelector('header')
|
|
109
110
|
this.bg = this.header.querySelector('.mobile-bg')
|
|
110
111
|
this.logo = this.header.querySelector('figure.brand')
|
|
@@ -140,11 +141,13 @@ export default class MobileMenu {
|
|
|
140
141
|
toggleMenuClosed () {
|
|
141
142
|
// CLOSING MENU
|
|
142
143
|
this.opts.closeTween(this)
|
|
144
|
+
this.open = false
|
|
143
145
|
}
|
|
144
146
|
|
|
145
147
|
toggleMenuOpen () {
|
|
146
148
|
// OPENING MENU
|
|
147
149
|
this.opts.openTween(this)
|
|
150
|
+
this.open = true
|
|
148
151
|
}
|
|
149
152
|
|
|
150
153
|
_emitMobileMenuOpenEvent () {
|
|
@@ -5,7 +5,7 @@ export default class Typography {
|
|
|
5
5
|
// Set some settings, by merging defaults and passed settings
|
|
6
6
|
self.settings = {
|
|
7
7
|
minWords: 4,
|
|
8
|
-
selector: '
|
|
8
|
+
selector: '[data-typo]',
|
|
9
9
|
ignoreClass: 'no-typo-fix',
|
|
10
10
|
ignoreExistingSpaceChars: false,
|
|
11
11
|
...settings
|
|
@@ -29,11 +29,6 @@ export default class Typography {
|
|
|
29
29
|
const self = this
|
|
30
30
|
|
|
31
31
|
self.elems.map(elem => {
|
|
32
|
-
// Bail out if the ignore class is present on this element
|
|
33
|
-
if (elem.classList.contains(self.settings.ignoreClass)) {
|
|
34
|
-
return false
|
|
35
|
-
}
|
|
36
|
-
|
|
37
32
|
// Run the ignore checker nd bail if required
|
|
38
33
|
if (self.shouldElementBeIgnored(elem)) {
|
|
39
34
|
return false
|