-
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
project-9-music-releases #102
base: main
Are you sure you want to change the base?
Changes from 9 commits
5126310
53edf9d
7262521
206289c
e07a224
a9c3349
ca740ac
0842fd7
bf2960f
69fad58
90e3ae9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
import data from "./data.json"; | ||
import Header from "./components/Header.jsx"; | ||
import MusicGallery from "./components/MusicGallery.jsx"; | ||
import Footer from "./components/Footer.jsx" | ||
|
||
console.log(data); | ||
|
||
export const App = () => { | ||
return <div>Find me in src/app.jsx!</div>; | ||
return ( | ||
<> | ||
<Header /> | ||
<MusicGallery /> | ||
<Footer /> | ||
</> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.footer-music { | ||
color: #fff; | ||
font-size: 16px; | ||
font-family: Arial, Helvetica, sans-serif; | ||
padding: 40px 30px; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import "./Footer.css" | ||
|
||
|
||
const Footer = () => { | ||
return ( | ||
<div className="footer-music"> | ||
<p>Made by: Erika Olsson</p> | ||
<p>Technigo / Web Development Boot Camp</p> | ||
</div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remember to use semantic elements even though we're working in React ( is better than a)
|
||
); | ||
}; | ||
|
||
export default Footer |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.header-container { | ||
border-radius: 8px; /* Rounded corners */ | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
.header { | ||
color: #FFFFFF; /* White text */ | ||
text-transform: uppercase; | ||
font-size: 4rem; | ||
font-weight: 700; | ||
width: 300px; | ||
height: auto; | ||
border-bottom: #FFF solid 3px; | ||
border-top: #FFF solid 3px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for the color, either stick to #FFF or #FFFFFF for consistency |
||
padding: 20px 35px; /* Padding around the text */ | ||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); /* Shadow effect */ | ||
margin: 40px 10px; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from "react"; | ||
import "./Header.css" | ||
|
||
|
||
const Header = () => { | ||
return ( | ||
<header class="header-container"> | ||
<div class="header"> | ||
New Music Releases | ||
</div> | ||
</header> | ||
); | ||
}; | ||
|
||
export default Header |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
|
||
/* Container for the album grid */ | ||
.album-grid-container { | ||
display: grid; | ||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); | ||
gap: 20px; /* Space between grid items */ | ||
padding: 20px; | ||
background-color: #333; | ||
} | ||
|
||
/* Individual album card styling */ | ||
.album-card { | ||
border-radius: 8px; | ||
overflow: hidden; | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); | ||
transition: transform 0.3s; | ||
position: relative; | ||
} | ||
|
||
/* .album-card:hover { | ||
transform: scale(1.05); | ||
} */ | ||
|
||
/* Styling for the album image */ | ||
.album-image { | ||
width: 100%; | ||
height: 350px; | ||
object-fit: cover; | ||
transition: filter 0.3s ease; /* Smooth transition effect for the image darkening */ | ||
} | ||
|
||
.album-cover-hover:hover .album-image { | ||
filter: brightness(50%); /* Darkens the image when hovered */ | ||
cursor: pointer; | ||
} | ||
|
||
/* Album name styling */ | ||
.album-name { | ||
font-size: 14px; | ||
font-weight: 600; | ||
margin: 7px 0 3px; | ||
color: #fff; | ||
text-transform: capitalize; | ||
font-family: Arial, Helvetica, sans-serif; | ||
cursor: pointer; | ||
text-decoration: none; | ||
} | ||
.album-name:hover { | ||
border-bottom: 2px solid #fff; | ||
} | ||
|
||
/* Album artist styling */ | ||
.album-name-container { | ||
margin: 5px 0 3px; | ||
} | ||
.album-artist { | ||
font-size: 14px; | ||
color: #a0a0a0; | ||
margin: 0 0 15px 0; | ||
padding: 0; | ||
font-family: Arial, Helvetica, sans-serif; | ||
} | ||
.album-artist a { | ||
text-decoration: none; | ||
color: #a0a0a0; | ||
} | ||
.album-artist a:hover { | ||
color: #fff; | ||
border-bottom: 2px solid #fff; | ||
} | ||
.album-cover-icons { | ||
position: absolute; | ||
top: 40%; /* Adjust this value to control how far from the top the icons are */ | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
display: flex; | ||
gap: 10px; /* Adjust the space between the icons */ | ||
justify-content: space-around; | ||
align-items: center; | ||
opacity: 0; /* Hide the icons by default */ | ||
transition: opacity 0.3s ease; /* Smooth transition when showing/hiding */ | ||
} | ||
|
||
.album-cover-hover:hover .album-cover-icons { | ||
opacity: 1; /* Show the icons when hovering over the image */ | ||
} | ||
.album-cover-icons img { | ||
cursor: pointer; | ||
filter: invert(1); | ||
} | ||
|
||
.play-icon:hover { | ||
width: 80px; | ||
height: auto; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import data from '../data.json'; | ||
import './MusicGallery.css'; | ||
import dotsIcon from '../assets/icons/dots.svg' | ||
import heartIcon from '../assets/icons/heart.svg' | ||
import playIcon from '../assets/icons/play.svg' | ||
|
||
|
||
console.log(data); | ||
|
||
const MusicGallery = () => { | ||
|
||
/* const [albums, setAlbums] = useState([]); | ||
|
||
// Load the data directly from the imported JSON file | ||
useEffect(() => { | ||
setAlbums(data); // Directly use the imported data | ||
}, []); */ | ||
Comment on lines
+13
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove unused code or add comments to why you are keeping it. |
||
|
||
return ( | ||
<> | ||
<div className="album-grid-container"> | ||
{ data.albums.items.map((album) => ( | ||
<div key={album} className="album-card"> | ||
<div className="album-cover-hover"> | ||
<img src={album.images?.[0]?.url} alt={album.name} className="album-image" /> | ||
<div className="album-cover-icons"> | ||
<img src={heartIcon} width="30" alt="Icon - Like album" /> | ||
<img src={playIcon} className="play-icon" width="60" alt="Icon - Play album" /> | ||
<img src={dotsIcon} width="30" alt="Icon - Other" /> | ||
</div> | ||
</div> | ||
<p className="album-name-container"> | ||
<a className="album-name" href={album.external_urls.spotify} target='_blank'>{album.name}</a> | ||
</p> | ||
<div> | ||
<p className="album-artist">{album.artists.map((artist) => | ||
<a href={artist.external_urls.spotify} target='_blank'>{artist.name}</a> | ||
)} | ||
</p> | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default MusicGallery |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ ReactDOM.createRoot(document.getElementById("root")).render( | |
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode> | ||
); | ||
); |
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.
Good reflection. It will get clearer and clearer for each time! Also with a bigger project it will feel more "logical" to split it up more.