launch ngrok for mac
- doanload ngrok which can be done here: https://ngrok.com
- the settings for installing ngrok are accessable through the sign up process.
- in one terminal window navigate to the folder which contains to index of the file you want to serve. -> cd file/path
- type in python -m SimpleHTTPServer 8080 and hit enter
- open another teminal window using command N
- navigate to the location of ngrok on your machine -> cd file/path
- type in ./ngrok http 8080
- file is now being hosted and is accessible from the link provided on your ngrok account.
Run the Application
- navigate to the link title Cam's Pizzaria from index.html.
- once on this page scrolling up and down with alter the movement of the pizza background.
- When you encounter the slider for pizza size slide it to either end.
- youll find that the pizzas on the page adjust size.
Changes to the Files index.html
start: mobile - 28/100 desktop - 30/100
-
compress and resize pizzaria.jpg
-
compress profilepic.jpg
-
Eliminate render-blocking JavaScript and CSS in above-the-fold content
-
Minify HTML,CSS, and javascript files
changes to main.js
- added strict to function definitions to create more secure code
- used the faster document.getElementsByClassName() to replace document.querySelectorAll()
- reused variable names in several instances to avoid recreating within loops
- saved length values outside of loops so that theyre not recaculated on every iteration
- took reusable math outside of loops to avoid recalulation
- declare var's outside of loops to speed up saving
Pizza background scrolling
- create a significantly smaller amount of pizzas because they are off screen
pizza resizing
- took document.querySelectorAll(".randomPizzaContainer") calculation outside of for loop
- didnt evaluate dx new width on every for loop since they were always the same value
changes to style.css
- edited the mover element to include transform: translateZ(0) & backface-visability: hidden to offload the graphic to the GPU