Update app.js
Browse files
app.js
CHANGED
|
@@ -1,130 +1,150 @@
|
|
| 1 |
// ==UserScript==
|
| 2 |
// @name Spotify Dynamic UI/UX Animations
|
| 3 |
-
// @namespace
|
| 4 |
-
// @version 1.
|
| 5 |
-
// @description Enhances Spotify web player with stylish dynamic animations for a premium UI/UX experience
|
| 6 |
-
// @author UI/UX
|
| 7 |
// @match https://open.spotify.com/*
|
| 8 |
-
// @icon https://
|
| 9 |
// @grant GM_addStyle
|
|
|
|
|
|
|
| 10 |
// @run-at document-start
|
|
|
|
|
|
|
| 11 |
// ==/UserScript==
|
| 12 |
|
| 13 |
(function() {
|
| 14 |
'use strict';
|
| 15 |
|
| 16 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
GM_addStyle(`
|
| 18 |
/* Global smooth transitions */
|
| 19 |
-
|
| 20 |
-
transition: all 0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
}
|
| 22 |
|
| 23 |
/* Enhanced buttons with hover effects */
|
| 24 |
-
.Button-sc-1dqy6sn-0, .ButtonInner-sc-1dqy6sn-1 {
|
|
|
|
| 25 |
transform: scale(1) !important;
|
| 26 |
-
box-shadow:
|
| 27 |
-
|
| 28 |
}
|
| 29 |
|
| 30 |
-
.Button-sc-1dqy6sn-0:hover, .ButtonInner-sc-1dqy6sn-1:hover {
|
| 31 |
transform: scale(1.05) !important;
|
| 32 |
-
box-shadow:
|
| 33 |
filter: brightness(1.1) !important;
|
| 34 |
}
|
| 35 |
|
| 36 |
-
/* Floating
|
| 37 |
.Button-sc-1dqy6sn-0.Lsg1a0PdZMXQ3vQZlE0_M {
|
| 38 |
animation: pulse 2s infinite !important;
|
|
|
|
|
|
|
| 39 |
}
|
| 40 |
|
| 41 |
-
/* Card hover effects */
|
| 42 |
-
.Card-sc-1uyc430-0 {
|
|
|
|
| 43 |
transform: translateY(0) !important;
|
| 44 |
-
box-shadow:
|
| 45 |
-
|
| 46 |
}
|
| 47 |
|
| 48 |
-
.Card-sc-1uyc430-0:hover {
|
| 49 |
transform: translateY(-5px) !important;
|
| 50 |
-
box-shadow:
|
| 51 |
z-index: 100 !important;
|
| 52 |
}
|
| 53 |
|
| 54 |
-
/* Now playing bar animations */
|
| 55 |
-
.now-playing-bar {
|
| 56 |
-
transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
|
| 57 |
-
}
|
| 58 |
-
|
| 59 |
-
.now-playing-bar:hover {
|
| 60 |
-
transform: translateY(-3px) !important;
|
| 61 |
-
box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2) !important;
|
| 62 |
-
}
|
| 63 |
-
|
| 64 |
/* Album art hover effects */
|
| 65 |
-
.cover-art-image {
|
| 66 |
transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
|
| 67 |
box-shadow 0.4s ease !important;
|
| 68 |
transform-origin: center !important;
|
|
|
|
| 69 |
}
|
| 70 |
|
| 71 |
-
.cover-art-image:hover {
|
| 72 |
transform: scale(1.1) rotate(2deg) !important;
|
| 73 |
-
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
|
| 74 |
z-index: 1000 !important;
|
| 75 |
}
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
/* Text animations */
|
| 78 |
-
.Type__TypeElement-sc-goli3j-0 {
|
| 79 |
-
opacity: 0.9 !important;
|
| 80 |
-
transform: translateY(5px) !important;
|
| 81 |
transition: opacity 0.3s ease, transform 0.3s ease !important;
|
|
|
|
| 82 |
}
|
| 83 |
|
| 84 |
-
.Type__TypeElement-sc-goli3j-0:hover {
|
| 85 |
opacity: 1 !important;
|
| 86 |
transform: translateY(0) !important;
|
| 87 |
}
|
| 88 |
|
| 89 |
-
/*
|
| 90 |
-
.
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
}
|
| 95 |
|
| 96 |
-
.
|
| 97 |
-
transform:
|
| 98 |
-
box-shadow: 0
|
| 99 |
}
|
| 100 |
|
| 101 |
/* Menu animations */
|
| 102 |
-
.menu-container {
|
| 103 |
opacity: 0 !important;
|
| 104 |
transform: translateY(10px) !important;
|
| 105 |
transition: opacity 0.2s ease, transform 0.2s ease !important;
|
| 106 |
}
|
| 107 |
|
| 108 |
-
.menu-container.show {
|
| 109 |
opacity: 1 !important;
|
| 110 |
transform: translateY(0) !important;
|
| 111 |
}
|
| 112 |
|
| 113 |
-
/* Volume control slider */
|
| 114 |
-
.volume-bar__slider {
|
| 115 |
-
transition: transform 0.2s ease, box-shadow 0.2s ease !important;
|
| 116 |
-
}
|
| 117 |
-
|
| 118 |
-
.volume-bar__slider:hover {
|
| 119 |
-
transform: scale(1.2) !important;
|
| 120 |
-
box-shadow: 0 0 8px rgba(255, 255, 255, 0.7) !important;
|
| 121 |
-
}
|
| 122 |
-
|
| 123 |
/* Keyframes for animations */
|
| 124 |
@keyframes pulse {
|
| 125 |
-
0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(
|
| 126 |
-
70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(
|
| 127 |
-
100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(
|
| 128 |
}
|
| 129 |
|
| 130 |
@keyframes fadeInUp {
|
|
@@ -144,53 +164,72 @@
|
|
| 144 |
}
|
| 145 |
|
| 146 |
/* Loading animations */
|
| 147 |
-
.loading-shimmer {
|
| 148 |
background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 100%);
|
| 149 |
background-size: 1000px 100%;
|
| 150 |
animation: shimmer 2s infinite linear !important;
|
| 151 |
}
|
| 152 |
|
| 153 |
-
/*
|
| 154 |
-
.sidebar {
|
| 155 |
transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1) !important;
|
| 156 |
}
|
| 157 |
|
| 158 |
-
.sidebar:hover {
|
| 159 |
transform: translateX(5px) !important;
|
| 160 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
`);
|
| 162 |
|
| 163 |
// JavaScript animations and interactions
|
| 164 |
function enhanceAnimations() {
|
| 165 |
-
// Enhanced hover effects for cards
|
| 166 |
-
document.querySelectorAll('.Card-sc-1uyc430-0').forEach(card => {
|
| 167 |
card.addEventListener('mouseenter', () => {
|
| 168 |
card.style.zIndex = '100';
|
| 169 |
-
|
|
|
|
|
|
|
| 170 |
card.addEventListener('mouseleave', () => {
|
| 171 |
card.style.zIndex = '1';
|
| 172 |
-
});
|
| 173 |
});
|
| 174 |
|
| 175 |
// Dynamic album art effects
|
| 176 |
-
document.querySelectorAll('.cover-art-image').forEach(cover => {
|
| 177 |
cover.addEventListener('mouseenter', () => {
|
| 178 |
cover.style.zIndex = '1000';
|
| 179 |
-
|
|
|
|
|
|
|
| 180 |
cover.addEventListener('mouseleave', () => {
|
| 181 |
cover.style.zIndex = '1';
|
| 182 |
-
});
|
| 183 |
});
|
| 184 |
|
| 185 |
-
// Enhanced progress bar
|
| 186 |
-
const
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
const rect =
|
| 190 |
const percent = (e.clientX - rect.left) / rect.width;
|
| 191 |
animateProgressBar(percent);
|
| 192 |
-
});
|
| 193 |
-
}
|
| 194 |
|
| 195 |
// Animation for new elements added to DOM
|
| 196 |
const observer = new MutationObserver((mutations) => {
|
|
@@ -201,45 +240,109 @@
|
|
| 201 |
});
|
| 202 |
});
|
| 203 |
|
|
|
|
| 204 |
observer.observe(document.body, {
|
| 205 |
childList: true,
|
| 206 |
subtree: true
|
| 207 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
}
|
| 209 |
|
| 210 |
function animateProgressBar(percent) {
|
| 211 |
-
const
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
|
|
|
|
|
|
| 218 |
}
|
| 219 |
|
| 220 |
function applyEnterAnimations(nodes) {
|
| 221 |
Array.from(nodes).forEach(node => {
|
| 222 |
-
if (node.nodeType === 1
|
| 223 |
-
|
| 224 |
-
node.
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 230 |
}
|
| 231 |
});
|
| 232 |
}
|
| 233 |
|
| 234 |
// Initialize animations when DOM is ready
|
| 235 |
if (document.readyState === 'loading') {
|
| 236 |
-
document.addEventListener('DOMContentLoaded', enhanceAnimations);
|
| 237 |
} else {
|
| 238 |
enhanceAnimations();
|
| 239 |
}
|
| 240 |
|
| 241 |
// Periodic animation refresh for dynamic content
|
| 242 |
-
setInterval(
|
| 243 |
-
|
| 244 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 245 |
})();
|
|
|
|
| 1 |
// ==UserScript==
|
| 2 |
// @name Spotify Dynamic UI/UX Animations
|
| 3 |
+
// @namespace https://violentmonkey.github.io/
|
| 4 |
+
// @version 1.1
|
| 5 |
+
// @description Enhances Spotify web player with stylish dynamic animations and smooth transitions for a premium UI/UX experience
|
| 6 |
+
// @author UI/UX Enhancement Team
|
| 7 |
// @match https://open.spotify.com/*
|
| 8 |
+
// @icon https://open.spotify.com/favicon.ico
|
| 9 |
// @grant GM_addStyle
|
| 10 |
+
// @grant GM_setValue
|
| 11 |
+
// @grant GM_getValue
|
| 12 |
// @run-at document-start
|
| 13 |
+
// @updateURL https://github.com/user/spotify-ui-enhancer/raw/main/spotify-dynamic-ui.user.js
|
| 14 |
+
// @downloadURL https://github.com/user/spotify-ui-enhancer/raw/main/spotify-dynamic-ui.user.js
|
| 15 |
// ==/UserScript==
|
| 16 |
|
| 17 |
(function() {
|
| 18 |
'use strict';
|
| 19 |
|
| 20 |
+
// Check if we're on Spotify web player
|
| 21 |
+
if (!window.location.hostname.includes('spotify.com')) {
|
| 22 |
+
return;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
// Custom CSS animations and transitions optimized for Violentmonkey
|
| 26 |
GM_addStyle(`
|
| 27 |
/* Global smooth transitions */
|
| 28 |
+
:root {
|
| 29 |
+
--transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
| 30 |
+
--transition-normal: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
|
| 31 |
+
--transition-slow: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
|
| 32 |
+
--shadow-normal: 0 4px 12px rgba(0, 0, 0, 0.15);
|
| 33 |
+
--shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.25);
|
| 34 |
+
--shadow-glow: 0 0 15px rgba(0, 255, 150, 0.3);
|
| 35 |
}
|
| 36 |
|
| 37 |
/* Enhanced buttons with hover effects */
|
| 38 |
+
button, .Button-sc-1dqy6sn-0, .ButtonInner-sc-1dqy6sn-1 {
|
| 39 |
+
transition: var(--transition-normal) !important;
|
| 40 |
transform: scale(1) !important;
|
| 41 |
+
box-shadow: var(--shadow-normal) !important;
|
| 42 |
+
will-change: transform, box-shadow;
|
| 43 |
}
|
| 44 |
|
| 45 |
+
button:hover, .Button-sc-1dqy6sn-0:hover, .ButtonInner-sc-1dqy6sn-1:hover {
|
| 46 |
transform: scale(1.05) !important;
|
| 47 |
+
box-shadow: var(--shadow-hover) !important;
|
| 48 |
filter: brightness(1.1) !important;
|
| 49 |
}
|
| 50 |
|
| 51 |
+
/* Floating play button pulse animation */
|
| 52 |
.Button-sc-1dqy6sn-0.Lsg1a0PdZMXQ3vQZlE0_M {
|
| 53 |
animation: pulse 2s infinite !important;
|
| 54 |
+
position: relative !important;
|
| 55 |
+
z-index: 10 !important;
|
| 56 |
}
|
| 57 |
|
| 58 |
+
/* Card hover effects with lift animation */
|
| 59 |
+
.Card-sc-1uyc430-0, .main-card-card, .main-shelf-shelf {
|
| 60 |
+
transition: var(--transition-normal) !important;
|
| 61 |
transform: translateY(0) !important;
|
| 62 |
+
box-shadow: var(--shadow-normal) !important;
|
| 63 |
+
will-change: transform, box-shadow;
|
| 64 |
}
|
| 65 |
|
| 66 |
+
.Card-sc-1uyc430-0:hover, .main-card-card:hover, .main-shelf-shelf:hover {
|
| 67 |
transform: translateY(-5px) !important;
|
| 68 |
+
box-shadow: var(--shadow-hover) !important;
|
| 69 |
z-index: 100 !important;
|
| 70 |
}
|
| 71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
/* Album art hover effects */
|
| 73 |
+
.cover-art-image, .main-image-image {
|
| 74 |
transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
|
| 75 |
box-shadow 0.4s ease !important;
|
| 76 |
transform-origin: center !important;
|
| 77 |
+
will-change: transform, box-shadow;
|
| 78 |
}
|
| 79 |
|
| 80 |
+
.cover-art-image:hover, .main-image-image:hover {
|
| 81 |
transform: scale(1.1) rotate(2deg) !important;
|
| 82 |
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), var(--shadow-glow) !important;
|
| 83 |
z-index: 1000 !important;
|
| 84 |
}
|
| 85 |
|
| 86 |
+
/* Progress bar enhancements */
|
| 87 |
+
.progress-bar__slider, .playback-progressbar-slider {
|
| 88 |
+
transition: all 0.2s ease !important;
|
| 89 |
+
will-change: transform, box-shadow;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
.progress-bar__slider:hover, .playback-progressbar-slider:hover {
|
| 93 |
+
transform: scale(1.3) !important;
|
| 94 |
+
box-shadow: 0 0 0 3px rgba(0, 255, 150, 0.7) !important;
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
/* Volume control slider */
|
| 98 |
+
.volume-bar__slider, .playback-volumebar-slider {
|
| 99 |
+
transition: transform 0.2s ease, box-shadow 0.2s ease !important;
|
| 100 |
+
will-change: transform, box-shadow;
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
.volume-bar__slider:hover, .playback-volumebar-slider:hover {
|
| 104 |
+
transform: scale(1.2) !important;
|
| 105 |
+
box-shadow: 0 0 8px rgba(0, 255, 150, 0.7) !important;
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
/* Text animations */
|
| 109 |
+
.Type__TypeElement-sc-goli3j-0, .main-type-type {
|
|
|
|
|
|
|
| 110 |
transition: opacity 0.3s ease, transform 0.3s ease !important;
|
| 111 |
+
will-change: opacity, transform;
|
| 112 |
}
|
| 113 |
|
| 114 |
+
.Type__TypeElement-sc-goli3j-0:hover, .main-type-type:hover {
|
| 115 |
opacity: 1 !important;
|
| 116 |
transform: translateY(0) !important;
|
| 117 |
}
|
| 118 |
|
| 119 |
+
/* Now playing bar animations */
|
| 120 |
+
.now-playing-bar, .playback-bar {
|
| 121 |
+
transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55),
|
| 122 |
+
box-shadow 0.3s ease !important;
|
| 123 |
+
will-change: transform, box-shadow;
|
| 124 |
}
|
| 125 |
|
| 126 |
+
.now-playing-bar:hover, .playback-bar:hover {
|
| 127 |
+
transform: translateY(-3px) !important;
|
| 128 |
+
box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2) !important;
|
| 129 |
}
|
| 130 |
|
| 131 |
/* Menu animations */
|
| 132 |
+
.menu-container, .main-contextMenu-menu {
|
| 133 |
opacity: 0 !important;
|
| 134 |
transform: translateY(10px) !important;
|
| 135 |
transition: opacity 0.2s ease, transform 0.2s ease !important;
|
| 136 |
}
|
| 137 |
|
| 138 |
+
.menu-container.show, .main-contextMenu-menu.show {
|
| 139 |
opacity: 1 !important;
|
| 140 |
transform: translateY(0) !important;
|
| 141 |
}
|
| 142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
/* Keyframes for animations */
|
| 144 |
@keyframes pulse {
|
| 145 |
+
0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 255, 150, 0.4); }
|
| 146 |
+
70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(0, 255, 150, 0); }
|
| 147 |
+
100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 255, 150, 0); }
|
| 148 |
}
|
| 149 |
|
| 150 |
@keyframes fadeInUp {
|
|
|
|
| 164 |
}
|
| 165 |
|
| 166 |
/* Loading animations */
|
| 167 |
+
.loading-shimmer, .main-loading-loading {
|
| 168 |
background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 100%);
|
| 169 |
background-size: 1000px 100%;
|
| 170 |
animation: shimmer 2s infinite linear !important;
|
| 171 |
}
|
| 172 |
|
| 173 |
+
/* Sidebar transitions */
|
| 174 |
+
.sidebar, .main-buddyFeed-buddyFeed {
|
| 175 |
transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1) !important;
|
| 176 |
}
|
| 177 |
|
| 178 |
+
.sidebar:hover, .main-buddyFeed-buddyFeed:hover {
|
| 179 |
transform: translateX(5px) !important;
|
| 180 |
}
|
| 181 |
+
|
| 182 |
+
/* Enhanced input fields */
|
| 183 |
+
input, textarea, .main-inputInput {
|
| 184 |
+
transition: box-shadow 0.3s ease, transform 0.2s ease !important;
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
input:focus, textarea:focus, .main-inputInput:focus {
|
| 188 |
+
box-shadow: 0 0 0 3px rgba(0, 255, 150, 0.5) !important;
|
| 189 |
+
transform: scale(1.01) !important;
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
/* Performance optimization */
|
| 193 |
+
* {
|
| 194 |
+
will-change: auto !important;
|
| 195 |
+
}
|
| 196 |
`);
|
| 197 |
|
| 198 |
// JavaScript animations and interactions
|
| 199 |
function enhanceAnimations() {
|
| 200 |
+
// Enhanced hover effects for cards with proper cleanup
|
| 201 |
+
document.querySelectorAll('.Card-sc-1uyc430-0, .main-card-card, .main-shelf-shelf').forEach(card => {
|
| 202 |
card.addEventListener('mouseenter', () => {
|
| 203 |
card.style.zIndex = '100';
|
| 204 |
+
card.style.transition = 'all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1)';
|
| 205 |
+
}, { passive: true });
|
| 206 |
+
|
| 207 |
card.addEventListener('mouseleave', () => {
|
| 208 |
card.style.zIndex = '1';
|
| 209 |
+
}, { passive: true });
|
| 210 |
});
|
| 211 |
|
| 212 |
// Dynamic album art effects
|
| 213 |
+
document.querySelectorAll('.cover-art-image, .main-image-image').forEach(cover => {
|
| 214 |
cover.addEventListener('mouseenter', () => {
|
| 215 |
cover.style.zIndex = '1000';
|
| 216 |
+
cover.style.transition = 'transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease';
|
| 217 |
+
}, { passive: true });
|
| 218 |
+
|
| 219 |
cover.addEventListener('mouseleave', () => {
|
| 220 |
cover.style.zIndex = '1';
|
| 221 |
+
}, { passive: true });
|
| 222 |
});
|
| 223 |
|
| 224 |
+
// Enhanced progress bar interaction
|
| 225 |
+
const progressBars = document.querySelectorAll('.progress-bar, .playback-progressbar');
|
| 226 |
+
progressBars.forEach(bar => {
|
| 227 |
+
bar.addEventListener('click', (e) => {
|
| 228 |
+
const rect = bar.getBoundingClientRect();
|
| 229 |
const percent = (e.clientX - rect.left) / rect.width;
|
| 230 |
animateProgressBar(percent);
|
| 231 |
+
}, { passive: true });
|
| 232 |
+
});
|
| 233 |
|
| 234 |
// Animation for new elements added to DOM
|
| 235 |
const observer = new MutationObserver((mutations) => {
|
|
|
|
| 240 |
});
|
| 241 |
});
|
| 242 |
|
| 243 |
+
// Observe the entire document body for changes
|
| 244 |
observer.observe(document.body, {
|
| 245 |
childList: true,
|
| 246 |
subtree: true
|
| 247 |
});
|
| 248 |
+
|
| 249 |
+
// Cleanup function
|
| 250 |
+
window.addEventListener('beforeunload', () => {
|
| 251 |
+
observer.disconnect();
|
| 252 |
+
}, { passive: true });
|
| 253 |
}
|
| 254 |
|
| 255 |
function animateProgressBar(percent) {
|
| 256 |
+
const sliders = document.querySelectorAll('.progress-bar__slider, .playback-progressbar-slider');
|
| 257 |
+
sliders.forEach(slider => {
|
| 258 |
+
if (slider) {
|
| 259 |
+
slider.style.transform = 'scale(1.5)';
|
| 260 |
+
setTimeout(() => {
|
| 261 |
+
slider.style.transform = 'scale(1)';
|
| 262 |
+
}, 300);
|
| 263 |
+
}
|
| 264 |
+
});
|
| 265 |
}
|
| 266 |
|
| 267 |
function applyEnterAnimations(nodes) {
|
| 268 |
Array.from(nodes).forEach(node => {
|
| 269 |
+
if (node.nodeType === 1) {
|
| 270 |
+
// Check for card-like elements
|
| 271 |
+
const isCard = node.classList.contains('Card-sc-1uyc430-0') ||
|
| 272 |
+
node.classList.contains('main-card-card') ||
|
| 273 |
+
node.classList.contains('main-shelf-shelf');
|
| 274 |
+
|
| 275 |
+
if (isCard) {
|
| 276 |
+
node.style.animation = 'fadeInUp 0.4s ease forwards';
|
| 277 |
+
node.style.opacity = '0';
|
| 278 |
+
node.style.transform = 'translateY(20px)';
|
| 279 |
+
setTimeout(() => {
|
| 280 |
+
node.style.opacity = '1';
|
| 281 |
+
node.style.transform = 'translateY(0)';
|
| 282 |
+
}, 10);
|
| 283 |
+
}
|
| 284 |
}
|
| 285 |
});
|
| 286 |
}
|
| 287 |
|
| 288 |
// Initialize animations when DOM is ready
|
| 289 |
if (document.readyState === 'loading') {
|
| 290 |
+
document.addEventListener('DOMContentLoaded', enhanceAnimations, { passive: true });
|
| 291 |
} else {
|
| 292 |
enhanceAnimations();
|
| 293 |
}
|
| 294 |
|
| 295 |
// Periodic animation refresh for dynamic content
|
| 296 |
+
const animationInterval = setInterval(() => {
|
| 297 |
+
if (document.body) {
|
| 298 |
+
enhanceAnimations();
|
| 299 |
+
}
|
| 300 |
+
}, 2000);
|
| 301 |
+
|
| 302 |
+
// Cleanup on page unload
|
| 303 |
+
window.addEventListener('beforeunload', () => {
|
| 304 |
+
clearInterval(animationInterval);
|
| 305 |
+
}, { passive: true });
|
| 306 |
+
|
| 307 |
+
console.log('✅ Spotify Dynamic UI/UX Animations loaded successfully via Violentmonkey!');
|
| 308 |
+
|
| 309 |
+
// Optional: Add a small indicator that the script is active
|
| 310 |
+
setTimeout(() => {
|
| 311 |
+
if (document.querySelector('.now-playing-bar') || document.querySelector('.playback-bar')) {
|
| 312 |
+
const style = document.createElement('style');
|
| 313 |
+
style.textContent = `
|
| 314 |
+
.vm-spotify-indicator {
|
| 315 |
+
position: fixed;
|
| 316 |
+
bottom: 20px;
|
| 317 |
+
right: 20px;
|
| 318 |
+
background: rgba(0, 255, 150, 0.8);
|
| 319 |
+
color: black;
|
| 320 |
+
padding: 4px 8px;
|
| 321 |
+
border-radius: 12px;
|
| 322 |
+
font-size: 12px;
|
| 323 |
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
| 324 |
+
z-index: 9999;
|
| 325 |
+
animation: fadeIn 0.3s ease forwards;
|
| 326 |
+
}
|
| 327 |
+
@keyframes fadeIn {
|
| 328 |
+
from { opacity: 0; transform: scale(0.8); }
|
| 329 |
+
to { opacity: 1; transform: scale(1); }
|
| 330 |
+
}
|
| 331 |
+
`;
|
| 332 |
+
document.head.appendChild(style);
|
| 333 |
+
|
| 334 |
+
const indicator = document.createElement('div');
|
| 335 |
+
indicator.className = 'vm-spotify-indicator';
|
| 336 |
+
indicator.textContent = '✨ Enhanced UI Active';
|
| 337 |
+
document.body.appendChild(indicator);
|
| 338 |
+
|
| 339 |
+
setTimeout(() => {
|
| 340 |
+
indicator.style.animation = 'fadeOut 0.3s ease forwards';
|
| 341 |
+
setTimeout(() => {
|
| 342 |
+
indicator.remove();
|
| 343 |
+
document.head.removeChild(style);
|
| 344 |
+
}, 300);
|
| 345 |
+
}, 3000);
|
| 346 |
+
}
|
| 347 |
+
}, 1000);
|
| 348 |
})();
|