Skip to content

Commit

Permalink
Merge pull request #28 from ZhuFengdaaa/master
Browse files Browse the repository at this point in the history
Merging background switching feature...
  • Loading branch information
olakara committed Feb 3, 2015
2 parents 84ea244 + a90ebb7 commit d18b37e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
14 changes: 14 additions & 0 deletions _includes/head.html
Expand Up @@ -40,6 +40,20 @@


{% if page.title == "Home" %}
<!-- Add background-image -->
<script>

var backgroundImage = [];

backgroundImage[0]='bcg1.jpg';
backgroundImage[1]='bcg2.jpg';
backgroundImage[2]='bcg3.jpg';
backgroundImage[3]='bcg4.jpg';

var random=Math.floor(Math.random()*4);
document.write("<style>body {background: url("+"/assets/images/"+backgroundImage[random]+") no-repeat center center fixed;-webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;background-size: cover;color:#fff;background-color:#333;}</style>")

</script>
<link rel="stylesheet" href="{{site.url}}/assets/css/bcg.css">
<link rel="stylesheet" href="{{site.url}}/assets/css/MetroJs.min.css">
{% endif %}
Expand Down
9 changes: 0 additions & 9 deletions assets/css/bcg.css
@@ -1,12 +1,3 @@
body {
background: url('/assets/images/bcg_wall.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
color:#fff;
background-color:#333;
}

.bord {
border: 1px solid #fff;
Expand Down
Binary file added assets/images/bcg1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/bcg2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/bcg3.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/bcg4.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d18b37e

Please sign in to comment.