Killing animations...

This commit is contained in:
nelsonlaquet 2013-07-29 15:54:53 -05:00
parent 9c9aeabf30
commit d9d44f9e6e
12 changed files with 401 additions and 253 deletions

View file

@ -88,7 +88,7 @@
</ul> </ul>
</nav> </nav>
</section> </section>
<section ui-view class="site-content" ng-animate="'site-content-animate'"> <section ui-view class="site-content">
@yield('app_content') @yield('app_content')
</section> </section>
</div> </div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 KiB

View file

@ -8,56 +8,88 @@ angular.module 'ponyfm', ['ui.bootstrap', 'ui.state', 'ui.date', 'ui.sortable'],
url: '/account' url: '/account'
templateUrl: '/templates/account/settings.html' templateUrl: '/templates/account/settings.html'
controller: 'account-settings' controller: 'account-settings'
navigation:
index: 9
state.state 'account-content', state.state 'account-content',
url: '/account' url: '/account'
abstract: true abstract: true
templateUrl: '/templates/account/content/_layout.html' templateUrl: '/templates/account/content/_layout.html'
navigation:
index: 8
state.state 'account-content.tracks', state.state 'account-content.tracks',
url: '/tracks' url: '/tracks'
templateUrl: '/templates/account/content/tracks.html' templateUrl: '/templates/account/content/tracks.html'
controller: 'account-tracks' controller: 'account-tracks'
navigation:
index: 8
subIndex: 1
state.state 'account-content.tracks.edit', state.state 'account-content.tracks.edit',
url: '/edit/:track_id' url: '/edit/:track_id'
navigation:
index: 8
subIndex: 1
state.state 'account-content.albums', state.state 'account-content.albums',
url: '/albums' url: '/albums'
templateUrl: '/templates/account/content/albums.html' templateUrl: '/templates/account/content/albums.html'
controller: 'account-albums' controller: 'account-albums'
navigation:
index: 8
subIndex: 2
state.state 'account-content.albums.create', state.state 'account-content.albums.create',
url: '/create' url: '/create'
templateUrl: '/templates/account/content/album.html' templateUrl: '/templates/account/content/album.html'
controller: 'account-albums-edit' controller: 'account-albums-edit'
navigation:
index: 8
subIndex: 2
state.state 'account-content.albums.edit', state.state 'account-content.albums.edit',
url: '/edit/:album_id' url: '/edit/:album_id'
templateUrl: '/templates/account/content/album.html' templateUrl: '/templates/account/content/album.html'
controller: 'account-albums-edit' controller: 'account-albums-edit'
navigation:
index: 8
subIndex: 2
state.state 'account-content-playlists', state.state 'account-content-playlists',
url: '/account/playlists' url: '/account/playlists'
templateUrl: '/templates/account/content/playlists.html' templateUrl: '/templates/account/content/playlists.html'
controller: 'account-playlists' controller: 'account-playlists'
navigation:
index: 6
state.state 'account-favourites', state.state 'account-favourites',
url: '/account/favourites' url: '/account/favourites'
abstract: true abstract: true
templateUrl: '/templates/account/favourites/_layout.html' templateUrl: '/templates/account/favourites/_layout.html'
navigation:
index: 7
state.state 'account-favourites.tracks', state.state 'account-favourites.tracks',
url: '' url: ''
templateUrl: '/templates/account/favourites/tracks.html' templateUrl: '/templates/account/favourites/tracks.html'
navigation:
index: 7
subIndex: 1
state.state 'account-favourites.playlists', state.state 'account-favourites.playlists',
url: '/playlists' url: '/playlists'
templateUrl: '/templates/account/favourites/playlists.html' templateUrl: '/templates/account/favourites/playlists.html'
navigation:
index: 7
subIndex: 3
state.state 'account-favourites.albums', state.state 'account-favourites.albums',
url: '/albums' url: '/albums'
templateUrl: '/templates/account/favourites/albums.html' templateUrl: '/templates/account/favourites/albums.html'
navigation:
index: 7
subIndex: 2
# Tracks # Tracks
@ -65,39 +97,53 @@ angular.module 'ponyfm', ['ui.bootstrap', 'ui.state', 'ui.date', 'ui.sortable'],
url: '/tracks' url: '/tracks'
templateUrl: '/templates/tracks/index.html' templateUrl: '/templates/tracks/index.html'
controller: 'tracks' controller: 'tracks'
navigation:
index: 2
# Albums # Albums
state.state 'albums', state.state 'albums',
url: '/albums' url: '/albums'
templateUrl: '/templates/albums/index.html' templateUrl: '/templates/albums/index.html'
navigation:
index: 3
# Playlists # Playlists
state.state 'playlists', state.state 'playlists',
url: '/playlists' url: '/playlists'
templateUrl: '/templates/playlists/index.html' templateUrl: '/templates/playlists/index.html'
navigation:
index: 4
state.state 'playlist', state.state 'playlist',
url: '/playlist/:id/:slug' url: '/playlist/:id/:slug'
templateUrl: '/templates/playlists/show.html' templateUrl: '/templates/playlists/show.html'
controller: 'playlist' controller: 'playlist'
navigation:
index: 4
# Artists # Artists
state.state 'artists', state.state 'artists',
url: '/artists' url: '/artists'
templateUrl: '/templates/artists/index.html' templateUrl: '/templates/artists/index.html'
navigation:
index: 5
# Pages # Pages
state.state 'faq', state.state 'faq',
url: '/faq' url: '/faq'
templateUrl: '/templates/pages/faq.html' templateUrl: '/templates/pages/faq.html'
navigation:
index: 11
state.state 'about', state.state 'about',
url: '/about' url: '/about'
templateUrl: '/templates/pages/about.html' templateUrl: '/templates/pages/about.html'
navigation:
index: 10
# Auth # Auth
@ -105,10 +151,14 @@ angular.module 'ponyfm', ['ui.bootstrap', 'ui.state', 'ui.date', 'ui.sortable'],
url: '/login' url: '/login'
templateUrl: '/templates/auth/login.html' templateUrl: '/templates/auth/login.html'
controller: 'login' controller: 'login'
navigation:
index: 12
state.state 'register', state.state 'register',
url: '/register' url: '/register'
templateUrl: '/templates/auth/register.html' templateUrl: '/templates/auth/register.html'
navigation:
index: 13
# Hompage # Hompage
@ -117,10 +167,14 @@ angular.module 'ponyfm', ['ui.bootstrap', 'ui.state', 'ui.date', 'ui.sortable'],
url: '/' url: '/'
templateUrl: '/templates/dashboard.html' templateUrl: '/templates/dashboard.html'
controller: 'dashboard' controller: 'dashboard'
navigation:
index: 0
else else
state.state 'home', state.state 'home',
url: '/' url: '/'
templateUrl: '/templates/home/index.html' templateUrl: '/templates/home/index.html'
navigation:
index: 0
route.otherwise '/' route.otherwise '/'

