From a4d2b1dd343c2abde14843055c40a77e4cc7643b Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 13 Nov 2011 12:44:30 +0100 Subject: Add buttons for sharing on FB, Google+ and Delicious --- src/_layouts/default.haml | 15 ++++++++++++++- src/images/delicious-icon.png | Bin 0 -> 342 bytes src/javascripts/facebook.js | 8 ++++++++ src/stylesheets/application.sass | 37 ++++++++++++++++++++++++++++++++++++- 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 src/images/delicious-icon.png create mode 100644 src/javascripts/facebook.js diff --git a/src/_layouts/default.haml b/src/_layouts/default.haml index 4bc6d71..f2c2c65 100644 --- a/src/_layouts/default.haml +++ b/src/_layouts/default.haml @@ -4,5 +4,18 @@ %title Thrash and Burn Tour 2012 %meta{ :charset => 'UTF-8' } = stylesheets - %body + %script{ :type => "text/javascript", :src => "https://apis.google.com/js/plusone.js" } + %body + %div#fb-root + = javascripts('facebook') = yield + %div#sharebar + %div#google_plus_button.sharebutton + = '' + %div#delicious_button.sharebutton + %div.icon + = img "delicious-icon.png", :alt => "Delicious" + %div.link + = link "Bookmark on Delicious", "http://www.delicious.com/save", :onclick => %q{window.open('http://www.delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=550,height=550'); return false;} + %div#facebook_button.sharebutton + %div.fb-like{:data => { :href => "http://thrash-and-burn.no", :send => "false", :width => "450", :colorscheme => "dark", 'show-faces' => "false"}} diff --git a/src/images/delicious-icon.png b/src/images/delicious-icon.png new file mode 100644 index 0000000..2a10be2 Binary files /dev/null and b/src/images/delicious-icon.png differ diff --git a/src/javascripts/facebook.js b/src/javascripts/facebook.js new file mode 100644 index 0000000..f92c961 --- /dev/null +++ b/src/javascripts/facebook.js @@ -0,0 +1,8 @@ +(function(d, s, id) { + var js, fjs = d.getElementsByTagName(s)[0]; + if (d.getElementById(id)) {return;} + js = d.createElement(s); js.id = id; + js.src = "https://connect.facebook.net/en_US/all.js#xfbml=1&appId=156503997720402"; + fjs.parentNode.insertBefore(js, fjs); +}(document, 'script', 'facebook-jssdk')); + diff --git a/src/stylesheets/application.sass b/src/stylesheets/application.sass index 8541f20..711de1d 100644 --- a/src/stylesheets/application.sass +++ b/src/stylesheets/application.sass @@ -42,6 +42,7 @@ strong #content +content-pane background-image: url('/images/content_background.jpg') + padding-bottom: 40px #body position: relative top: 160px @@ -61,4 +62,38 @@ strong .intro font-size: 105% - font-weight: bolder \ No newline at end of file + font-weight: bolder + +$sharebar-height: 40px +$button-height: $sharebar-height - 5px + +#sharebar + position: fixed + bottom: 0 + left: 10% + right: 10% + height: $sharebar-height + border-top: 1px solid lightgray + font-size: 80% + background-color: rgba(0, 0, 0, 0.7) + +.sharebutton + display: inline-block + vertical-align: top + padding-top: 6px + +#facebook_button + +#delicious_button + padding-right: 3em + .icon + display: inline-block + height: $button-height + .link + display: inline-block + height: $button-height + padding-top: 3px + vertical-align: middle + font-size: 8pt + +#google_plus_button -- cgit v1.2.3