site: owner-only dashboard link in header, mobile menu and homepage (g then d from any page); /start skips the site chrome JS
All checks were successful
Deploy production / deploy (push) Successful in 2m56s
All checks were successful
Deploy production / deploy (push) Successful in 2m56s
- Header/footer moved to #lib/components/SiteChrome.svelte, returned by a universal +layout.ts load only for non-immersive pages, so /start and the book reader never download icon libraries, dropdowns or the bits-ui Sheet. /start: 36 -> 18 JS files, 133 -> 78 KB gzip. - Header logo is a hashed asset (inlined), so it is cached with the build. - inlineStyleThreshold 4096: tiny page/component CSS is inlined into the HTML. - Umami is not loaded on /start.
This commit is contained in:
19
src/lib/chrome.ts
Normal file
19
src/lib/chrome.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Full-screen pages that render without the site header and footer: the /start new-tab
|
||||
* dashboard and the book reader. They also skip loading the header's JS (icons, menus,
|
||||
* the mobile Sheet): src/routes/+layout.ts only imports SiteChrome for other pages.
|
||||
*/
|
||||
export function isImmersive(pathname: string): boolean {
|
||||
return /^\/start\/?$/.test(pathname) || /^\/trackers\/books\/\d+\/read\/?$/.test(pathname);
|
||||
}
|
||||
|
||||
/** True when a keyboard shortcut should not fire because the user is typing. */
|
||||
export function isTyping(target: EventTarget | null): boolean {
|
||||
if (!(target instanceof HTMLElement)) return false;
|
||||
return (
|
||||
target.isContentEditable ||
|
||||
target.tagName === 'INPUT' ||
|
||||
target.tagName === 'TEXTAREA' ||
|
||||
target.tagName === 'SELECT'
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user