« get me outta code hell

content: generateLyricsSection: first annotation part as cue - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateLyricsSection.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-07-18 16:44:07 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-07-18 16:44:07 -0300
commit09a0ab6dd1b7cf3b0f97d820c443b3a4f4291c8f (patch)
tree073808fc6307fca2dcdeca57f01b623f17b5ea3d /src/content/dependencies/generateLyricsSection.js
parent1381e5e954842a5d8a9d3080175dd17d2bd4cc5f (diff)
content: generateLyricsSection: first annotation part as cue
Diffstat (limited to 'src/content/dependencies/generateLyricsSection.js')
-rw-r--r--src/content/dependencies/generateLyricsSection.js29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/content/dependencies/generateLyricsSection.js b/src/content/dependencies/generateLyricsSection.js
index f6b719a9..64676d3b 100644
--- a/src/content/dependencies/generateLyricsSection.js
+++ b/src/content/dependencies/generateLyricsSection.js
@@ -21,10 +21,10 @@ export default {
       entries
         .map(entry => relation('generateLyricsEntry', entry)),
 
-    annotations:
+    annotationParts:
       entries
-        .map(entry => entry.annotation)
-        .map(annotation => relation('transformContent', annotation)),
+        .map(entry => entry.annotationParts
+          .map(part => relation('transformContent', part))),
   }),
 
   data: (entries) => ({
@@ -54,11 +54,24 @@ export default {
                 initialOptionIndex: 0,
 
                 titles:
-                  relations.annotations.map(annotation =>
-                    annotation.slots({
-                      mode: 'inline',
-                      textOnly: true,
-                    })),
+                  relations.annotationParts
+                    .map(([first, ...rest]) =>
+                      language.formatUnitList([
+                        html.tag('span',
+                          {class: 'dot-switcher-interaction-cue'},
+                          {[html.onlyIfContent]: true},
+
+                          first?.slots({
+                            mode: 'inline',
+                            textOnly: true,
+                          })),
+
+                        ...rest.map(part =>
+                          part.slots({
+                            mode: 'inline',
+                            textOnly: true,
+                          })),
+                      ])),
 
                 targetIDs:
                   data.ids,