From 5c46ac058d7a09b6d129d612e6ea9d72df5d77cd Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 7 Nov 2023 21:17:02 -0400 Subject: content, css: generateAlbumCommentaryPage: album listening links, etc --- src/static/site5.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/static') diff --git a/src/static/site5.css b/src/static/site5.css index ba44ec37..3aa11f92 100644 --- a/src/static/site5.css +++ b/src/static/site5.css @@ -1292,7 +1292,8 @@ html[data-url-key="localized.home"] .carousel-container { .content-heading .content-heading-accent { font-weight: normal; - font-size: 1rem; + font-style: oblique; + font-size: 0.9rem; margin-left: 0.25em; } -- cgit 1.3.0-6-gf8a5 From aec1daecb6f2ae60697b836ec80775edc171ebba Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 9 Nov 2023 17:26:37 -0400 Subject: css: apply custom content-heading-accent style on specific page --- src/static/site5.css | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/static') diff --git a/src/static/site5.css b/src/static/site5.css index 3aa11f92..ccae29a0 100644 --- a/src/static/site5.css +++ b/src/static/site5.css @@ -803,6 +803,13 @@ html[data-url-key="localized.albumCommentary"] li.no-commentary { opacity: 0.7; } +html[data-url-key="localized.albumCommentary"] .content-heading .content-heading-accent { + font-weight: normal; + font-style: oblique; + font-size: 0.9rem; + margin-left: 0.25em; +} + html[data-url-key="localized.listing"][data-url-value0="random"] #data-loading-line, html[data-url-key="localized.listing"][data-url-value0="random"] #data-loaded-line, html[data-url-key="localized.listing"][data-url-value0="random"] #data-error-line { @@ -1290,13 +1297,6 @@ html[data-url-key="localized.home"] .carousel-container { animation-delay: 125ms; } -.content-heading .content-heading-accent { - font-weight: normal; - font-style: oblique; - font-size: 0.9rem; - margin-left: 0.25em; -} - h3.content-heading { clear: both; } -- cgit 1.3.0-6-gf8a5 From 69385cc2ca5d4a7691d6cb3726de5741de153a7c Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 9 Nov 2023 17:36:46 -0400 Subject: content, client: generateContentHeading: expose main title directly --- src/static/client3.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/static') diff --git a/src/static/client3.js b/src/static/client3.js index 8372a268..6af548d9 100644 --- a/src/static/client3.js +++ b/src/static/client3.js @@ -899,11 +899,12 @@ function updateStickySubheadingContent(index) { child.remove(); } - for (const child of closestHeading.childNodes) { - if (child.classList?.contains('content-heading-accent')) { - continue; - } + const textContainer = + closestHeading.querySelector('.content-heading-main-title') + // Just for compatibility with older builds of the site. + ?? closestHeading; + for (const child of textContainer.childNodes) { if (child.tagName === 'A') { for (const grandchild of child.childNodes) { stickySubheading.appendChild(grandchild.cloneNode(true)); -- cgit 1.3.0-6-gf8a5 From d0716804ca0b547ca79f819c94f413a542b7e172 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 9 Nov 2023 17:37:22 -0400 Subject: css: handle line wrapping in commentary heading accents better --- src/static/site5.css | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/static') diff --git a/src/static/site5.css b/src/static/site5.css index ccae29a0..c47252f4 100644 --- a/src/static/site5.css +++ b/src/static/site5.css @@ -803,11 +803,15 @@ html[data-url-key="localized.albumCommentary"] li.no-commentary { opacity: 0.7; } -html[data-url-key="localized.albumCommentary"] .content-heading .content-heading-accent { +html[data-url-key="localized.albumCommentary"] .content-heading-main-title { + margin-right: 0.25em; +} + +html[data-url-key="localized.albumCommentary"] .content-heading-accent { font-weight: normal; font-style: oblique; font-size: 0.9rem; - margin-left: 0.25em; + display: inline-block; } html[data-url-key="localized.listing"][data-url-value0="random"] #data-loading-line, -- cgit 1.3.0-6-gf8a5 From 4eb923d78f3f735b8697697033543a27bad623d7 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 16 Nov 2023 14:36:30 -0400 Subject: css: add light shadow to commentary cover art --- src/static/site5.css | 1 + 1 file changed, 1 insertion(+) (limited to 'src/static') diff --git a/src/static/site5.css b/src/static/site5.css index c47252f4..9ff3954e 100644 --- a/src/static/site5.css +++ b/src/static/site5.css @@ -553,6 +553,7 @@ p .current { width: 30%; max-width: 250px; margin: 15px 0 10px 20px; + box-shadow: 0 0 4px 5px rgba(0, 0, 0, 0.35); } .js-hide, -- cgit 1.3.0-6-gf8a5 From 1beb0d4712962ed943a18b9aeb81b231ad26691b Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 16 Nov 2023 14:45:14 -0400 Subject: css: tweak responsive long-content padding values & dynamics --- src/static/site5.css | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/static') diff --git a/src/static/site5.css b/src/static/site5.css index 9ff3954e..bfda0ba3 100644 --- a/src/static/site5.css +++ b/src/static/site5.css @@ -704,7 +704,7 @@ p code { } main.long-content { - --long-content-padding-ratio: 0.12; + --long-content-padding-ratio: 0.10; } main.long-content .main-content-container, @@ -1683,6 +1683,13 @@ html[data-language-code="preview-en"][data-url-key="localized.home"] #content */ @media (min-width: 600px) and (max-width: 899.98px) { + /* Medim layout is mainly defined (to the user) by hiding the sidebar, so + * don't apply the similar layout change of widening the long-content area + * if this page doesn't have a sidebar to hide in the first place. + */ + #page-container:not(.has-zero-sidebars) main.long-content { + --long-content-padding-ratio: 0.06; + } } /* Layout - Wide or Medium */ @@ -1772,6 +1779,10 @@ html[data-language-code="preview-en"][data-url-key="localized.home"] #content max-width: unset; } + main.long-content { + --long-content-padding-ratio: 0.02; + } + /* Show sticky heading above cover art */ .content-sticky-heading-container { @@ -1787,8 +1798,4 @@ html[data-language-code="preview-en"][data-url-key="localized.home"] #content #header > div:not(:first-child) { margin-top: 0.5em; } - - main.long-content { - --long-content-padding-ratio: 0.04; - } } -- cgit 1.3.0-6-gf8a5 From 4263dc13d48b385e78bbc5e1112dfe7a47054909 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 24 Nov 2023 15:17:09 -0400 Subject: client: get results from dispatchInternalEvent + merge fixes --- src/static/client3.js | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'src/static') diff --git a/src/static/client3.js b/src/static/client3.js index af0c381c..866b9ba2 100644 --- a/src/static/client3.js +++ b/src/static/client3.js @@ -96,14 +96,18 @@ function dispatchInternalEvent(event, eventName, ...args) { throw new Error(`Event name "${eventName}" isn't stored on ${infoName}.event`); } + let results = []; for (const listener of listeners) { try { - listener(...args); + results.push(listener(...args)); } catch (error) { console.warn(`Uncaught error in listener for ${infoName}.${eventName}`); console.debug(error); + results.push(undefined); } } + + return results; } // JS-based links ----------------------------------------- @@ -1102,13 +1106,14 @@ function addHashLinkListeners() { } // Allow event handlers to prevent scrolling. - for (const handler of event.beforeHashLinkScrolls) { - if (handler({ + const listenerResults = + dispatchInternalEvent(event, 'beforeHashLinkScrolls', { link: hashLink, target, - }) === false) { - return; - } + }); + + if (listenerResults.includes(false)) { + return; } // Hide skipper box right away, so the layout is updated on time for the @@ -1145,14 +1150,10 @@ function addHashLinkListeners() { processScrollingAfterHashLinkClicked(); - dispatchInternalEvent(event, 'whenHashLinkClicked', {link: hashLink}); - - for (const handler of event.whenHashLinkClicked) { - handler({ - link: hashLink, - target, - }); - } + dispatchInternalEvent(event, 'whenHashLinkClicked', { + link: hashLink, + target, + }); }); } @@ -1399,12 +1400,10 @@ function updateStickySubheadingContent(index) { state.displayedHeading = closestHeading; - for (const handler of event.whenDisplayedHeadingChanges) { - handler(index, { - oldHeading: oldDisplayedHeading, - newHeading: closestHeading, - }); - } + dispatchInternalEvent(event, 'whenDisplayedHeadingChanges', index, { + oldHeading: oldDisplayedHeading, + newHeading: closestHeading, + }); } function updateStickyHeadings(index) { -- cgit 1.3.0-6-gf8a5