diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-04-14 16:08:56 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-04-14 16:08:56 -0400 |
| commit | d23a69383e0871e681cf122441c4531980a2b4c2 (patch) | |
| tree | 9f109430c63e2861262cd20bf1bf066c5856b272 | |
| parent | 55bba9f4aab51fb05ebeb01987924e1f97226210 (diff) | |
share links
| -rw-r--r-- | site/public/assets/javascripts/_env.js | 23 | ||||
| -rw-r--r-- | site/public/assets/style.css | 10 | ||||
| -rw-r--r-- | site/templates/project.liquid | 6 |
3 files changed, 30 insertions, 9 deletions
diff --git a/site/public/assets/javascripts/_env.js b/site/public/assets/javascripts/_env.js index ac155b3..c34787d 100644 --- a/site/public/assets/javascripts/_env.js +++ b/site/public/assets/javascripts/_env.js @@ -105,6 +105,8 @@ environment.ready = function(){ load_hash(page) }) + Share.init() + $(window).mousedown(function(e){ if (! menu_open) { controls.pause() @@ -492,4 +494,25 @@ function HustleLoader () { init() } +var Share = { + init: function(){ + $(document).on("click", ".fb", Share.facebook) + $(document).on("click", ".tw", Share.twitter) + }, + + facebook: function (e) { + e.preventDefault() + var link = window.location.href + var msg = $(".postname").html() + var url = "https://www.facebook.com/share.php?u=" + encodeURIComponent(link) + "&t=" + encodeURIComponent(msg) + window.open(url, "_blank") + }, + twitter: function (e) { + e.preventDefault() + var link = window.location.href + var msg = $(".postname").html() + var url = "https://twitter.com/home?status=" + encodeURIComponent(msg + " " + link) + window.open(url, "_blank") + }, +}
\ No newline at end of file diff --git a/site/public/assets/style.css b/site/public/assets/style.css index e5a3404..6bf1fcb 100644 --- a/site/public/assets/style.css +++ b/site/public/assets/style.css @@ -454,18 +454,16 @@ nav a.active, nav .sub a:hover { color: #909090; } -.credit a { +.credit img { display:inline-block; opacity:0.9; + cursor: pointer; + width: 18px; } -.credit a:hover { +.credit img:hover { opacity:1; } -.credit a img { - width:18px; -} - .mx-object3d .image{ box-shadow:5px -10px 20px rgba(0,0,0,0.1); } diff --git a/site/templates/project.liquid b/site/templates/project.liquid index a6b2b24..b54722d 100644 --- a/site/templates/project.liquid +++ b/site/templates/project.liquid @@ -15,8 +15,8 @@ {{ project.description | newline_to_br }} </div> <div class="credit"> - <a href="#"><img src="{{static}}/assets/images/fb2.png"></a> - <a href="#"><img src="{{static}}/assets/images/tw2.png"></a> + <img src="{{static}}/assets/images/fb2.png" class="fb"> + <img src="{{static}}/assets/images/tw2.png" class="tw"> </div> </span> -</div> +</div>
\ No newline at end of file |
