« get me outta code hell

data, content, css: FlashAct.{shortName,title,titleColor} - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/linkFlashActWithTitle.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2026-02-09 18:37:25 -0400
committer(quasar) nebula <qznebula@protonmail.com>2026-02-09 18:38:44 -0400
commite9a68b43a53a1aa1fc5d0f954241261807785fb2 (patch)
tree09ee001ff07900a71ed59f09675ac23f8d7b2ec7 /src/content/dependencies/linkFlashActWithTitle.js
parent3c98e89daad1e312907c6f5f614b44b38f65408e (diff)
data, content, css: FlashAct.{shortName,title,titleColor}
Diffstat (limited to 'src/content/dependencies/linkFlashActWithTitle.js')
-rw-r--r--src/content/dependencies/linkFlashActWithTitle.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/content/dependencies/linkFlashActWithTitle.js b/src/content/dependencies/linkFlashActWithTitle.js
new file mode 100644
index 00000000..87d1c2db
--- /dev/null
+++ b/src/content/dependencies/linkFlashActWithTitle.js
@@ -0,0 +1,28 @@
+export default {
+  relations: (relation, flashAct) => ({
+    link:
+      relation('linkThing', 'localized.flashActGallery', flashAct),
+
+    titleColorStyle:
+      (flashAct.titleColor && flashAct.titleColor !== flashAct.color
+        ? relation('generateColorStyleAttribute', flashAct.titleColor)
+        : null),
+  }),
+
+  data: (flashAct) => ({
+    name: flashAct.name,
+    title: flashAct.title,
+  }),
+
+  generate: (data, relations, {html, language}) =>
+    (data.title
+      ? relations.link.slot('content',
+          language.$('misc.flashActWithTitle', {
+            act: data.name,
+            title:
+              html.tag('span', {class: 'flash-act-title'},
+                relations.titleColorStyle,
+                language.sanitize(data.title)),
+          }))
+      : relations.link),
+};