Merging two index pages

Hi. I got a question I’m hoping someone here can help me with…

I’m using Pinegrow4 to build my new responsive sites, and had been looking for some alternative to Flash to allow me to do my animated headers (that require coding in order to have random events within them occur).

After a lot of trial/error, I came across the idea of using GameMaker Studio Pro to create a coded animation, and then export out an HTML5 format of it… with the hopes then of inserting that within the Pinegrow page output.

All good in theory, except what I have is an HTML5 index page from GameMaker, and the HTML index page from Pinegrow… and I’m a bit intimidated in trying to manually merge the two, as I’m not fully sure what all (from the Gamemaker page) needs to be copied over… and doing a full copy/paste of ALL the code from it into the Pinegrow one might copy over lines essential to the Pinegrow page performing properly (as there will be common code between the two, which may or may not differ as far as values, etc).

Is there a safe way to merge the two?.. or some other system I could use?

I know my way around HTML, but a lot of the code is not familiar enough to me for me to comfortably know what to copy over and what might interfere.

Any suggestions?