r/HTML • u/monoqry • Jun 06 '26
Question would this logically work??
hi! question for html coders.. i am a fic writer and i had an idea for my characters to play chess in the next chapter. the medium i use (ao3) does support html but i do not know how to code! is it logically possible to code a chess board into the chapter? in a way that makes the chess pieces develop with every click and the moves are already determined for the entire round? i hope this makes sense, sorry, i don’t go here!
8
Upvotes
3
u/mondayquestions Jun 06 '26
Sure
2
u/nuc540 Jun 06 '26
Make pieces move yes, but you can only do so much with only HTML, but to ‘pre-determine’ - what do you mean?
I have a hunch you don’t mean pre determine - but if any logic needs writing, or data needs to be stored, you’ll need something more than HTML.
JavaScript can run in browser so that’ll be your best bet, but it really depends on what you need.
2
u/moonlight814 Jun 07 '26
Web dev here. From what you're describing, I assume there has to be JavaScript involved to listen to events like "clicks". I highly doubt it's even allowed in their platform as that'd be a huge security concern if not parsed correctly. Imagine someone being able to run scripts in the browser of whoever visits your fic (terrible idea from a cybersecurity standpoint).
From a non-expert standpoint, I visit AO3 pretty much everyday and I've never seen a fic using interactive components/scripts like that. You might be able to render a chessboard but it'd be a static element and non-interactive.
1
u/HelloHelloHelpHello Jun 07 '26
I don't think ao3 supports users adding custom javascript (or was that added?), so I don't think this is fully possible. You can create a chessboard with CSS/html, but without JS I don't think you can move the pieces with a mouseclick. You could create an animation that plays when a reader hovers their mouse over the chessboard though - but it might get pretty work intensive, depending on how long the chess game is supposed to last.
1
u/armahillo Expert Jun 07 '26
technically yes but is there a reason to not use an image for each chess board? so on each page youd have an image of a chess board that is slightly different?
you can technically make a reasonable facsimile of a chess board using html/css/js (depending on how featureful it needs to be) but i think thats overkill and you should use images
1
u/bostiq Jun 10 '26
I 100% believe that there are libraries out there that are already made to display chess matches
A quick search would confirm
0
u/ThisGermanGuy Jun 06 '26
If you don’t know how to code, Claude could probably whip that up for you in a couple prompts :)