Skip to content

Commit

Permalink
v1.1. New features: responsive design.
Browse files Browse the repository at this point in the history
  • Loading branch information
nazhamid committed Sep 8, 2012
1 parent cc70bab commit f7bf49f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
10 changes: 9 additions & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
=============================

The Personal Page
Version 1.0
Version 1.1
January 19, 2010
Created by Naz Hamid
Original: www.nazhamid.com
Expand Down Expand Up @@ -36,5 +36,13 @@ Usage is simple:

5) You can switch the position of the monogram and text as seen in timlum.com.

=============================
Change Notes:
=============================

v1.1
— Added responsive design for mobile devices
— Mobile devices no longer load the background image to save the bandwidth and performance hit.



21 changes: 19 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,24 @@
<meta http-equiv="pragma" content="no-cache" />
<meta name="robots" content="all" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<meta http-equiv="imagetoolbar" content="false" />
<meta http-equiv="imagetoolbar" content="false" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
* { padding: 0; margin: 0; }
body { background-color: #333; }
p { color: #fff; font-family: Helvetica; font-size: 16px; line-height: 24px; margin-bottom: 22px; -webkit-font-smoothing: antialiased; }
a { color: #fff; font-weight: bold; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.3); }
a:hover { color: #990000; border-bottom: 1px solid rgba(255,255,255,1); }
#monogram { width: 50px; padding: 50px 0 0 0; margin: 0 auto 0 50px; }
#about { width: 360px; padding: 0 0 0 150px; margin: -35px 50px 0 auto !important; }
@media (max-width: 767px) {
#monogram { position: relative; width: auto; padding: 20px; margin: 0; }
#about { position: relative; width: auto; padding: 20px; margin: 0 !important; }
background-image { opacity: 0.2; }
}
</style>
</head>

Expand All @@ -36,7 +46,14 @@
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.backstretch.min.js"></script>
<script type="text/javascript">
$.backstretch("nh_bg.jpg", {speed: 150});
$(function(){
$(window).resize(function(){
if($(this).width() >= 767){
$.backstretch("nh_bg.jpg", {speed: 150});
}
})
.resize();//trigger resize on page load
});
</script>

</body>
Expand Down

0 comments on commit f7bf49f

Please sign in to comment.