mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-25 14:37:59 +01:00
Killing animations...
This commit is contained in:
parent
9c9aeabf30
commit
d9d44f9e6e
12 changed files with 401 additions and 253 deletions
|
@ -88,7 +88,7 @@
|
|||
</ul>
|
||||
</nav>
|
||||
</section>
|
||||
<section ui-view class="site-content" ng-animate="'site-content-animate'">
|
||||
<section ui-view class="site-content">
|
||||
@yield('app_content')
|
||||
</section>
|
||||
</div>
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 137 KiB |
Binary file not shown.
Before Width: | Height: | Size: 186 KiB |
|
@ -8,56 +8,88 @@ angular.module 'ponyfm', ['ui.bootstrap', 'ui.state', 'ui.date', 'ui.sortable'],
|
|||
url: '/account'
|
||||
templateUrl: '/templates/account/settings.html'
|
||||
controller: 'account-settings'
|
||||
navigation:
|
||||
index: 9
|
||||
|
||||
state.state 'account-content',
|
||||
url: '/account'
|
||||
abstract: true
|
||||
templateUrl: '/templates/account/content/_layout.html'
|
||||
navigation:
|
||||
index: 8
|
||||
|
||||
state.state 'account-content.tracks',
|
||||
url: '/tracks'
|
||||
templateUrl: '/templates/account/content/tracks.html'
|
||||
controller: 'account-tracks'
|
||||
navigation:
|
||||
index: 8
|
||||
subIndex: 1
|
||||
|
||||
state.state 'account-content.tracks.edit',
|
||||
url: '/edit/:track_id'
|
||||
navigation:
|
||||
index: 8
|
||||
subIndex: 1
|
||||
|
||||
state.state 'account-content.albums',
|
||||
url: '/albums'
|
||||
templateUrl: '/templates/account/content/albums.html'
|
||||
controller: 'account-albums'
|
||||
navigation:
|
||||
index: 8
|
||||
subIndex: 2
|
||||
|
||||
state.state 'account-content.albums.create',
|
||||
url: '/create'
|
||||
templateUrl: '/templates/account/content/album.html'
|
||||
controller: 'account-albums-edit'
|
||||
navigation:
|
||||
index: 8
|
||||
subIndex: 2
|
||||
|
||||
state.state 'account-content.albums.edit',
|
||||
url: '/edit/:album_id'
|
||||
templateUrl: '/templates/account/content/album.html'
|
||||
controller: 'account-albums-edit'
|
||||
navigation:
|
||||
index: 8
|
||||
subIndex: 2
|
||||
|
||||
state.state 'account-content-playlists',
|
||||
url: '/account/playlists'
|
||||
templateUrl: '/templates/account/content/playlists.html'
|
||||
controller: 'account-playlists'
|
||||
navigation:
|
||||
index: 6
|
||||
|
||||
state.state 'account-favourites',
|
||||
url: '/account/favourites'
|
||||
abstract: true
|
||||
templateUrl: '/templates/account/favourites/_layout.html'
|
||||
navigation:
|
||||
index: 7
|
||||
|
||||
state.state 'account-favourites.tracks',
|
||||
url: ''
|
||||
templateUrl: '/templates/account/favourites/tracks.html'
|
||||
navigation:
|
||||
index: 7
|
||||
subIndex: 1
|
||||
|
||||
state.state 'account-favourites.playlists',
|
||||
url: '/playlists'
|
||||
templateUrl: '/templates/account/favourites/playlists.html'
|
||||
navigation:
|
||||
index: 7
|
||||
subIndex: 3
|
||||
|
||||
state.state 'account-favourites.albums',
|
||||
url: '/albums'
|
||||
templateUrl: '/templates/account/favourites/albums.html'
|
||||
navigation:
|
||||
index: 7
|
||||
subIndex: 2
|
||||
|
||||
# Tracks
|
||||
|
||||
|
@ -65,39 +97,53 @@ angular.module 'ponyfm', ['ui.bootstrap', 'ui.state', 'ui.date', 'ui.sortable'],
|
|||
url: '/tracks'
|
||||
templateUrl: '/templates/tracks/index.html'
|
||||
controller: 'tracks'
|
||||
navigation:
|
||||
index: 2
|
||||
|
||||
# Albums
|
||||
|
||||
state.state 'albums',
|
||||
url: '/albums'
|
||||
templateUrl: '/templates/albums/index.html'
|
||||
navigation:
|
||||
index: 3
|
||||
|
||||
# Playlists
|
||||
|
||||
state.state 'playlists',
|
||||
url: '/playlists'
|
||||
templateUrl: '/templates/playlists/index.html'
|
||||
navigation:
|
||||
index: 4
|
||||
|
||||
state.state 'playlist',
|
||||
url: '/playlist/:id/:slug'
|
||||
templateUrl: '/templates/playlists/show.html'
|
||||
controller: 'playlist'
|
||||
navigation:
|
||||
index: 4
|
||||
|
||||
# Artists
|
||||
|
||||
state.state 'artists',
|
||||
url: '/artists'
|
||||
templateUrl: '/templates/artists/index.html'
|
||||
navigation:
|
||||
index: 5
|
||||
|
||||
# Pages
|
||||
|
||||
state.state 'faq',
|
||||
url: '/faq'
|
||||
templateUrl: '/templates/pages/faq.html'
|
||||
navigation:
|
||||
index: 11
|
||||
|
||||
state.state 'about',
|
||||
url: '/about'
|
||||
templateUrl: '/templates/pages/about.html'
|
||||
navigation:
|
||||
index: 10
|
||||
|
||||
# Auth
|
||||
|
||||
|
@ -105,10 +151,14 @@ angular.module 'ponyfm', ['ui.bootstrap', 'ui.state', 'ui.date', 'ui.sortable'],
|
|||
url: '/login'
|
||||
templateUrl: '/templates/auth/login.html'
|
||||
controller: 'login'
|
||||
navigation:
|
||||
index: 12
|
||||
|
||||
state.state 'register',
|
||||
url: '/register'
|
||||
templateUrl: '/templates/auth/register.html'
|
||||
navigation:
|
||||
index: 13
|
||||
|
||||
# Hompage
|
||||
|
||||
|
@ -117,10 +167,14 @@ angular.module 'ponyfm', ['ui.bootstrap', 'ui.state', 'ui.date', 'ui.sortable'],
|
|||
url: '/'
|
||||
templateUrl: '/templates/dashboard.html'
|
||||
controller: 'dashboard'
|
||||
navigation:
|
||||
index: 0
|
||||
else
|
||||
state.state 'home',
|
||||
url: '/'
|
||||
templateUrl: '/templates/home/index.html'
|
||||
navigation:
|
||||
index: 0
|
||||
|
||||
route.otherwise '/'
|
||||
|
||||
|
|
|
@ -9,8 +9,44 @@ angular.module('ponyfm').controller "application", [
|
|||
auth.logout().done -> location.reload()
|
||||
|
||||
$scope.isActive = (loc) -> $location.path() == loc
|
||||
$scope.$on '$viewContentLoaded', () -> window.handleResize()
|
||||
$scope.$on '$viewContentLoaded', () ->
|
||||
window.setTimeout window.handleResize, 500
|
||||
|
||||
# Show loading screen here?
|
||||
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
|
||||
]
|
|
@ -2,16 +2,17 @@ window.handleResize = () ->
|
|||
windowHeight = $(window).height()
|
||||
$siteBody = $ '.site-body'
|
||||
$siteBody.height windowHeight - $('header').height() - 1
|
||||
redo = false
|
||||
|
||||
$('.stretch-to-bottom').each () ->
|
||||
$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'
|
||||
backgroundTwo = $ '.background-two'
|
||||
|
||||
backgroundOne.css 'left', $('.site-content ').offset().left - backgroundOne.width()
|
||||
backgroundTwo.css 'left', $('.site-content').offset().left + $('.site-content').width()
|
||||
window.setTimeout(window.handleResize, 0) if redo
|
||||
|
||||
window.alignVertically = (element) ->
|
||||
$element = $(element)
|
||||
|
|
94
public/styles/animations.less
Normal file
94
public/styles/animations.less
Normal 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));
|
||||
}
|
|
@ -7,3 +7,4 @@
|
|||
@import 'components';
|
||||
@import 'forms';
|
||||
@import 'tracks';
|
||||
@import 'animations';
|
|
@ -21,60 +21,6 @@ html body {
|
|||
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 {
|
||||
.clearfix();
|
||||
background: #222;
|
||||
|
@ -392,17 +338,18 @@ header {
|
|||
}
|
||||
|
||||
.site-content {
|
||||
.perspective();
|
||||
overflow: hidden;
|
||||
border: 5px solid #222;
|
||||
border-top: none;
|
||||
border-bottom: none;
|
||||
position: relative;
|
||||
|
||||
height: 100%;
|
||||
margin-left: 148px;
|
||||
|
||||
> div {
|
||||
.box-sizing(border-box);
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
|
@ -412,6 +359,17 @@ header {
|
|||
}
|
||||
}
|
||||
|
||||
.inner-view {
|
||||
position: relative;
|
||||
|
||||
> div {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
|
||||
.site-content {
|
||||
h1 {
|
||||
border: none;
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
<li ng-class="{active: $state.includes('account-content.albums')}"><a href="/account/albums">Albums</a></li>
|
||||
</ul>
|
||||
|
||||
<div ui-view></div>
|
||||
<div ui-view class="inner-view"></div>
|
||||
</div>
|
|
@ -1,12 +1,13 @@
|
|||
<ul class="dropdowns">
|
||||
<div>
|
||||
<ul class="dropdowns">
|
||||
<li class="dropdown">
|
||||
<a class="btn" href="/account/albums/create" ng-class="{'btn-primary': data.isEditorOpen && data.selectedAlbum == null}">
|
||||
<i class="icon-plus"></i> Create Album
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<div class="two-pane-view" ng-class="{open: data.isEditorOpen, closed: !data.isEditorOpen}">
|
||||
<div class="two-pane-view" ng-class="{open: data.isEditorOpen, closed: !data.isEditorOpen}">
|
||||
<div class="list">
|
||||
<ul class="account-albums-listing stretch-to-bottom">
|
||||
<li ng-repeat="album in albums" ng-class="{selected: album.id == data.selectedAlbum.id}">
|
||||
|
@ -24,4 +25,5 @@
|
|||
|
||||
<div class="editor" ui-view>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,4 +1,5 @@
|
|||
<ul class="dropdowns">
|
||||
<div>
|
||||
<ul class="dropdowns">
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle btn">
|
||||
Published: <strong>{{filter.published.title}}</strong>
|
||||
|
@ -39,9 +40,9 @@
|
|||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<div class="two-pane-view" ng-class="{open: selectedTrack != null, closed: selectedTrack == null}">
|
||||
<div class="two-pane-view" ng-class="{open: selectedTrack != null, closed: selectedTrack == null}">
|
||||
<div class="list">
|
||||
<ul class="account-tracks-listing stretch-to-bottom">
|
||||
<li ng-repeat="track in tracks" ng-class="{selected: track.id == selectedTrack.id, 'is-not-published': !track.is_published}">
|
||||
|
@ -173,4 +174,5 @@
|
|||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in a new issue