Parallax disabling for low-powered devices

This commit is contained in:
James Barnsley
2018-09-17 08:18:07 +12:00
parent cbdd2c4ad3
commit b5111b1840
17 changed files with 204 additions and 123 deletions

View File

@ -47,7 +47,7 @@ class DiscoverFeatured extends React.Component{
if (playlist){
return (
<div className="intro">
<Parallax image={playlist.images ? playlist.images.large : null} blur theme={this.props.theme} />
<Parallax image={playlist.images ? playlist.images.large : null} blur theme={this.props.theme} disabled={this.props.disable_parallax} />
<div className="content cf">
<Link
to={global.baseURL+'playlist/'+playlist.uri}
@ -67,7 +67,7 @@ class DiscoverFeatured extends React.Component{
} else {
return (
<div className="intro">
<Parallax />
<Parallax disabled={this.props.disable_parallax} />
</div>
)
}
@ -134,6 +134,7 @@ class DiscoverFeatured extends React.Component{
const mapStateToProps = (state, ownProps) => {
return {
disable_parallax: state.ui.disable_parallax,
theme: state.ui.theme,
load_queue: state.ui.load_queue,
featured_playlists: state.spotify.featured_playlists,

View File

@ -60,7 +60,7 @@ class DiscoverNewReleases extends React.Component{
if (album){
return (
<div className="intro">
<Parallax image={album.images ? album.images.large : null} blur theme={this.props.theme} />
<Parallax image={album.images ? album.images.large : null} blur theme={this.props.theme} disabled={this.props.disable_parallax} />
<div className="content cf">
<Link
to={global.baseURL+'album/'+album.uri}
@ -84,7 +84,7 @@ class DiscoverNewReleases extends React.Component{
} else {
return (
<div className="intro">
<Parallax />
<Parallax disabled={this.props.disable_parallax} />
</div>
)
}
@ -155,6 +155,7 @@ class DiscoverNewReleases extends React.Component{
const mapStateToProps = (state, ownProps) => {
return {
disable_parallax: state.ui.disable_parallax,
theme: state.ui.theme,
load_queue: state.ui.load_queue,
artists: state.core.artists,

View File

@ -503,7 +503,7 @@ class Discover extends React.Component{
<div className="view discover-view">
<div className="intro">
<Parallax image="assets/backgrounds/discover.jpg" theme={this.props.theme} />
<Parallax image="assets/backgrounds/discover.jpg" theme={this.props.theme} disabled={this.props.disable_parallax} />
<div className="liner">
<h1>Explore new music</h1>
@ -547,6 +547,7 @@ class Discover extends React.Component{
const mapStateToProps = (state, ownProps) => {
return {
disable_parallax: state.ui.disable_parallax,
theme: state.ui.theme,
albums: state.core.albums,
artists: state.core.artists,