Skip to content

Commit

Permalink
Merge branch 'topnav-tweaks-v2' of https://github.com/schlawg/lila in…
Browse files Browse the repository at this point in the history
…to topnav-tweaks-v2

* 'topnav-tweaks-v2' of https://github.com/schlawg/lila:
  commit stuff i thought i had committed
  • Loading branch information
ornicar committed Mar 18, 2024
2 parents ce89338 + 3c84257 commit f9bd420
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions ui/common/css/header/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

.site-buttons {
@extend %flex-center-nowrap;
position: relative;

.link {
@extend %top-icon;
Expand Down Expand Up @@ -62,8 +63,6 @@
}

.shown {
position: relative;

.toggle {
background: $c-bg-header-dropdown;
color: $c-header-dropdown;
Expand Down
7 changes: 6 additions & 1 deletion ui/site/src/topBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ export default function () {
$('#topnav > section > a').removeAttr('href');

$('#tn-tg').on('change', e => {
document.body.classList.toggle('masked', (e.target as HTMLInputElement).checked);
const menuOpen = (e.target as HTMLInputElement).checked;
document.body.classList.toggle('masked', menuOpen);
const header = $as<HTMLElement>('#top');
// transp #top's blur filter creates a stacking context. turn it off so 'bottom: 0' matches screen height
if (menuOpen) header.style.backdropFilter = 'unset';
else setTimeout(() => (header.style.backdropFilter = ''), 200); // 200ms is slide transition duration
});

$('#top').on('click', '.toggle', function (this: HTMLElement) {
Expand Down

0 comments on commit f9bd420

Please sign in to comment.