Mobile view; Browser dragging issues

This commit is contained in:
James Barnsley
2016-11-28 07:27:30 +13:00
parent 7c6a84b9ab
commit 48e00ed18e
13 changed files with 92 additions and 11 deletions

View File

@ -46,6 +46,15 @@ class Dragger extends React.Component{
position_y: e.clientY position_y: e.clientY
}) })
var dropzones = document.getElementsByClassName('dropzone')
for( var i = 0; i < dropzones.length; i++ ){
dropzones[i].classList.remove('hover')
}
if( e.target.classList.contains('dropzone') && !e.target.classList.contains('hover') ){
e.target.className += ' hover'
}
// if not already, activate // if not already, activate
if( !this.props.dragger.active ) this.props.uiActions.dragActive() if( !this.props.dragger.active ) this.props.uiActions.dragActive()
} }

View File

@ -171,7 +171,7 @@ export default function reducer(ui = {}, action){
var images = ui.artist.images var images = ui.artist.images
if( images.length <= 0 ) images = action.data.image if( images.length <= 0 ) images = action.data.image
var artist = Object.assign({}, ui.artist, { images: images, bio: action.data.bio }, ) var artist = Object.assign({}, ui.artist, { images: images, bio: action.data.bio, listeners: parseInt(action.data.stats.listeners), on_tour: action.data.ontour }, )
return Object.assign({}, ui, { artist: artist }); return Object.assign({}, ui, { artist: artist });
case 'SPOTIFY_ARTIST_LOADED': case 'SPOTIFY_ARTIST_LOADED':

View File

@ -81,7 +81,10 @@ class Album extends React.Component{
</div> </div>
<ul className="details"> <ul className="details">
<li>{ this.props.album.tracks_total } tracks, <Dater type="total-time" data={this.props.album.tracks} /></li> <li>
{ this.props.album.tracks_total } tracks,
{ this.props.album.tracks ? <Dater type="total-time" data={this.props.album.tracks} /> : null }
</li>
{ this.props.album.release_date ? <li>Released <Dater type="date" data={ this.props.album.release_date } /></li> : null } { this.props.album.release_date ? <li>Released <Dater type="date" data={ this.props.album.release_date } /></li> : null }
<li><FontAwesome name={helpers.sourceIcon( this.props.params.uri )} /> {helpers.uriSource( this.props.params.uri )} playlist</li> <li><FontAwesome name={helpers.sourceIcon( this.props.params.uri )} /> {helpers.uriSource( this.props.params.uri )} playlist</li>
</ul> </ul>

View File

@ -168,9 +168,11 @@ class Artist extends React.Component{
</div> </div>
<ul className="details"> <ul className="details">
{ this.props.artist.followers ? <li>{ this.props.artist.followers.total.toLocaleString() } followers</li> : null } <li>
{ this.props.artist.popularity ? <li>{ this.props.artist.popularity }% popularity</li> : null } { this.props.artist.followers ? <span>{ this.props.artist.followers.total.toLocaleString() } followers,&nbsp;</span> : null }
{ scheme == 'local' ? <li>{ this.props.artist.albums.length.toLocaleString() } albums</li> : null } { this.props.artist.popularity ? <span>{ this.props.artist.popularity }% popularity</span> : null }
{ scheme == 'local' ? <span>{ this.props.artist.listeners.toLocaleString() } listeners</span> : null }
</li>
{ scheme == 'spotify' ? <li><FontAwesome name='spotify' /> Spotify artist</li> : null } { scheme == 'spotify' ? <li><FontAwesome name='spotify' /> Spotify artist</li> : null }
{ scheme == 'local' ? <li><FontAwesome name='folder' /> Local artist</li> : null } { scheme == 'local' ? <li><FontAwesome name='folder' /> Local artist</li> : null }
</ul> </ul>

View File

@ -144,7 +144,10 @@ class Playlist extends React.Component{
</div> </div>
<ul className="details"> <ul className="details">
<li>{ this.props.playlist.tracks_total } tracks, <Dater type="total-time" data={this.props.playlist.tracks} /></li> <li>
{ this.props.playlist.tracks_total } tracks,
{ this.props.playlist.tracks ? <Dater type="total-time" data={this.props.playlist.tracks} /> : null }
</li>
{ this.props.playlist.last_modified ? <li>Updated <Dater type="ago" data={this.props.playlist.last_modified} /> ago</li> : null } { this.props.playlist.last_modified ? <li>Updated <Dater type="ago" data={this.props.playlist.last_modified} /> ago</li> : null }
{ this.props.playlist.followers ? <li>{this.props.playlist.followers.total.toLocaleString()} followers</li> : null } { this.props.playlist.followers ? <li>{this.props.playlist.followers.total.toLocaleString()} followers</li> : null }
{ scheme == 'spotify' && this.props.playlist.owner ? <li>By <Link to={'/user/'+this.props.playlist.owner.uri}>{this.props.playlist.owner.id}</Link> &nbsp;{ !this.props.playlist.public ? <FontAwesome name="lock" /> : null }</li> : null } { scheme == 'spotify' && this.props.playlist.owner ? <li>By <Link to={'/user/'+this.props.playlist.owner.uri}>{this.props.playlist.owner.id}</Link> &nbsp;{ !this.props.playlist.public ? <FontAwesome name="lock" /> : null }</li> : null }

View File

@ -3,6 +3,11 @@
cursor: grabbing !important; cursor: grabbing !important;
cursor: -moz-grabbing !important; cursor: -moz-grabbing !important;
cursor: -webkit-grabbing !important; cursor: -webkit-grabbing !important;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
} }
.dragger { .dragger {
@ -40,7 +45,7 @@
width: 32px; width: 32px;
} }
&:hover { &.hover {
background: $turquoise; background: $turquoise;
} }
} }

