Merge of features tied to 'Trinidad Scorpion' funding goal

This commit is contained in:
squidfunk
2022-06-02 17:20:33 +02:00
parent a3f457ecb1
commit e2556d84d6
89 changed files with 13701 additions and 290 deletions

View File

@@ -175,16 +175,15 @@ export function mountHeader(
): Observable<Component<Header>> {
return defer(() => {
const push$ = new Subject<Main>()
const done$ = push$.pipe(takeLast(1))
push$
.pipe(
distinctUntilKeyChanged("active"),
combineLatestWith(header$)
)
.subscribe(([{ active }, { hidden }]) => {
if (active)
el.setAttribute("data-md-state", hidden ? "hidden" : "shadow")
else
el.removeAttribute("data-md-state")
el.classList.toggle("md-header--hidden", hidden)
el.classList.toggle("md-header--shadow", active && !hidden)
})
/* Link to main area */
@@ -193,7 +192,7 @@ export function mountHeader(
/* Create and return component */
return header$
.pipe(
takeUntil(push$.pipe(takeLast(1))),
takeUntil(done$),
map(state => ({ ref: el, ...state }))
)
})

View File

@@ -116,10 +116,7 @@ export function mountHeaderTitle(
return defer(() => {
const push$ = new Subject<HeaderTitle>()
push$.subscribe(({ active }) => {
if (active)
el.setAttribute("data-md-state", "active")
else
el.removeAttribute("data-md-state")
el.classList.toggle("md-header__title--active", active)
})
/* Obtain headline, if any */