Skip to content

Commit

Permalink
Styling Finishing Touches
Browse files Browse the repository at this point in the history
  • Loading branch information
15Dkatz committed Oct 20, 2022
1 parent 3e63fe1 commit 815c5cd
Show file tree
Hide file tree
Showing 7 changed files with 149 additions and 78 deletions.
70 changes: 34 additions & 36 deletions music-master/dist/index.61d3354a.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion music-master/dist/index.61d3354a.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 47 additions & 10 deletions music-master/dist/index.975ef6c8.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion music-master/dist/index.975ef6c8.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions music-master/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ const API_ADDRESS = 'https://spotify-api-wrapper.appspot.com';
class App extends Component {
state = { artist: null, tracks: [] };

componentDidMount() {
this.searchArtist('metallica')
}

searchArtist = artistQuery => {
fetch(`${API_ADDRESS}/artist/${artistQuery}`)
.then(response => response.json())
Expand Down
30 changes: 27 additions & 3 deletions music-master/src/components/Tracks.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ class Tracks extends Component {
}
}

trackIcon = track => {
if (!track.preview_url) {
return <span>N/A</span>;
}

if (
this.state.playing &&
this.state.playingPreviewUrl === track.preview_url
) {
return <span>| |</span>;
}

return <span>&#9654;</span>
}

render() {
const { tracks } = this.props;

Expand All @@ -31,9 +46,18 @@ class Tracks extends Component {
const { id, name, album, preview_url } = track;

return (
<div key={id} onClick={this.playAudio(preview_url)}>
<img src={album.images[0].url} alt='track-image' />
<p>{name}</p>
<div
key={id}
onClick={this.playAudio(preview_url)}
className='track'
>
<img
src={album.images[0].url}
alt='track-image'
className='track-image'
/>
<p className='track-text'>{name}</p>
<p className='track-icon'>{this.trackIcon(track)}</p>
</div>
)
})
Expand Down
62 changes: 35 additions & 27 deletions music-master/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,38 @@ h1, h2, h3, h4, h5 {
font-family: 'EconomicaBold';
}

.profile {
width: 200px;
height: 200px;
border-radius: 100px;
}

.title-fade-out {
opacity: 0;
animation-name: fade-out;
animation-duration: 2s;
}

.title-fade-in {
opacity: 100;
animation-name: fade-in;
animation-duration: 2s;
}

@keyframes fade-out {
from {opacity: 100}
to {opacity: 0}
}

@keyframes fade-in {
from {opacity: 0}
to {opacity: 100}
}
.track {
width: 250px;
height: 250px;
position: relative;
display: inline-block;
margin: 20px;
cursor: pointer;
}

.track-image {
width: 250px;
height: 250px;
}

.track-text {
position: absolute;
width: 250px;
bottom: 0px;
background-color: black;
color: white;
padding: 5px;
}

.track-icon {
position: absolute;
bottom: 100px;
left: 100px;
color: white;
background-color: black;
width: 50px;
height: 50px;
border-radius: 25px;
padding: 10px;
opacity: 0.8;
}

0 comments on commit 815c5cd

Please sign in to comment.