Skip to content
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

Homepage Requirement Completed #128

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
<link rel="icon" type="image/svg+xml" href="/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Spring</title>
<link rel="stylesheet" href="Style.css">
</head>
<body>

<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
Expand Down
41 changes: 40 additions & 1 deletion frontend/package-lock.json

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

5 changes: 3 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
"he": "^1.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-h5-audio-player": "^3.9.1",
"react-h5-audio-player": "^3.9.homepage,
"react-router-dom": "^6.23.1",
"react-icons": "^5.2.1",
"swiper": "^11.1.3"
"swiper": "^11.
},
"devDependencies": {
"@types/react": "^18.2.66",
Expand Down
Binary file added frontend/public/download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 48 additions & 1 deletion frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import "swiper/css/navigation";
// import required modules
import { Pagination, Navigation } from "swiper/modules";


const App = () => {
const [data, setData] = useState(null);
const [searchQuery, setSearchQuery] = useState("");
Expand Down Expand Up @@ -76,7 +77,53 @@ const App = () => {
const selectedMusic = globalData[currplaying];
updateAudio(selectedMusic);
};

return (

<div className="ui">
<div className="player">
<div className="imgBx">
{data && data.length > 0 ? (
<img
src={data && data[currplaying].img}
height="250px"
width="250px"
/>
) : (
"Choose a song to play"
)}
</div>
<ul className="details">
<li className="name">
{data &&
data.length > 0 &&
data[currplaying] &&
decodeEntities(data[currplaying].name)}
</li>
<li className="author">
{data &&
data.length > 0 &&
data[currplaying] &&
decodeEntities(data[currplaying].artist)}{" "}
{data &&
data.length > 0 &&
data[currplaying] &&
data[currplaying].year}
</li>
</ul>
{data && (
<AudioPlayer
className="rounded-lg py-5 px-8"
autoPlay
src={data[currplaying].url}
preload="metadata"
id="audio"
showSkipControls
onClickNext={nextPlay}
onClickPrevious={previousPlay}
onEnded={nextPlay}
onError={(error) => {
console.log("Error :", error);
}}
const playSong = (index) => {
setCurrplaying(index);
};
Expand Down
29 changes: 29 additions & 0 deletions frontend/src/HomePage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

import React from 'react';
import './Style.css';
import { NavLink } from 'react-router-dom';

const HomePage = () => {

const handleClick = () => {
window.open('/app', '_blank');
};

return (
<>
<header className="navbar sticky z-50 top-0">
<NavLink to="/">Home</NavLink>
<NavLink to="/about">About Us</NavLink>
<NavLink to="/faq">FAQs</NavLink>
<NavLink to="">Log In</NavLink>
</header>
<div className="main">
<h1 id="heading">Let the rhythm of the music move your soul</h1>
</div>
<button id="btn" onClick={handleClick}>Get Started</button>
</>

);
};

export default HomePage;
54 changes: 54 additions & 0 deletions frontend/src/Style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
body{
background-color: black;
background-image: url("/download.png");
background-repeat: no-repeat;
background-size: 100%;
}

.main{
display: flex;
justify-content: space-between;
padding-top: 50px;
}

#heading{
color: white;
margin-left: 70%;
font-size: xx-large;
font-weight: 700;
line-height: 1.4;
}

#btn{
margin-left: 70%;
margin-top: 30px;
background-color: palevioletred;
padding: 12px;
border-radius: 30px;
font-weight: 500;
text-align: center;
}
#btn:hover{
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);

}


.navbar{
position: fixed;
top: 0;
width: 75%;
text-align: center;
z-index: 1000;
display: flex;
justify-content: space-between;
padding: 20px 0;
}

.navbar a{
color: rgba(255,255,255,0.5);
}

.navbar a:hover{
color: white;
}
9 changes: 9 additions & 0 deletions frontend/src/components/About/About.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react";

function About () {
return (
<div>About Us</div>
)
}

export default About;
9 changes: 9 additions & 0 deletions frontend/src/components/FAQ/FAQ.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react";

function FAQ () {
return(
<div>FAQS</div>
)
}

export default FAQ;
19 changes: 18 additions & 1 deletion frontend/src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,26 @@ import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.jsx'
import './index.css'
import HomePage from './HomePage.jsx'
import About from './components/About/About.jsx'
import FAQ from './components/FAQ/FAQ.jsx'
import { Route, Routes, RouterProvider, createBrowserRouter, createRoutesFromElements, createRoutesFromChildren } from 'react-router-dom'


const router = createBrowserRouter(
createRoutesFromChildren(
<>
<Route path='/' element={<HomePage/>}/>
<Route path='about' element={<About/>}/>
<Route path="faq" element={<FAQ />} />
<Route path="app" element={<App />} />

</>
)
)

ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<App />
<RouterProvider router={router} />
</React.StrictMode>,
)