Table of Contents for
Web Design Blueprints

Version ebook / Retour

Cover image for bash Cookbook, 2nd Edition Web Design Blueprints by Benjamin LaGrone Published by Packt Publishing, 2016
  1. Cover
  2. Table of Contents
  3. Web Design Blueprints
  4. Web Design Blueprints
  5. Credits
  6. About the Author
  7. About the Reviewer
  8. www.PacktPub.com
  9. Preface
  10. What you need for this book
  11. Who this book is for
  12. Conventions
  13. Reader feedback
  14. Customer support
  15. 1. Responsive Web Design
  16. Getting familiar with the basics
  17. Using media queries for responsive design
  18. Working with responsive media
  19. Building responsive layouts
  20. Summary
  21. 2. Flat UI
  22. Flat UI color
  23. Creating a flat UI layout
  24. Summary
  25. 3. Parallax Scrolling
  26. Color classes
  27. Using SVG font icons
  28. Getting the fonts
  29. That's no moon!
  30. OMG, it's full of stars!
  31. Clouds, birds, and airplanes
  32. The rocket
  33. Terra firma
  34. Next up, the CSS
  35. Styling the objects with CSS
  36. Styling the ground objects
  37. Writing the JavaScript effects
  38. Setting the row height
  39. Spreading the objects
  40. Spreading the clouds
  41. Loading the page functions
  42. Smoothening the scroll
  43. Updating elements on the scroller
  44. Collecting the moving elements
  45. Creating functions for the element types
  46. Setting the left positions
  47. Creating the rocket's movement function
  48. Finally, moving the earth
  49. Summary
  50. 4. Single Page Applications
  51. Getting to work
  52. Getting the old files
  53. Object and function conventions
  54. Creating utility functions
  55. Working with the home structure
  56. Setting up other sections
  57. Performing housekeeping
  58. Creating a callBack function for the API
  59. Summary
  60. 5. The Death Star Chapter
  61. Dropping in the parallax game
  62. Loading elements from JSON
  63. What can be done in the shared levels service
  64. Editing the home JavaScript
  65. Creating the other pages – credits and leaderboard
  66. Creating the second level
  67. Summary
  68. Index

Clouds, birds, and airplanes

In the sky section, in the p9, p10, p11, p12 and p13 DIV elements (we're skipping p8), add a new DIV element with the clouds class attribute. In each one, add at least 10 Font Awesome clouds (fa-cloud). Font Awesome, being an SVG (Scalable Vector Graphic), can scale up and be modified in several ways; by adding another class, fa-2x, you can make the graphic larger. The fa-3x, fa-4x, and fa-5x classes also work the same, with increasing scale. Here is an example of one of the DIV elements with clouds in it:

        <div id="p10" class="row color-0">
            <div class="clouds">
                <i class="fa fa-cloud fa-3x white"></i>
                <i class="fa fa-cloud fa-2x white"></i>
                <i class="fa fa-cloud fa-5x white"></i>
                <i class="fa fa-cloud fa-2x white"></i>
                <i class="fa fa-cloud fa-4x white"></i>
                <i class="fa fa-cloud fa-5x white"></i>
                <i class="fa fa-cloud fa-3x white"></i>
                <i class="fa fa-cloud fa-2x white"></i>
                <i class="fa fa-cloud fa-5x white"></i>
                <i class="fa fa-cloud fa-2x white"></i>
                <i class="fa fa-cloud fa-4x white"></i>
                <i class="fa fa-cloud fa-5x white"></i>
            </div>
        </div>

So, by adding the additional classes, you can make the cloudscape more interesting and diverse. We will use this size class to implement the parallax effect later. This being a font, you can also create your own CSS to add to it, treating it like a font. I will also demonstrate this later in the chapter. That being said, add classes with varying sizes like I stated earlier, and add the white class to them to make them white. You could also add a blue class to them to make them rain clouds.

When we are finished with the clouds, we will want to add some more interesting objects. Add an fa-plane icon to the end of the p12 DIV element, and add four birds using the fa-twitter icon. Add the fa-5x class and the silver color to the plane and add some color classes to the birds. Look at this example:

                <i class="fa fa-plane fa-5x silver"></i>
                <i class="fa fa-twitter"></i>
                <i class="fa fa-twitter"></i>
                <i class="fa fa-twitter"></i>
                <i class="fa fa-twitter"></i>

Let's take a look at what this looks like again. I'll show you the code in the inspector as well so that you can get an idea of how it looks.

Continue adding parts. We now arrive at the next section, objects. This SECTION element contains the parts that will do much of the heavy lifting in the animation, or they will at least be visible through most of the parallax effect.

In the objects SECTION element , add a new DIV element with the id attribute sun. Inside it, add three Font Awesome I elements. The first is fa-smile-o; add the green class to it. Then add fa-circle with an additional yellow class, followed by fa-sun-o, and make it yellow as well. That element will look like the following code sample:

        <section id="objects">
            <div id="sun">
                <i class="fa fa-smile-o green"></i>
                <i class="fa fa-circle yellow"></i>
                <i class="fa fa-sun-o yellow"></i>
            </div>
        </section>

When you see it in your browser, you can see the three parts of the sun. We will add the style soon enough; don't worry:

Clouds, birds, and airplanes

Next, add another DIV element with the id attribute earth. Inside it, add a Font Awesome I globe. Also add additional classes blue, land, and air. I'll explain these additional classes soon. Look at this code sample:

        <div id="earth">
            <i class="fa fa-globe blue land air"></i>
        </div>