Skip to content
This repository has been archived by the owner on May 12, 2019. It is now read-only.

Commit

Permalink
WIP – Added social buttons in post view
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Feb 24, 2015
1 parent dd2f0cf commit b9d6330
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 36 deletions.
2 changes: 1 addition & 1 deletion assets/css/uno.css

Large diffs are not rendered by default.

31 changes: 16 additions & 15 deletions assets/js/src/__init.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,20 @@ $ ->
DateInDays ".post.meta > time"

## Main

el = document.body
el.dataset.page ?= Uno.context()
Uno.readTime()

if Uno.is 'page', 'post'
$('.main').readingTime readingTimeTarget: ".post.reading-time > span"

$('#panic-button').click ->
s = document.createElement('script')
s.setAttribute('src','https://nthitz.github.io/turndownforwhatjs/tdfw.js')
document.body.appendChild(s)

$ ->
unless Uno.is 'device', 'desktop'
FastClick.attach(el)
el = document.body
el.dataset.page ?= Uno.context()
Uno.readTime()
FastClick.attach el unless Uno.is 'device', 'desktop'

if Uno.is 'page', 'post'
$('.main').readingTime readingTimeTarget: '.post.reading-time > span'
if Uno.is 'device', 'desktop'
firstImage = ($('#post-image')[0] || $('article.post img')[0]).src
social = new Share '#social-buttons', image: firstImage
social.open()

$('#panic-button').click ->
s = document.createElement 'script'
s.setAttribute 'src','https://nthitz.github.io/turndownforwhatjs/tdfw.js'
document.body.appendChild s
5 changes: 3 additions & 2 deletions assets/js/uno.js
100755 → 100644

Large diffs are not rendered by default.

22 changes: 21 additions & 1 deletion assets/scss/components/_post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ section.post {
}
}
}
.post {

.post {
> p > img {
width: 100%;
margin: 0 auto;
Expand Down Expand Up @@ -77,6 +77,7 @@ section.post {
text-transform: uppercase;
background-color: rgba($primary-color, .7);
border-radius: .25rem;
transition: all $aside-animation-time;
&:hover {
background-color: rgba($primary-color, 1);
}
Expand All @@ -101,6 +102,25 @@ section.post {
}
}

#social-buttons {
transform: rotate(90deg);
position: fixed;
right: 15px;
top: 50%;
transition: all $aside-animation-time;
&:hover {
right: 54px;
}
}

.sharer-0 label {
display: none;
}
.sharer-0 .social ul li {
transform: rotate(-90deg);
width: 46px !important;
}

#back-button {
position: absolute;
left: 0;
Expand Down
7 changes: 4 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
"Kiko Beats <[email protected]>"
],
"dependencies": {
"ghostHunter": "git://github.com/i11ume/ghostHunter.git",
"animate.css": "*",
"reading-time": "*",
"fastclick": "*",
"ghostHunter": "git://github.com/i11ume/ghostHunter.git",
"pace": "*",
"parrot-module-device": "*",
"parrotjs": "*",
"fastclick": "*"
"reading-time": "*",
"share-button": "*"
},
"ignore": [
"**/.*",
Expand Down
3 changes: 2 additions & 1 deletion gulpfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ src =
'assets/vendor/fastclick/lib/fastclick.js'
'assets/vendor/ghostHunter/jquery.ghostHunter.min.js'
'assets/vendor/pace/pace.min.js'
'assets/vendor/reading-time/build/readingTime.min.js']
'assets/vendor/reading-time/build/readingTime.min.js'
'assets/vendor/share-button/build/share.min.js']
css :
main : 'assets/css/uno.css'
vendor : ['assets/vendor/animate.css/animate.min.css']
Expand Down
21 changes: 9 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,26 @@
"url": "https://github.com/kikobeats"
},
"devDependencies": {
"browser-sync": "^2.1.1",
"browser-sync": "*",
"coffee-script": "*",
"gulp": "^3.8.11",
"gulp-add-src": "^0.2.0",
"gulp": "*",
"gulp-add-src": "*",
"gulp-autoprefixer": "*",
"gulp-changed": "*",
"gulp-coffee": "*",
"gulp-concat": "*",
"gulp-cssmin": "^0.1.6",
"gulp-cssmin": "*",
"gulp-header": "*",
"gulp-minify-css": "^0.4.5",
"gulp-minify-css": "*",
"gulp-sass": "*",
"gulp-sourcemaps": "^1.3.0",
"gulp-strip-css-comments": "^1.1.0",
"gulp-uglify": "^1.1.0",
"gulp-strip-css-comments": "*",
"gulp-uglify": "*",
"gulp-util": "*"
},
"homepage": "https://github.com/kikobeats/uno-zen",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/kikobeats/uno-zen"
},
"homepage": "https://github.com/kikobeats/uno-zen",
"dependencies": {
"gulp-changed": "^1.1.1"
}
}
8 changes: 7 additions & 1 deletion partials/meta.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1">

<meta name="description" content="{{meta_description}}">
{{#if meta_description}}
<meta name="description" content="{{meta_description}}">
{{/if}}

<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="{{meta_title}}">
{{#if meta_description}}
<meta name="twitter:description" content="{{meta_description}}">
{{/if}}

<meta property="og:type" content="article">
<meta property="og:title" content="{{meta_title}}">
{{#if meta_description}}
<meta property="og:description" content="{{meta_description}}">
{{/if}}

<link rel="shortcut icon" href="/assets/img/favicon.ico">
<link rel="apple-touch-icon" sizes="57x57" href="/assets/img/apple-touch-icon-57x57.png">
Expand Down
1 change: 1 addition & 0 deletions post.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

</header>

<section id="social-buttons"></section>
<section class="{{post_class}}">
{{content}}
</section>
Expand Down

0 comments on commit b9d6330

Please sign in to comment.