Comments (7)
I just like music very much, I want to div my own player, I want to make it look good,thank you.
from spicetify-galaxy.
Can you explain specifically what you want to do without mentioning the code, then I can help you. Do you want to change the background image? If yes, what exactly do you want to change it to?
from spicetify-galaxy.
I just want to add createElement("div") to the image container, not to the body background, sorry, I fell asleep, the time zone is different
from spicetify-galaxy.
If you only want it to happen for those specific pages, then you need to run your created function on page change when the page type is any of those three. You can do this by adding your function to this part of the galaxy.js file like so:
switch (type) {
case "playlist":
getPlaylistImage(uid);
myFunction()
break;
case "album":
fetchAlbumImage(uid);
myFunction()
break;
case "artist":
fetchArtistImage(uid);
myFunction()
break;
Then in your function you need to wait for the .main-entityHeader-image
by using the waitForElement()
function that is in the code already. You can see how it is used in the code.
Then inside the callback function of that you can create your image element and set the source of it to the .src
of the .main-entityHeader-image
that you have waited for.
Can you understand this?
from spicetify-galaxy.
-
I don't know how to write "myFunction()" to make it work.
- If I put
waitForElement([".main-entityHeader-image"], ([image2]) =>
Outside ofmyFunction()
, - it will only work on Reload, and switch pages doesn't work.
- If I put
-
I don't know how to set source image src for .main-entityHeader-image.
- If I put
const bgImage = bgs.children[0].children[0];
in a function, function setBg(imagedata) { bgImage.src = image data;}
will be wrong.
- If I put
I donβt seem to understand the basics of js.
I understand js code in order to modify this js. But js is so difficult.
Can you edit myFunction() for me? thank you very much.
from spicetify-galaxy.
this is the function:
const myfunction = () => {
setTimeout(() => {
waitForElement([`.main-entityHeader-image`], ([headerImage]) => {
const shadowImage = headerImage.cloneNode(true);
shadowImage.classList.add("shadow-image");
headerImage.parentElement.append(shadowImage);
});
}, 50);
};
then this is the call:
if (!config.useHomeEverywhere) {
switch (type) {
case "playlist":
getPlaylistImage(uid);
myfunction();
break;
case "album":
fetchAlbumImage(uid);
myfunction();
break;
case "artist":
fetchArtistImage(uid);
myfunction();
break;
case "lyrics":
fetchCurrTrackAlbumImage();
}
I recommend you learn javascript if you want to do more, but you should be able to use css from here to get to your desired result. Using the .shadow-image
selector.
from spicetify-galaxy.
This function is fine, the method of clone is very good.
I will modify the css, you are amazing.
I have solved this problem, thank you for your patience and guidance.
from spicetify-galaxy.
Related Issues (20)
- [Feature Request] Spicetify Update Available Badge HOT 1
- Some of the title of the song covers the album cover HOT 2
- the artist and song name get cut out to the side HOT 2
- [Feature] Add option to disable background on lyrics page HOT 1
- Cover art HOT 2
- Powershell doesnt recognize theme HOT 3
- Background issue HOT 6
- bad optimization HOT 2
- Profile icon overshadowed HOT 1
- black background and no option to change the background HOT 6
- all backgrounds are black after spicetify update HOT 1
- Cant use the hover panels snippet HOT 3
- White text against green background turned into white text against white background - hard to read
- Theme broke on the new spotify update HOT 1
- newby here, not sure how to change colors HOT 2
- Remove Green Like Button Animation HOT 3
- Im so confused.. HOT 1
- Not able to add new wallpaper
- Doesn't work HOT 1
- No issues, absolutely great theme. Just some questions. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spicetify-galaxy.