v0.12.10
scroll-tab-panel component now has 'active' attribute on panel visible in viewport
This commit is contained in:
parent
41954e92e0
commit
8718ae1aa5
@ -3825,12 +3825,17 @@ customElements.define('scroll-tab-panels', class extends HTMLElement {
|
|||||||
}
|
}
|
||||||
this.debounceTimeout = setTimeout(() => {
|
this.debounceTimeout = setTimeout(() => {
|
||||||
this.fireEvent(entry.target.dataset.index)
|
this.fireEvent(entry.target.dataset.index)
|
||||||
}, 300);
|
if (this.activePanel)
|
||||||
|
this.activePanel.removeAttribute('active')
|
||||||
|
this._assignedElements[entry.target.dataset.index].setAttribute('active', '')
|
||||||
|
this.activePanel = this._assignedElements[entry.target.dataset.index]
|
||||||
|
}, 100);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
threshold: 0.8
|
threshold: 0.8,
|
||||||
|
root: this.tabPanels
|
||||||
})
|
})
|
||||||
this.tabPanels.addEventListener('slotchange', e => {
|
this.tabPanels.addEventListener('slotchange', e => {
|
||||||
this._assignedElements = this.tabPanelsSlot.assignedElements()
|
this._assignedElements = this.tabPanelsSlot.assignedElements()
|
||||||
|
|||||||
@ -738,6 +738,12 @@ scroll-tab-panels {
|
|||||||
scroll-tab-panels > * {
|
scroll-tab-panels > * {
|
||||||
min-height: max(24rem, 50vh);
|
min-height: max(24rem, 50vh);
|
||||||
margin-bottom: 6rem;
|
margin-bottom: 6rem;
|
||||||
|
opacity: 0.4;
|
||||||
|
-webkit-transition: opacity 0.6s;
|
||||||
|
transition: opacity 0.6s;
|
||||||
|
}
|
||||||
|
scroll-tab-panels > [active] {
|
||||||
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.auto-grid-layout {
|
.auto-grid-layout {
|
||||||
|
|||||||
2
css/main.min.css
vendored
2
css/main.min.css
vendored
File diff suppressed because one or more lines are too long
@ -598,6 +598,11 @@ scroll-tab-panels{
|
|||||||
& > *{
|
& > *{
|
||||||
min-height: max(24rem, 50vh);
|
min-height: max(24rem, 50vh);
|
||||||
margin-bottom: 6rem;
|
margin-bottom: 6rem;
|
||||||
|
opacity: 0.4;
|
||||||
|
transition: opacity 0.6s;
|
||||||
|
}
|
||||||
|
& > [active]{
|
||||||
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.auto-grid-layout{
|
.auto-grid-layout{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user