Skip to content

Commit

Permalink
Move every asset into the public folder
Browse files Browse the repository at this point in the history
  • Loading branch information
alimooo1 committed Apr 29, 2024
1 parent f3661b7 commit bc629f4
Show file tree
Hide file tree
Showing 36 changed files with 69 additions and 69 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Unlock your ultimate music experience at 'Just Play Music'! Hit play and immerse yourself in the best tunes ever. Discover curated playlists and endless entertainment. Just play music, effortlessly.">
<link rel="shortcut icon" href="/src/assets/icons/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="/assets/icons/favicon.ico" type="image/x-icon">
<link rel="manifest" href="./manifest.json">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
Expand All @@ -24,7 +24,7 @@

<body>
<video autoplay muted loop id="background-video"></video>
<audio src="src/assets/songs/01 Believer.mp3"></audio>
<audio src="/assets/songs/01 Believer.mp3"></audio>
<div class="preloader shown" style="display: none;">
<div class="preloader-inner">
<svg viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="100" height="100" style="shape-rendering: auto; display: block; background: rgb(255, 255, 255);"><g><path fill="none" stroke="rgb(45, 118, 187)" stroke-width="8" stroke-dasharray="42.76482137044271 42.76482137044271" d="M24.3 30C11.4 30 5 43.3 5 50s6.4 20 19.3 20c19.3 0 32.1-40 51.4-40 C88.6 30 95 43.3 95 50s-6.4 20-19.3 20C56.4 70 43.6 30 24.3 30z" stroke-linecap="round" style="transform:scale(0.8);transform-origin:50px 50px">
Expand All @@ -35,7 +35,7 @@
<div class="player-box" style="display: none;">
<div class="content">
<div class="cover">
<img width="300" height="300" src="src/assets/covers/believer.webp" alt="" />
<img width="300" height="300" src="/assets/covers/believer.webp" alt="" />
</div>
<div class="titles">
<div class="song-name">Believer</div>
Expand Down
16 changes: 8 additions & 8 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,43 @@
"lang": "en-US",
"icons": [
{
"src": "/src/assets/icons/logo48.png",
"src": "src/assets/icons/logo48.png",
"sizes": "48x48",
"type": "image/png"
},
{
"src": "/src/assets/icons/logo72.png",
"src": "src/assets/icons/logo72.png",
"sizes": "72x72",
"type": "image/png"
},
{
"src": "/src/assets/icons/logo96.png",
"src": "src/assets/icons/logo96.png",
"sizes": "96x96",
"type": "image/png"
},
{
"src": "/src/assets/icons/logo144.png",
"src": "src/assets/icons/logo144.png",
"sizes": "144x144",
"type": "image/png"
},
{
"src": "/src/assets/icons/logo168.png",
"src": "src/assets/icons/logo168.png",
"sizes": "168x168",
"type": "image/png"
},
{
"src": "/src/assets/icons/logo192.png",
"src": "src/assets/icons/logo192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/src/assets/icons/logo512.png",
"src": "src/assets/icons/logo512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"screenshots" : [{
"src": "/src/assets/screenshot.jpg",
"src": "src/assets/screenshot.jpg",
"sizes": "1280x580",
"type": "image/jpeg"
}]
Expand Down
50 changes: 50 additions & 0 deletions public/assets/Songs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[
{
"id": 0,
"name": "Believer",
"artist": "Imagine Dragons",
"cover": "/assets/covers/believer.webp",
"src": "/assets/songs/01 Believer.mp3",
"background": "/assets/backgrounds/believer.webm"
},
{
"id": 1,
"name": "Goodbyes",
"artist": "Post Malone",
"cover": "/assets/covers/goodbyes.webp",
"src": "/assets/songs/2_5323735572550780476.mp3",
"background": "/assets/backgrounds/goodbyes.webm"
},
{
"id": 2,
"name": "Paid My Dues",
"artist": "NF",
"cover": "/assets/covers/clouds.webp",
"src": "/assets/songs/10 PAID MY DUES.mp3",
"background": "/assets/backgrounds/clouds.webm"
},
{
"id": 3,
"name": "Blinding Lights",
"artist": "The Weeknd",
"cover": "/assets/covers/blindinglights.webp",
"src": "/assets/songs/The Weeknd - Blinding Lights.mp3",
"background": "/assets/backgrounds/blindinglights.webm"
},
{
"id": 4,
"name": "GraveYard",
"artist": "Halsey",
"cover": "/assets/covers/graveyard.webp",
"src": "/assets/songs/Halsey - Graveyard (2019) MELOVAZ.NET.mp3",
"background": "/assets/backgrounds/graveyard.webm"
},
{
"id": 5,
"name": "What I've Done",
"artist": "Linkin Park",
"cover": "/assets/covers/whativedone.webp",
"src": "/assets/songs/07 What I've Done.mp3",
"background": "/assets/backgrounds/whativedone.webm"
}
]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Components/GetSongs/GetSongs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface Song {
}

