When this thread came out, I meant to investigate more thoroughly, as I loved the idea and the demo.
I still mean to do so, but I stopped when I saw this:
I have done related things a few times, and thought I knew how to do this part at least. I got it working well enough to prove out the concept:
Old XBox Controller with hover.json (452.3 KB)
This is only a proof-of-concept. I didn’t use your table, although clearly I could have done so. Instead, we have a second, temporary table, that is pulled from the field names (and so ordered alphabetically, and not the way you would like).
But on hover of one of the rows on this table, the equivalent control is highlighted in the SVG and vice versa.
This is done through CSS’s :has pseudo-class. I needed to do one thing to your markup to make this work:
<$link to="A Button" ><path class="ctrlr abtn" d={{!!abtn}} ><title> {{!!abtntxt}} </title></path></$link>
<!-- ^^^^ added -->
<!-- vvvv added -->
<$link to="X Button" ><path class="ctrlr xbtn" d={{!!xbtn}} ><title> {{!!xbtntxt}} </title></path></$link>
Other than that, I added my table, which looks like this:
<table class="hoverme">
<$list filter="[fields[]removesuffix[txt]]" variable="section">
<tr class=<<section>>><td><$view field=`$(section)$txt` /></td></tr>
</$list>
</table>
and two dynamic CSS blocks:
<$list filter="[fields[]removesuffix[txt]]" variable="section">
<$text text=`div.wrapper:has(path.ctrlr.$(section)$:hover) .hoverme .$(section)$,`/>
</$list>
.hoverme td:hover {background-color: #cfc;}
which expands into something like
div.wrapper:has(path.ctrlr.abtn:hover) .hoverme .abtn,
div.wrapper:has(path.ctrlr.backbtn:hover) .hoverme .backbtn,
div.wrapper:has(path.ctrlr.bbtn:hover) .hoverme .bbtn,
/* ... */
div.wrapper:has(path.ctrlr.ybtn:hover) .hoverme .ybtn,
.hoverme td:hover {background-color: #cfc;}
and
<$list filter="[fields[]removesuffix[txt]]" variable="section">
<$text text=`div.wrapper:has(.hoverme .$(section)$:hover) path.ctrlr.$(section)$,`/>
</$list>
path.ctrlr:hover {
fill: rgba(145, 0, 0, 0.6);
stroke: rgba(145, 0, 0, 0.6);
stroke-width: .5px;
transition: fill 0.2s;
}
which becomes
div.wrapper:has(.hoverme .abtn:hover) path.ctrlr.abtn,
div.wrapper:has(.hoverme .backbtn:hover) path.ctrlr.backbtn,
div.wrapper:has(.hoverme .bbtn:hover) path.ctrlr.bbtn,
/* ... */
div.wrapper:has(.hoverme .ybtn:hover) path.ctrlr.ybtn,
path.ctrlr:hover {
fill: rgba(145, 0, 0, 0.6);
stroke: rgba(145, 0, 0, 0.6);
stroke-width: .5px;
transition: fill 0.2s;
}
I hope to look over the rest of the tutorial this weekend, and see if there’s a good way to automate some of this.