-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jonas Music release app #101
Open
Jonash189
wants to merge
12
commits into
Technigo:main
Choose a base branch
from
Jonash189:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5914ad1
Creating map components and diffrent folders for: Album, AlbumName, …
Jonash189 0ef8128
I created the functions to be exported to App, which is my main page …
Jonash189 3c5c768
Adding URL to ArtistName and AlbumName.
Jonash189 1cfeffd
Adding styling to the AlbumCovers.
Jonash189 e16c7c9
In addition to the album cover, I've added an overlay and three icon…
Jonash189 43bb655
I updated the AlbumCover component to display icons (play, heart, do…
Jonash189 6710ba6
I made the artist names clickable and added logic to insert commas …
Jonash189 d49d52f
Adding mediaQ so its one albumcover in mobile and two in ipads.
Jonash189 daeb185
Changes font color.
Jonash189 779ece8
Styling header and h1.
Jonash189 24351e9
Adding info to README.
Jonash189 a342854
Cleaning the code.
Jonash189 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,6 @@ module.exports = { | |
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
'react/prop-types': 'off' | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Music Releases</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.jsx"></script> | ||
</body> | ||
</html> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Jonas Music Releases</title> | ||
</head> | ||
|
||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.jsx"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
import data from "./data.json"; | ||
|
||
console.log(data); | ||
import React from 'react'; | ||
import data from './data.json'; | ||
import { Header } from './components/Header'; | ||
import { Album } from './components/Album'; | ||
|
||
export const App = () => { | ||
return <div>Find me in src/app.jsx!</div>; | ||
return ( | ||
<div> | ||
<Header /> | ||
<div className="App"> | ||
{data.albums.items.map((album) => ( | ||
<Album key={album.id} album={album} /> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from "react"; | ||
import { ArtistName } from "./ArtistName"; | ||
import { AlbumName } from "./AlbumName"; | ||
import { AlbumCover } from "./AlbumCover"; | ||
import './App.css'; | ||
|
||
export const Album = ({ album }) => { | ||
const totalArtists = album.artists.length; | ||
|
||
return ( | ||
<div className="album"> | ||
<AlbumCover imageUrl={album.images[0].url} alt={album.name} /> | ||
<AlbumName name={album.name} url={album.external_urls.spotify} /> | ||
<div className="artists"> | ||
{album.artists.map((artist, index) => ( | ||
<ArtistName | ||
key={artist.id} | ||
artist={artist} | ||
index={index} | ||
totalArtists={totalArtists} | ||
/> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
.cover-container { | ||
position: relative; | ||
width: 100%; | ||
} | ||
|
||
.album-cover { | ||
width: 100%; | ||
height: auto; | ||
border-radius: 8px; | ||
z-index: 1; | ||
|
||
} | ||
|
||
.icons { | ||
display: flex; | ||
justify-content: center; | ||
color: white; | ||
align-items: center; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
opacity: 0; | ||
|
||
transition: opacity 0.3s ease; | ||
z-index: 4; | ||
|
||
} | ||
|
||
.cover-container:hover .icons { | ||
opacity: 1; | ||
|
||
} | ||
|
||
.icon-small { | ||
width: 35px; | ||
height: 35px; | ||
align-self: center; | ||
filter: brightness(0) invert(1); | ||
|
||
padding: 10px; | ||
opacity: 50%; | ||
} | ||
|
||
.icon-big { | ||
width: 60px; | ||
height: 60px; | ||
align-self: center; | ||
padding: 10px; | ||
transition: transform 0.3s ease; | ||
filter: brightness(0) invert(1); | ||
|
||
opacity: 50%; | ||
} | ||
|
||
.icon-big:hover { | ||
transform: scale(1.2); | ||
opacity: 100%; | ||
|
||
} | ||
|
||
.icon-small:hover { | ||
opacity: 100%; | ||
|
||
} | ||
|
||
.overlay { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background-color: rgba(0, 0, 0, 0); | ||
z-index: 2; | ||
transition: background-color 0.3s ease; | ||
|
||
} | ||
|
||
.cover-container:hover .overlay { | ||
background-color: rgba(0, 0, 0, 0.5); | ||
z-index: 3; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from "react"; | ||
import './AlbumCover.css'; | ||
import dotsIcon from "../assets/icons/dots.svg"; | ||
import heartIcon from "../assets/icons/heart.svg"; | ||
import playIcon from "../assets/icons/play.svg"; | ||
|
||
|
||
export const AlbumCover = ({ imageUrl, alt }) => { | ||
return ( | ||
<div className="cover-container "> | ||
<img className="album-cover" src={imageUrl} alt={alt} /> | ||
<div className="overlay"></div> | ||
<div className="icons"> | ||
<img className="icon-small" src={heartIcon} alt="heart-icon" /> | ||
<img className="icon-big" src={playIcon} alt="play-icon" /> | ||
<img className="icon-small" src={dotsIcon} alt="dots-icon" /> | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.album-name { | ||
font-family: Helvetica, sans-serif; | ||
color: white; | ||
font-size: 14px; | ||
text-decoration: none; | ||
|
||
|
||
} | ||
|
||
.album-name:hover { | ||
text-decoration: underline; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from "react"; | ||
import './AlbumName.css'; | ||
|
||
export const AlbumName = ({ name, url }) => { | ||
return ( | ||
<a href={url} target="_blank" rel="noopener noreferrer" className="album-name"> | ||
{name} | ||
</a> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.App { | ||
display: grid; | ||
grid-template-columns: repeat(4, 1fr); | ||
gap: 20px; | ||
background-color: #000000; | ||
color: white; | ||
padding: 15px; | ||
text-align: left; | ||
|
||
|
||
} | ||
|
||
|
||
/* Mobile */ | ||
|
||
@media (max-width: 768px) { | ||
.App { | ||
grid-template-columns: repeat(1, 1fr); | ||
|
||
} | ||
} | ||
|
||
/* Ipads */ | ||
|
||
@media (max-width: 1024px) and (min-width: 767px) { | ||
.App { | ||
grid-template-columns: repeat(2, 1fr); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.artist-name { | ||
font-family: Helvetica, sans-serif; | ||
color: #a0a0a0; | ||
font-size: 14px; | ||
text-decoration: none; | ||
|
||
|
||
} | ||
|
||
.artist-name:hover { | ||
text-decoration: underline; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from "react"; | ||
import './ArtistName.css'; | ||
|
||
export const ArtistName = ({ artist, index, totalArtists }) => { | ||
let separator = ""; | ||
|
||
|
||
if (index < totalArtists - 1) { | ||
separator = " & "; | ||
} | ||
|
||
return ( | ||
<span> | ||
<a href={artist.external_urls.spotify} target="_blank" rel="noopener noreferrer" className="artist-name"> | ||
{artist.name} | ||
</a> | ||
{separator} | ||
</span> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.header { | ||
background-color: rgb(0, 0, 0); | ||
|
||
|
||
|
||
} | ||
|
||
h1 { | ||
margin: 0; | ||
padding: 20px; | ||
text-align: center; | ||
color: white; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from "react"; | ||
import './Header.css'; | ||
|
||
export const Header = () => { | ||
return ( | ||
<div className="header"> | ||
<h1>Music releases</h1> | ||
</div> | ||
); | ||
|
||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great reflections! ⭐