MCPcopy Create free account
hub / github.com/NMWplays/Glowify / installHomeScreenVisualizer

Function installHomeScreenVisualizer

theme.js:4837–4948  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4835 for (const slot of [prevSlot, currentSlot, nextSlot]) {
4836 slot.appendChild(Object.assign(document.createElement("div"), { className: "cs-face" }));
4837 }
4838 clip.append(prevSlot, currentSlot, nextSlot);
4839 track.appendChild(clip);
4840 container.appendChild(track);
4841 unclipAncestors(container);
4842 currentUrl2 = getCurrentCoverUrl();
4843 currentUri = getCurrentUri();
4844 prevUrl = getPrevCoverUrl();
4845 prevUri = getPrevUri();
4846 nextUrl = getNextCoverUrl();
4847 nextUri = getNextUri();
4848 setSlot(prevSlot, prevUrl);
4849 setSlot(currentSlot, currentUrl2);
4850 setSlot(nextSlot, nextUrl);
4851 canvasVisible = checkCanvasVisible();
4852 if (canvasVisible) {
4853 track.classList.add("cs-hidden");
4854 track.style.display = "none";
4855 container.style.position = origPosition;
4856 }
4857 canvasPoll = setInterval(updateCanvasState, 150);
4858 canvasObserver = new MutationObserver(() => updateCanvasState());
4859 canvasObserver.observe(container, { childList: true, subtree: true });
4860 const nextCard = document.querySelector("#glowify-next-song-card");
4861 if (nextCard) {
4862 nextObserver = new MutationObserver(() => {
4863 if (animating) return;
4864 refreshAdjacent();
4865 });
4866 nextObserver.observe(nextCard, {
4867 attributes: true,
4868 attributeFilter: ["src", "style"],
4869 subtree: true,
4870 childList: true
4871 });
4872 }
4873 };
4874 const unmount = () => {
4875 if (!track) return;
4876 if (canvasPoll) clearInterval(canvasPoll);
4877 canvasPoll = null;
4878 if (revealTimer) clearTimeout(revealTimer);
4879 revealTimer = null;
4880 nextObserver?.disconnect();
4881 nextObserver = null;
4882 canvasObserver?.disconnect();
4883 canvasObserver = null;
4884 track.remove();
4885 if (mountedContainer && document.body.contains(mountedContainer)) {
4886 mountedContainer.style.position = origPosition;
4887 }
4888 track = clip = prevSlot = currentSlot = nextSlot = null;
4889 mountedContainer = null;
4890 animating = false;
4891 canvasVisible = false;
4892 clearUnclipped();
4893 };
4894 const hideTrackForCanvas = () => {

Callers 1

Calls 2

animateFunction · 0.85

Tested by

no test coverage detected