I’ve uploaded a first set of files to my GitHub account as follows (no gaming logic, only layout and GUI aspects so far):
This is an iteration in the development of the GUI for an internet-based, peer-to-peer, browser-to-browser, 2-player version of the well-known Battleship game.
The development status is “early stages of methods selection”. I am absolutely a novice JavaScript programmer, having only done programming by example, leveraging my previous professional experience with other languages (C, Pascal, Bash, Fortran, Graftek Agile) and some very limited ad-hoc Python programming.
At this point, because other approaches did not appear to be as simple or workable, the “iframe” approach for “importing” external content has been used, but with apparent limited success. The issue encountered are:
-
the apparent inability to fully control the sizes and placement of iframes within clearly defined parent “div” elements (inconsistencies between grid specifications and element style values required to make things “fit”);
-
the apparent inability to use “global” CSS files for content within the iframes; and
-
the apparent inability to reference “global” JavaScript variables/objects from within the iframes.
It would be much appreciated if anyone could offer specific/detailed
-
explanations as to why these issues have arisen, and
-
coding changes that would address the issues encountered, while adhering to the conditions of using ONLY basic vanilla JavaScript, no external web-based libraries/frameworks, so that two independant, non-co-located computers could play the game with nothing more than installing distro-standard packages/libraries that have purely desktop-based dependencies (no use of third-party resources; Is this even possible ???).
I’m beginning to suspect possible impact/restrictions originating from “Content Security Policy”, but different attempts at setting that in the tag have failed to produce any visible change in behaviour or rendered output.
Thank you in advance for sharing your insights and experience.
Current Layout of GUI (work-in-progress):
