Check out Janggi (Korean Chess), our featured variant for December, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

Interactive diagrams. (Updated!) Diagrams that interactively show piece moves.[All Comments] [Add Comment or Rating]
💡📝H. G. Muller wrote on Sun, Nov 22, 2015 12:16 PM UTC:
> Ideally, I would like something like this that still uses a graphic image when JavaScript is disabled.

This is exactly what I did in my Chu Shogi description on this site, which is intended as the 'show case' for how this feature can be applied. Of course the article already did have a static image, so I just put that between {noscript} {/noscript} tags, so it would show up when JavaScript is turned off.

But that would not make the text description of the diagram go away. When JavaScript is active it replaces the description text by the HTML table description of the diagram, but when it is not active, it obviously cannot do anything.

I guess this can be avoided by giving the {div id="diagram"} element an initial style="display:none" qualifier, and have the JavaScript then change this to display:inherit after having replaced it by the diagram. I'll add that statement to the .js file. The initial invisiblility, and alternative noscript content would obviously have to be provided by those who want to incorporate the diagram in their text. If I expand this article with a design wizzard similar to what I have now on http://hgm.nubati.net/variants/diagram/design.html I can make it add the display:none qualifier. The submission script would then also have to do that when it processes a [diagram] directive in a non-HTML submission.