View File

@ -64,10 +64,13 @@
:root .dragging &:hover { :root .dragging &:hover {
border-top: 3px solid $blue; border-top: 3px solid $blue;
margin-top: -3px; margin-top: -3px;
background: transparent;
} }
@include responsive( 849px ){ @include responsive( $bp_medium ){
padding: 7px 10px 7px 30px;
.col { .col {
&.name { width: 50%; } &.name { width: 50%; }
&.artists { width: 50%; } &.artists { width: 50%; }
@ -78,6 +81,11 @@
&.header { &.header {
display: none; display: none;
} }
.select-state {
top: 11px;
left: 10px;
}
} }
} }

View File

@ -22,8 +22,8 @@ aside{
} }
@include responsive( $bp_medium ){ @include responsive( $bp_medium ){
width: 50%; width: 50vw;
left: -50%; left: -50vw;
.sidebar-open & { .sidebar-open & {
left: 0px; left: 0px;

View File

@ -59,6 +59,18 @@ main {
section.list-wrapper { section.list-wrapper {
padding: 20px 0; padding: 20px 0;
} }
@include responsive( $bp_medium ){
section.grid-wrapper,
section.text-wrapper {
padding: 20px;
}
section.list-wrapper {
padding: 10px 0;
}
}
} }
h1 { h1 {
@ -179,3 +191,11 @@ footer {
color: #FFFFFF; color: #FFFFFF;
} }
} }
@include responsive( $bp_medium ){
.right-padding { padding-right: 20px; }
.left-padding { padding-left: 20px; }
}

View File

@ -219,3 +219,24 @@ input[type="submit"] {
} }
} }
} }
@include responsive( $bp_medium ){
.field {
.name {
float: none;
width: auto;
padding: 0 0 4px 0;
}
.input {
float: none;
width: auto;
.text {
padding: 0;
}
}
}
}

View File

@ -70,6 +70,10 @@
float: left; float: left;
margin-right: 20px; margin-right: 20px;
} }
.details {
padding-top: 6px;
}
} }
} }

View File

@ -3,7 +3,7 @@
.player { .player {
text-align: center; text-align: center;
padding: 40px 0 10px; padding: 40px 20px 10px;
.artwork, .artwork,
.controls a { .controls a {

View File

@ -18,4 +18,10 @@
padding: 2px 14px; padding: 2px 14px;
} }
} }
@include responsive( $bp_medium ){
section {
padding: 20px;
}
}
} }