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

Commit

Permalink
improved mobile experience and little refactor
Browse files Browse the repository at this point in the history
- Added client detection
- Improved how works js in mobile and table
- refactored js code
  • Loading branch information
Kikobeats committed Feb 15, 2015
1 parent 506cb0c commit 8074ba0
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 28 deletions.
9 changes: 6 additions & 3 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ module.exports = (grunt) ->
'assets/js/src/cover.coffee'
'assets/js/src/search.coffee'
'assets/js/src/post.coffee']
vendor : ['assets/vendor/ghostHunter/jquery.ghostHunter.min.js'
vendor : ['assets/vendor/parrotjs/dist/parrot.standalone.js'
'assets/vendor/parrot-module-device/dist/parrot.device.js'
'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' ]
css :
Expand All @@ -49,8 +52,8 @@ module.exports = (grunt) ->

concat :
options : stripBanners: true
css : src: ['<%=src.css.main%>', '<%=src.css.vendor%>'], dest: '<%=dist.css%>'
js : src: ['<%=dist.js%>', '<%=src.js.vendor%>'], dest: '<%=dist.js%>'
css : src: ['<%=src.css.vendor%>', '<%=src.css.main%>'], dest: '<%=dist.css%>'
js : src: ['<%=src.js.vendor%>', '<%=dist.js%>'], dest: '<%=dist.js%>'

autoprefixer :
main : files: '<%=dist.css%>' : '<%=src.css.main%>'
Expand Down
6 changes: 3 additions & 3 deletions TODO.md → RODAMAP.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TODO
# ROADMAP

- [ ] Define a 404 page.
- [x] Define a 404 page.
- [ ] Create a page with all tags.
- [ ] Integrate comments based on [ouija.js](http://ouija.io/) (Medium style).
- [ ] Better support for static pages.
- [ ] Better support for static pages.
4 changes: 2 additions & 2 deletions assets/css/uno.css

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions assets/js/src/__init.coffee
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"use strict"

$(document).ready ->

window.Uno = Uno =
version: '1.2.2'
version: '1.3.0'

cover:
width: -> $(".panel-cover").width()
Expand Down Expand Up @@ -50,9 +49,12 @@ $(document).ready ->
container.readingTime readingTimeTarget: ".post-reading-time"

$('body').removeClass "no-js"
context = document.body.dataset['page'] ?= Uno.context()
el = document.body
context = el.dataset.page ?= Uno.context()
Uno.cover.collapsed() if context is 'post'
FastClick.attach(el) if el.dataset.device isnt 'desktop'

$('#panic-button').click ->
s = document.createElement('script');
s.setAttribute('src','https://nthitz.github.io/turndownforwhatjs/tdfw.js');
document.body.appendChild(s);
s = document.createElement('script')
s.setAttribute('src','https://nthitz.github.io/turndownforwhatjs/tdfw.js')
document.body.appendChild(s)
4 changes: 2 additions & 2 deletions assets/js/src/cover.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ $(document).ready ->
$(".panel-cover").addClass "panel-cover--collapsed"
Uno.search.form 'show'

if window.location.pathname and window.location.pathname isnt "/"
if document.body.dataset.page is 'home'
Uno.search.form 'show'

if window.location.pathname.substring(0, 5) is "/tag/"
if document.body.dataset.page is 'tag'
$(".panel-cover").addClass "panel-cover--collapsed"

$(".btn-mobile-menu").click ->
Expand Down
4 changes: 0 additions & 4 deletions assets/js/src/search.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"use strict"

## -- Private -----------------------------------------------------------------

showSearch = ->
$(".content-wrapper__inner").hide()
Uno.search.container.css "margin-top", "3rem"
Expand All @@ -12,8 +10,6 @@ hideSearch = ->
Uno.search.container.css "padding-top", "0"
Uno.search.container.css "margin-bottom", "0"

## -- Main --------------------------------------------------------------------

$(document).ready ->
$("#search-field").ghostHunter
results : "#results"
Expand Down
6 changes: 3 additions & 3 deletions assets/js/uno.js

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"name": "uno-zen",
"description": "Minimalist and Elegant theme for Ghost",
"version": "1.1.24",
"version": "1.3.0",
"authors": [
"Kiko Beats <[email protected]>"
],
"dependencies": {
"ghostHunter": "git://github.com/i11ume/ghostHunter/",
"animate.css": "~3.2.0",
"animate.css": "*",
"reading-time": "*",
"pace.js": "*"
"pace": "*",
"parrot-module-device": "*",
"parrotjs": "*",
"fastclick": "*"
},
"ignore": [
"**/.*",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "uno-zen",
"description": "Minimalist and Elegant theme for Ghost",
"version": "1.2.2",
"version": "1.3.0",
"author": {
"name": "Kiko Beats",
"url": "https://github.com/kikobeats"
Expand Down
3 changes: 2 additions & 1 deletion partials/comments.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<section class="post-comments">
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = 'kikobeats'; // required: replace example with your forum shortname
// required: replace example with your forum shortname
var disqus_shortname = 'yourDisqusShorcut';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
Expand Down

0 comments on commit 8074ba0

Please sign in to comment.