-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app)!: v2.0.0 - New implementation after Spotify update
- Loading branch information
Showing
18 changed files
with
84 additions
and
132 deletions.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,11 +1,11 @@ | ||
{ | ||
"name": "LuckyLP", | ||
"description": "Spicetify extension to add 'Get Random Saved Album' in user's Album Collection", | ||
"preview": "screenshots/Screenshot_2.png", | ||
"description": "Spicetify extension to add 'Get Random Saved Album' in user's Home Page", | ||
"preview": "screenshots/Extension_prev.png", | ||
"main": "LuckyLP.js", | ||
"readme": "README.md", | ||
"authors": [ | ||
{ "name": "Akasiek", "url": "https://github.com/Akasiek" } | ||
], | ||
"tags": ["album collection"] | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 { isAlbumPage, isHomePage } from "./util"; | ||
import { addButton, removeButton } from "./button"; | ||
|
||
const toggleButton = () => { | ||
if (isHomePage() || isAlbumPage()) { | ||
addButton(); | ||
} else { | ||
removeButton(); | ||
} | ||
}; | ||
|
||
async function main() { | ||
while (!Spicetify?.showNotification && !Spicetify?.Platform) { | ||
await new Promise((resolve) => setTimeout(resolve, 500)); | ||
} | ||
|
||
// Show button on app load | ||
toggleButton(); | ||
|
||
// Show button depending on navigation | ||
Spicetify.Platform.History.listen(() => { | ||
toggleButton(); | ||
}); | ||
} | ||
|
||
export default main; |
This file was deleted.
Oops, something went wrong.
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,28 @@ | ||
import ShuffleIcon from "./shuffleIcon"; | ||
import { handleClick } from "./util"; | ||
|
||
const renderButton = () => { | ||
const randomBtn = new Spicetify.Topbar.Button( | ||
"Get Random Saved Album", | ||
`<svg role="img" height="16" width="16" viewBox="0 0 16 16" fill="currentColor">${ShuffleIcon}</svg>`, | ||
handleClick | ||
); | ||
|
||
randomBtn.element.id = "random-saved-album-btn"; | ||
}; | ||
|
||
export const addButton = () => { | ||
const btn = document.getElementById("random-saved-album-btn"); | ||
|
||
if (!btn) { | ||
renderButton(); | ||
} | ||
}; | ||
|
||
export const removeButton = () => { | ||
const btn = document.getElementById("random-saved-album-btn"); | ||
|
||
if (btn) { | ||
btn.remove(); | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,5 @@ | ||
const ShuffleIcon = () => | ||
`<path d="M13.151.922a.75.75 0 1 0-1.06 1.06L13.109 3H11.16a3.75 3.75 0 0 0-2.873 1.34l-6.173 7.356A2.25 2.25 0 0 1 .39 12.5H0V14h.391a3.75 3.75 0 0 0 2.873-1.34l6.173-7.356a2.25 2.25 0 0 1 1.724-.804h1.947l-1.017 1.018a.75.75 0 0 0 1.06 1.06L15.98 3.75 13.15.922zM.391 3.5H0V2h.391c1.109 0 2.16.49 2.873 1.34L4.89 5.277l-.979 1.167-1.796-2.14A2.25 2.25 0 0 0 .39 3.5z"></path> | ||
<path d="m7.5 10.723.98-1.167.957 1.14a2.25 2.25 0 0 0 1.724.804h1.947l-1.017-1.018a.75.75 0 1 1 1.06-1.06l2.829 2.828-2.829 2.828a.75.75 0 1 1-1.06-1.06L13.109 13H11.16a3.75 3.75 0 0 1-2.873-1.34l-.787-.938z"></path>`; | ||
|
||
export default ShuffleIcon; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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