The source code is in the src folder, while the production code(after minifying css and js files) is in the dist folder.
- Check out the repository.
- Run a local server.
$> cd /path/to/your-project-folder
$> python -m SimpleHTTPServer 8080- Open a browser and visit
localhost:8000.
Here is a list explaining what I've done to get a higher score for index.html.
- Resize the picture:
views/images/pizzeria.jpg. Now it has two versions, bigger one(633 pixels * 474 pixels) forpizza.html, smaller one(100 pixels * 75 pixels) forindex.html. - Minify the pictures, using TinyPng.
- Load google fonts asychronously using web font loader.
- For css:
- Use media queries for print situations(
media="print"). - Use
media:noneto remove render blocking css filestyle.css. - inline css for mobile styles.
- Use media queries for print situations(
- Add
asyncto scripts. - Minify css files and js files using gulp and the relative code is in
distfolder.
- Modify the code in function
updatePositions, get thescrollPositionout of the loop. - Decrease the number of pizzas by using the device width.
Modify the code in function changeSliderLabel(size). In detail, determineDx function is deleted and in function changePizzaSizes(size), fix the forced synchronous layout problem.
- run
npm installto install the modules. - run
gulpto minify css and js files.