const getSongs = () => {
return axios.get("src/Songs.json").then((response) => {
return axios.get("/assets/Songs.json").then((response) => {
return response.data as Song[];
});
};
Expand Down
4 changes: 2 additions & 2 deletions src/Components/MusicPlayer/MusicPlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class MusicPlayer {
this.songs = await this._fetchSongs();
this._musicControls.initialize();

backgroundVideo.setAttribute("src", "src/assets/backgrounds/visualize.webm")
backgroundVideo.setAttribute("src", "/assets/backgrounds/visualize.webm")
timeline.addEventListener(
"click",
this._timeHandler.selectTime.bind(this._timeHandler)
Expand All @@ -74,7 +74,7 @@ function firstShowHandler() {

function animationHandler() {
playerBox.classList.add('opened-magical-square')
backgroundVideo.setAttribute('src', "src/assets/backgrounds/believer.webm");
backgroundVideo.setAttribute('src', "/assets/backgrounds/believer.webm");
}

export { MusicPlayer };
50 changes: 0 additions & 50 deletions src/Songs.json

This file was deleted.

10 changes: 5 additions & 5 deletions sw.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const CACHE_NAME = 'cache-assets-v1';
const CACHE_NAME = 'cache-assets-v3';
const songs = [
'believer', 'goodbyes', 'clouds', 'graveyard', 'blindinglights', 'whativedone'
]
const CACHED_ASSETS = ['/', '/index.html', '/src/Songs.json',
'/src/assets/backgrounds/visualize.webm',
const CACHED_ASSETS = ['/', '/index.html', '/assets/Songs.json',
'/assets/backgrounds/visualize.webm',
'https://fonts.gstatic.com/s/bebasneue/v14/JTUSjIg69CK48gW7PXoo9Wlhyw.woff2',
'https://fonts.gstatic.com/s/barlowcondensed/v12/HTxwL3I-JCGChYJ8VI-L6OO_au7B47rxz3bWuQ.woff2',
'https://fonts.gstatic.com/s/barlowcondensed/v12/HTx3L3I-JCGChYJ8VI-L6OO_au7B6xHT2g.woff2'];
Expand All @@ -14,8 +14,8 @@ self.addEventListener("install", (e) => {
.open(CACHE_NAME)
.then((cache) => {
songs.forEach(song => {
CACHED_ASSETS.push(`/src/assets/covers/${song}.webp`);
CACHED_ASSETS.push(`/src/assets/backgrounds/${song}.webm`);
CACHED_ASSETS.push(`/assets/covers/${song}.webp`);
CACHED_ASSETS.push(`/assets/backgrounds/${song}.webm`);
})
cache.addAll(CACHED_ASSETS);
})
Expand Down

0 comments on commit bc629f4

Please sign in to comment.