View file

@ -9,8 +9,44 @@ angular.module('ponyfm').controller "application", [
auth.logout().done -> location.reload() auth.logout().done -> location.reload()
$scope.isActive = (loc) -> $location.path() == loc $scope.isActive = (loc) -> $location.path() == loc
$scope.$on '$viewContentLoaded', () -> window.handleResize() $scope.$on '$viewContentLoaded', () ->
window.setTimeout window.handleResize, 500
# Show loading screen here? # Show loading screen here?
taxonomies.refresh() taxonomies.refresh()
$scope.mainViewAnimation = 'slide-down';
$scope.$on '$stateChangeStart', (e, newState, newParams, oldState) ->
oldIndex =
if (oldState && oldState.navigation && oldState.navigation.index)
oldState.navigation.index
else
0
newIndex =
if (newState && newState.navigation && newState.navigation.index)
newState.navigation.index
else
0
oldSubIndex =
if (oldState && oldState.navigation && oldState.navigation.subIndex)
oldState.navigation.subIndex
else
0
newSubIndex =
if (newState && newState.navigation && newState.navigation.subIndex)
newState.navigation.subIndex
else
0
$scope.mainViewAnimation = 'slide-down' if oldIndex > newIndex
$scope.mainViewAnimation = 'slide-up' if oldIndex < newIndex
$scope.mainViewAnimation = 'slide-right' if oldIndex == newIndex
$scope.subViewAnimation = 'slide-right' if oldSubIndex > newSubIndex
$scope.subViewAnimation = 'slide-left' if oldSubIndex < newSubIndex
$scope.subViewAnimation = 'slide-up' if oldSubIndex == newSubIndex
] ]

View file

@ -2,16 +2,17 @@ window.handleResize = () ->
windowHeight = $(window).height() windowHeight = $(window).height()
$siteBody = $ '.site-body' $siteBody = $ '.site-body'
$siteBody.height windowHeight - $('header').height() - 1 $siteBody.height windowHeight - $('header').height() - 1
redo = false
$('.stretch-to-bottom').each () -> $('.stretch-to-bottom').each () ->
$this = $ this $this = $ this
$this.height windowHeight - $this.offset().top newHeight = windowHeight - $this.offset().top + 1
if newHeight <= 0
redo = true
else
$this.height newHeight
backgroundOne = $ '.background-one' window.setTimeout(window.handleResize, 0) if redo
backgroundTwo = $ '.background-two'
backgroundOne.css 'left', $('.site-content ').offset().left - backgroundOne.width()
backgroundTwo.css 'left', $('.site-content').offset().left + $('.site-content').width()
window.alignVertically = (element) -> window.alignVertically = (element) ->
$element = $(element) $element = $(element)

View file

