Our next step is to jump right into the action and dump your parallax game file into the SPA framework. Since we have a pretty good systematic way to load scripts into the DOM, it should be pretty easy to shim it in and make it work.
We will further be moving the functions around to make them reusable patterns.
Create a new directory in your project named
level1
. This is where we will place the work from the parallax project.Copy the
index.html
file into thelevel1
directory and then rename it to match the style of the routing registry,level.html
.Then, create the additional new files
level1.js
,home-level1.html
, andlevel1.json
.
Let's add some CSS files to the directory so we can break it into small pieces. It's not required, but it may help keep things tidy. We will be adding CSS for each partial template. In the css/
directory, add the CSS files levels.css
and level-1.css
.
Since we were last in the css/
directory, let's work on that. Cut the CSS out of the...