« get me outta code hell

content: generateColorStyleAttribute - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateFlashIndexPage.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-12-29 23:58:38 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-12-30 16:26:36 -0400
commit3fb01a3022a3f47c0e1e6e76771a35fce23a128b (patch)
treec8b23f194b1c632b02c926cb1b3eeb0b1084cca7 /src/content/dependencies/generateFlashIndexPage.js
parentf400a43640e7106d181d55365a9617c3d12e5891 (diff)
content: generateColorStyleAttribute
Diffstat (limited to 'src/content/dependencies/generateFlashIndexPage.js')
-rw-r--r--src/content/dependencies/generateFlashIndexPage.js45
1 files changed, 12 insertions, 33 deletions
diff --git a/src/content/dependencies/generateFlashIndexPage.js b/src/content/dependencies/generateFlashIndexPage.js
index 621d62a..57072a1 100644
--- a/src/content/dependencies/generateFlashIndexPage.js
+++ b/src/content/dependencies/generateFlashIndexPage.js
@@ -2,7 +2,7 @@ import {empty, stitchArrays} from '#sugar';
 
 export default {
   contentDependencies: [
-    'generateColorStyleVariables',
+    'generateColorStyleAttribute',
     'generateCoverGrid',
     'generatePageLayout',
     'image',
@@ -29,13 +29,13 @@ export default {
     layout:
       relation('generatePageLayout'),
 
-    jumpLinkColorVariables:
+    jumpLinkColorStyles:
       query.jumpActs
-        .map(() => relation('generateColorStyleVariables')),
+        .map(act => relation('generateColorStyleAttribute', act.jumpColor)),
 
-    actColorVariables:
+    actColorStyles:
       query.flashActs
-        .map(() => relation('generateColorStyleVariables')),
+        .map(act => relation('generateColorStyleAttribute', act.color)),
 
     actLinks:
       query.flashActs
@@ -61,10 +61,6 @@ export default {
       query.jumpActs
         .map(act => act.directory),
 
-    jumpLinkColors:
-      query.jumpActs
-        .map(act => act.jumpColor),
-
     jumpLinkLabels:
       query.jumpActs
         .map(act => act.jump),
@@ -73,10 +69,6 @@ export default {
       query.flashActs
         .map(act => act.directory),
 
-    actColors:
-      query.flashActs
-        .map(act => act.color),
-
     actCoverGridNames:
       query.flashActs
         .map(act => act.flashes
@@ -101,28 +93,21 @@ export default {
 
           html.tag('ul', {class: 'quick-info'},
             stitchArrays({
-              colorVariables: relations.jumpLinkColorVariables,
+              colorStyle: relations.jumpLinkColorStyles,
               anchor: data.jumpLinkAnchors,
-              color: data.jumpLinkColors,
               label: data.jumpLinkLabels,
-            }).map(({colorVariables, anchor, color, label}) =>
+            }).map(({colorStyle, anchor, label}) =>
                 html.tag('li',
                   html.tag('a',
                     {href: '#' + anchor},
-
-                    {style:
-                      colorVariables
-                        .slot('color', color)
-                        .content},
-
+                    colorStyle,
                     label)))),
         ],
 
         stitchArrays({
-          colorVariables: relations.actColorVariables,
+          colorStyle: relations.actColorStyles,
           actLink: relations.actLinks,
           anchor: data.actAnchors,
-          color: data.actColors,
 
           coverGrid: relations.actCoverGrids,
           coverGridImages: relations.actCoverGridImages,
@@ -130,10 +115,9 @@ export default {
           coverGridNames: data.actCoverGridNames,
           coverGridPaths: data.actCoverGridPaths,
         }).map(({
-            colorVariables,
-            anchor,
-            color,
+            colorStyle,
             actLink,
+            anchor,
 
             coverGrid,
             coverGridImages,
@@ -143,12 +127,7 @@ export default {
           }, index) => [
             html.tag('h2',
               {id: anchor},
-
-              {style:
-                colorVariables
-                  .slot('color', color)
-                  .content},
-
+              colorStyle,
               actLink),
 
             coverGrid.slots({