@ -0,0 +1,94 @@
@import 'base/bootstrap/bootstrap';
@import 'mixins';
.slide-down-enter, .slide-down-leave,
.slide-up-enter, .slide-up-leave,
.slide-right-enter, .slide-right-leave {
position: absolute;
}
// ---------------------------------------
// Down
// ---------------------------------------
.slide-down-enter {
.transition(all 400ms ease-out);
.transform(translate(0, -100%));
}
.slide-down-enter.slide-down-enter-active {
.transform(translate(0, 0));
}
.slide-down-leave {
.transition(all 400ms ease-out);
.transform(translate(0, 0));
}
.slide-down-leave.slide-down-leave-active {
.transform(translate(0, 100%));
}
// ---------------------------------------
// Up
// ---------------------------------------
.slide-up-enter {
.transition(all 400ms ease-out);
.transform(translate(0, 100%));
}
.slide-up-enter.slide-up-enter-active {
.transform(translate(0, 0));
}
.slide-up-leave {
.transition(all 400ms ease-out);
.transform(translate(0, 0));
}
.slide-up-leave.slide-up-leave-active {
.transform(translate(0, -100%));
}
// ---------------------------------------
// Right
// ---------------------------------------
.slide-right-enter {
.transition(all 400ms ease-out);
.transform(translate(-100%, 0));
}
.slide-right-enter.slide-right-enter-active {
.transform(translate(0, 0));
}
.slide-right-leave {
.transition(all 400ms ease-out);
.transform(translate(0, 0));
}
.slide-right-leave.slide-right-leave-active {
.transform(translate(100%, 0));
}
// ---------------------------------------
// Left
// ---------------------------------------
.slide-left-enter {
.transition(all 400ms ease-out);
.transform(translate(100%, 0));
}
.slide-left-enter.slide-left-enter-active {
.transform(translate(0, 0));
}
.slide-left-leave {
.transition(all 400ms ease-out);
.transform(translate(0, 0));
}
.slide-left-leave.slide-left-leave-active {
.transform(translate(-100%, 0));
}

View file

@ -7,3 +7,4 @@
@import 'components'; @import 'components';
@import 'forms'; @import 'forms';
@import 'tracks'; @import 'tracks';
@import 'animations';

View file

@ -21,60 +21,6 @@ html body {
z-index: -5; z-index: -5;
} }
.background-one, .background-two {
z-index: -4;
background-repeat: no-repeat;
background-position: bottom right;
height: 100%;
width: 350px;
position: fixed;
background-size: 35%;
}
html .background-one {
background-image: url('/images/octavia.png');
background-position: bottom right;
opacity: .1;
}
html .background-two {
background-image: url('/images/vinyl.png');
background-position: bottom left;
opacity: .1;
display: none;
}
.site-content {
.perspective();
position: relative;
}
.site-content-animate-enter, .site-content-animate-leave {
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
}
.site-content-animate-enter {
.transition(all 400ms ease-out);
.transform(translate(0, -100%));
}
.site-content-animate-enter.site-content-animate-enter-active {
.transform(translate(0, 0));
}
.site-content-animate-leave {
.transition(all 400ms ease-out);
.transform(translate(0, 0));
}
.site-content-animate-leave.site-content-animate-leave-active {
.transform(translate(0, 100%));
}
header { header {
.clearfix(); .clearfix();
background: #222; background: #222;
@ -392,17 +338,18 @@ header {
} }
.site-content { .site-content {
.perspective();
overflow: hidden; overflow: hidden;
border: 5px solid #222; border: 5px solid #222;
border-top: none; border-top: none;
border-bottom: none; border-bottom: none;
position: relative;
height: 100%; height: 100%;
margin-left: 148px; margin-left: 148px;
> div { > div {
.box-sizing(border-box); .box-sizing(border-box);
overflow: hidden;
width: 100%; width: 100%;
height: 100%; height: 100%;
background: #fff; background: #fff;
@ -412,6 +359,17 @@ header {
} }
} }
.inner-view {
position: relative;
> div {
width: 100%;
height: 100%;
background: #fff;
position: relative;
}
}
.site-content { .site-content {
h1 { h1 {
border: none; border: none;

View file

@ -4,5 +4,5 @@
<li ng-class="{active: $state.includes('account-content.albums')}"><a href="/account/albums">Albums</a></li> <li ng-class="{active: $state.includes('account-content.albums')}"><a href="/account/albums">Albums</a></li>
</ul> </ul>
<div ui-view></div> <div ui-view class="inner-view"></div>
</div> </div>

View file

@ -1,3 +1,4 @@
<div>
<ul class="dropdowns"> <ul class="dropdowns">
<li class="dropdown"> <li class="dropdown">
<a class="btn" href="/account/albums/create" ng-class="{'btn-primary': data.isEditorOpen && data.selectedAlbum == null}"> <a class="btn" href="/account/albums/create" ng-class="{'btn-primary': data.isEditorOpen && data.selectedAlbum == null}">
@ -25,3 +26,4 @@
<div class="editor" ui-view> <div class="editor" ui-view>
</div> </div>
</div> </div>
</div>

View file

@ -1,3 +1,4 @@
<div>
<ul class="dropdowns"> <ul class="dropdowns">
<li class="dropdown"> <li class="dropdown">
<a class="dropdown-toggle btn"> <a class="dropdown-toggle btn">
@ -174,3 +175,4 @@
</form> </form>
</div> </div>
</div> </div>
</div>