Responsive Coming Soon HTML5 Page Tutorial - Technology Portal

Breaking

Post Top Ad

Post Top Ad

12/28/2012

Responsive Coming Soon HTML5 Page Tutorial

In the following tutorial we’ll create a coming soon template, 100% responsive, that will help you keep your users informed while you are building a new website. The HTML5 template has a jQuery countdown clock that will display the remaining time till launching.
The responsive HTML5 template is built with Twitter Bootstrap, a powerful front-end framework that I totally recommend. The coming soon page also has a flexible background image, easy to modify from the CSS file and an Ajax mailing-list subscription to keep your visitors up to date. I’ve also used an easy jQuery script for displaying your latest tweets. I’ll appreciate if you share the tutorial among your friends. Let’s get started with this under construction page tutorial!

coming-soon-page-2

HTML CODE

We’ll have two main blocks. One that holds the title of the page and the counter, the other one, the bottom three information boxes. Each main block of information should be wrapped within a container div, following by a row div, as is written in the Twitter Bootstrap documentation. The fluidity is given by the span1-12 classes. So for the first block I used a span12 class. Resize the browser’s window to see how the elements will realign.

  1. <div class="container wrapper">
  2. <div class="row">
  3.  
  4. <div class="span12 count-holder">
  5. <div class="title">
  6. <h2>Under Construction Website</h2>
  7. <p>estimated time remaining before official launch</p>
  8. </div>
  9.  
  10. <ul id="countdown">
  11. <li>
  12. <p class="timeRefDays">days</p>
  13. <span class="days">00</span>
  14. </li>
  15. <li>
  16. <p class="timeRefHours">hours</p>
  17. <span class="hours">00</span>
  18. </li>
  19. <li>
  20. <p class="timeRefMinutes">minutes</p>
  21. <span class="minutes">00</span>
  22. </li>
  23. <li>
  24. <p class="timeRefSeconds">seconds</p>
  25. <span class="seconds">00</span>
  26. </li>
  27. </ul>
  28.  
  29.  
  30. </div><!--end span12-->
  31.  
  32. </div><!--end row-->
  33. </div><!--end container-->
 For the second content I used 3 blocks of class span4 that will align perfectly.

  1. <footer class="container">
  2. <div class="row bottom-row">
  3.  
  4. <div class="span4 sub-block">
  5. <h4>About Us</h4>
  6. <p>
  7. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed aliquet vehicula mollis. Phasellus a erat vitae risus tempus lobortis. Maecenas dui risus, vehicula sit amet posuere eu, venenatis nec dolor. Pellentesque id diam sodales nibh sodales placerat vel a nisi. Nulla facilisi.
  8. </p>
  9. </div><!--end span4-->
  10.  
  11. <div class="span4 sub-block">
  12. <h4>Subscribe</h4>
  13. <p>type your email address to get the updates</p>
  14. <div class="signup">
  15. <form method="post" id="my-form" action='include/contact-process.php'>
  16. <input type="text" name="email" id="email" class="email" />
  17. <input type="submit" value="Send" id="submit"/>
  18. </form>
  19. <div class="column-clear"></div>
  20.  
  21. </div>
  22. <div id="output"></div>
  23. </div><!--end span4-->
  24.  
  25.  
  26. <div class="span4 sub-block">
  27. <h4>Latest Tweets</h4>
  28. <div class="tweet">
  29. </div>
  30. </div><!--end span4-->
  31.  
  32.  
  33. </div><!--end row-->
  34. </footer><!--end container-->

CSS CODE

The CSS code is easy to understand. One important thing that I want to specify here is the background image. In order for the image to fit any device size you’ll have to use the cover property for the background-size. It works on every modern browsers, except IE8 and below, but I think worth the effort

html{background:url('../images/bkg.jpg') no-repeat fixed center center; 
min-height:100%;  background-size:cover;}

For the countdown background and text, I used some CSS3 properties such as gradient, border radius, box-shadow and text-shadow.

  1. ul#countdown li {
  2. -webkit-border-radius: 10px;
  3. -moz-border-radius: 10px;
  4. border-radius: 10px;
  5. background: rgb(127, 186, 10);
  6. background: -moz-linear-gradient(90deg, #7FBA0A 50%, #7CB30B 50%);
  7. background: -webkit-linear-gradient(90deg, #7FBA0A 50%, #7CB30B 50%);
  8. background: -o-linear-gradient(90deg, #7FBA0A 50%, #7CB30B 50%);
  9. background: -ms-linear-gradient(90deg, #7FBA0A 50%, #7CB30B 50%);
  10. background: linear-gradient(180deg, #7FBA0A 50%, #7CB30B 50%);
  11. -webkit-box-shadow: 1px 1px 4px rgba(50, 50, 50, 0.3);
  12. -moz-box-shadow: 1px 1px 4px rgba(50, 50, 50, 0.3);
  13. box-shadow: 1px 1px 4px rgba(50, 50, 50, 0.3);

JAVASCRIPT CODE

First thing first, will have to include into the index.html the jQuery library and other Javascript files that will use.


  1. <script src="http://code.jquery.com/jquery-1.7.1.min.js" type="text/javascript"></script>
  2. <script src="js/jquery.form.js" type="text/javascript"></script>
  3. <script src="js/contactform.js" type="text/javascript"></script>
  4. <script src="js/countdown.js" type="text/javascript"></script>
  5. <script src="js/jquery.tweet.js" type="text/javascript"></script>
  6. <script src="js/init.js" type="text/javascript"></script>


Now open up the js/init.js file and modify your own coming soon date and the Twitter user and the number of tweets to be displayed.


  1. $(document).ready(function() {
  2. $("#countdown").countdown({
  3. date: "25 December 2012 12:00:00",
  4. format: "on"
  5. },
  6. function() {
  7. // callback function
  8. });
  9.  
  10. $(".tweet").tweet({
  11. username: "flashuser",
  12. count: 3,
  13. loading_text: "loading tweets..."
  14. });
  15.  
  16. });



CONCLUSION

I hope you have found this tutorial useful. Download, use it if you need such a template or just want to learn and don’t forget to spread the word. Thanks! /flashuser/

No comments:

Post a Comment

Post Top Ad