From 3474664520f9160775a949a7dffd505a9cc81048 Mon Sep 17 00:00:00 2001 From: Josef Citrine Date: Fri, 20 May 2016 01:10:31 +0100 Subject: [PATCH] Track player optimisations for mobile --- public/templates/directives/track-player.html | 8 +++-- public/templates/tracks/frame.html | 4 ++- .../app/directives/track-player.coffee | 5 ++++ resources/assets/styles/content.less | 16 ++++++++-- resources/assets/styles/layout.less | 4 ++- resources/assets/styles/mobile.less | 30 ++++++++++++++++++- resources/views/shared/_app_layout.blade.php | 2 +- 7 files changed, 60 insertions(+), 9 deletions(-) diff --git a/public/templates/directives/track-player.html b/public/templates/directives/track-player.html index 27dbf1b7..e9d68533 100644 --- a/public/templates/directives/track-player.html +++ b/public/templates/directives/track-player.html @@ -1,7 +1,9 @@
- - +
+ + +
- +
diff --git a/public/templates/tracks/frame.html b/public/templates/tracks/frame.html index 3392baff..90d2a46e 100644 --- a/public/templates/tracks/frame.html +++ b/public/templates/tracks/frame.html @@ -42,7 +42,7 @@
- +

{{track.title}}

@@ -53,5 +53,7 @@

+ +
diff --git a/resources/assets/scripts/app/directives/track-player.coffee b/resources/assets/scripts/app/directives/track-player.coffee index 2ef3a616..f0ecc045 100644 --- a/resources/assets/scripts/app/directives/track-player.coffee +++ b/resources/assets/scripts/app/directives/track-player.coffee @@ -19,12 +19,17 @@ module.exports = angular.module('ponyfm').directive 'pfmTrackPlayer', () -> templateUrl: '/templates/directives/track-player.html' scope: track: '=track', + size: '@size', class: '@class' replace: true controller: [ '$scope', 'player' ($scope, player) -> + if $scope.size == 'normal' + $scope.image = $scope.track.covers.normal + else + $scope.image = $scope.track.covers.thumbnail $scope.play = () -> player.playTracks [$scope.track], 0 ] diff --git a/resources/assets/styles/content.less b/resources/assets/styles/content.less index c21631de..5042e871 100644 --- a/resources/assets/styles/content.less +++ b/resources/assets/styles/content.less @@ -325,6 +325,18 @@ html .single-player .play-button { height: @icon-size; position: relative; + .button-container { + display: table; + width: 100%; + height: 100%; + + > i { + display: table-cell; + vertical-align: middle; + text-align: center; + } + } + .play-button { .transition(background 250ms ease-out); @@ -404,10 +416,10 @@ html { line-height: normal; padding: 0px; - padding: 5px 0px; + margin: 5px 0px; padding-right: 10px; position: relative; - height: 56px; + height: 43px; .icons { float: right; diff --git a/resources/assets/styles/layout.less b/resources/assets/styles/layout.less index ebe22057..65bec21d 100644 --- a/resources/assets/styles/layout.less +++ b/resources/assets/styles/layout.less @@ -45,9 +45,11 @@ header { float: right; padding: 2px; cursor: pointer; + text-decoration: none; - &:hover { + &:hover, &:focus { background: #ddd; + color: darken(@pfm-purple, 20%); } span { diff --git a/resources/assets/styles/mobile.less b/resources/assets/styles/mobile.less index 3632c5f7..93037dc4 100644 --- a/resources/assets/styles/mobile.less +++ b/resources/assets/styles/mobile.less @@ -1,4 +1,4 @@ -@media only screen and (max-width: 480px) { +@media only screen and (max-width: 768px) { html, body { overflow: hidden !important; } @@ -152,4 +152,32 @@ } } } + + .track-details { + .single-player { + &.visible-xs-block { + float: none; + width: 100%; + height: 100%; + } + + a { + font-size: 22pt; + background: rgba(0, 0, 0, 0.2); + } + } + + header { + margin-bottom: 0px; + h1 { + font-size: 16pt; + } + h2 { + font-size: 11pt; + } + h1, h2 { + margin-left: 0px !important; + } + } + } } diff --git a/resources/views/shared/_app_layout.blade.php b/resources/views/shared/_app_layout.blade.php index 515112d9..7679fde3 100644 --- a/resources/views/shared/_app_layout.blade.php +++ b/resources/views/shared/_app_layout.blade.php @@ -76,7 +76,7 @@ -
  • +
  • Tracks
  • Albums
  • Playlists