Skip to content

Commit

Permalink
Add Google+ sharing
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsLeenheer committed Apr 13, 2012
1 parent b96ca0b commit aca95e7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
23 changes: 18 additions & 5 deletions css/main.css
Expand Up @@ -210,7 +210,7 @@ body {
#share {
position: absolute;
top: -10px;
right: -164px;
right: -224px;

background: #f0f0f0;
-webkit-border-radius: 6px;
Expand All @@ -223,7 +223,7 @@ body {
-o-box-shadow: 0px 0px 5px #222;
box-shadow: 0px 0px 5px #222;

width: 140px;
width: 200px;
height: 84px;
opacity: 0.7;
z-index: 10;
Expand Down Expand Up @@ -260,6 +260,12 @@ body {
left: 76px;
}

#share #google {
position: absolute;
top: 10px;
left: 136px;
}


.page {
margin: 2.5em auto 0;
Expand Down Expand Up @@ -1351,12 +1357,19 @@ body {
border-bottom: 10px solid #f0f0f0;
}
#share #twitter {
right: 53%;
left: auto;
left: 50%;
right: auto;
margin: 0 0 0 -100px;
}
#share #facebook {
left: 53%;
left: 50%;
right: auto;
margin: 0 0 0 -28px;
}
#share #google {
left: 50%;
right: auto;
margin: 0 0 0 40px;
}
}
@media (max-width: 360px) {
Expand Down
16 changes: 16 additions & 0 deletions index.html
Expand Up @@ -280,6 +280,7 @@ <h2>

this.parent.innerHTML +=
"<div id='share' style='opacity:0'>" +

"<div id='twitter'>" +
"<a href='https://twitter.com/share' class='twitter-share-button' " +
"data-url='http://html5test.com' " +
Expand All @@ -299,6 +300,14 @@ <h2>
"data-show-faces='false'" +
"></div>" +
"</div>" +

"<div id='google'>" +
"<div class='g-plusone' " +
"data-href='http://html5test.com' " +
"data-size='tall'" +
"></div>" +
"</div>" +

"</div>";

window.setTimeout(function() {
Expand All @@ -317,6 +326,13 @@ <h2>
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=202643099847776";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));


(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
}
}

Expand Down

0 comments on commit aca95e7

Please sign in to comment.