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

Commit

Permalink
WIP – little refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Feb 22, 2015
1 parent 63eaef6 commit dde3c67
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 28 deletions.
2 changes: 1 addition & 1 deletion assets/css/uno.css

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions assets/js/src/__init.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ $ ->
window.Uno = Uno =
version: '2.0.0'

cover:
width: -> $(".cover").width()
isCollapsed: -> $(".cover").hasClass("collapsed")
collapsed: ->
$(".cover").addClass("collapsed")
collapsedWithAnimation: ->
$(".cover").addClass("collapsed animated")

search:
container: -> $('#results')
form: (action) -> $("#search-container")[action]()
Expand Down
25 changes: 16 additions & 9 deletions assets/js/src/cover.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,29 @@ $ ->
el = document.body
isOpen = location.hash is '#open'

if Uno.is 'page', 'home'
_expand = ->
Uno.loadingBar 'hide'
Uno.search.form 'hide'
$(".content-wrapper").hide() unless isOpen
$(".cover").removeClass("collapsed")
$(".main").hide() unless isOpen

if isOpen or not Uno.is 'page', 'home'
Uno.cover.collapsed()
_collapsed = ->
$(".cover").addClass("collapsed")
Uno.search.form 'show'
$('.social.expanded').removeClass 'expanded'

$('#blog-button').click ->
Uno.cover.collapsedWithAnimation()
Uno.search.form 'show'
$('.social.expanded').removeClass 'expanded'
$(".content-wrapper").show()
if Uno.is 'page', 'home'
$('.cover').addClass 'animated'
_expand()

_collapsed() if isOpen or not Uno.is 'page', 'home'

$('#blog-button').click ->
$('.cover').toggleClass("collapsed")
Uno.search.form 'toggle'
$('.social.expanded').toggleClass 'expanded'
action = if $('.main').is(":visible") then 'hide' else 'show'
$('.main')[action]()

# $(".btn-mobile-menu").click ->
# /* now is #search-container */
Expand Down
4 changes: 2 additions & 2 deletions assets/js/uno.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions assets/scss/components/_aside.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
width: 100%;
height: 100%;
@include background-filter;

&.animated {
transition: width $aside-animation-time $animation-ease;
}

&.collapsed {
width: $aside-width-collapsed;
&.animated {
transition: width $aside-animation-time $animation-ease;
}
}
&.container {
font-weight: $font-weight-thin;
Expand Down
6 changes: 3 additions & 3 deletions assets/scss/components/_search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
}

.icon-search {
position: relative;
top: 2px;
left: 13rem;
position: absolute;
top: 73%;
left: 72%;
color: $gray;
text-shadow: 1px 1px 0 $gray;
}
2 changes: 1 addition & 1 deletion partials/aside.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="cover container">
<div class="profile">
{{#if @blog.logo}}
<a href="{{@blog.url}}/#open" title="link to homepage for {{@blog.title}}">
<a id="avatar-link" title="link to homepage for {{@blog.title}}">
<img src="{{@blog.logo}}" alt="{{@blog.title}} avatar" class="profile avatar hvr-buzz-out" />
<h1>Kiko Beats</h1>
</a>
Expand Down
2 changes: 1 addition & 1 deletion partials/search.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<section id="search-container">
<i class="icon icon-search"></i>
<form id="search-form">
<i class="icon icon-search"></i>
<input type="text", name="search", placeholder="git, css, javascript,..." id="search-field" />
</form>
<hr class="divider short" />
Expand Down

0 comments on commit dde3c67

Please sign in to comment.