From fd44735241aff9e5e7e921df879ce3b9c7b06d1d Mon Sep 17 00:00:00 2001 From: dragos-efy Date: Fri, 24 May 2024 13:57:00 +0300 Subject: [PATCH] Update Seek Bar Colors on Change Event, Fix: Transparent Colors Bug --- src/components/VideoPlayer.vue | 2 +- src/piped.js | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/components/VideoPlayer.vue b/src/components/VideoPlayer.vue index b2280ce9..12f8e23a 100644 --- a/src/components/VideoPlayer.vue +++ b/src/components/VideoPlayer.vue @@ -484,7 +484,7 @@ export default { seekBarColors: { base: "rgba(255, 255, 255, 0.3)", buffered: "rgba(255, 255, 255, 0.54)", - played: "var(--efy_piped_color1)", + played: "var(--efy_piped_color)", }, }; diff --git a/src/piped.js b/src/piped.js index c7b961aa..205ef284 100644 --- a/src/piped.js +++ b/src/piped.js @@ -48,11 +48,14 @@ $ready('#efy_sidebar', ()=>{ } // Get EFY Color Gradient in Piped - let efy_colors = efy.colors; - efy_colors.forEach((a,i)=>{ - let b = a.split(' '); b.shift(); b[3] = '/ ' + b[3]; - efy_colors[i] = `oklch(${b.join(' ')})`; - }); - $css_prop('--efy_piped_color1', String(efy_colors)); + const efy_piped_color =()=>{ let efy_colors = []; + efy.colors.forEach((a,i)=>{ + a = a.split(' ').slice(1); a[3] = `/ ${a[3]}`; + efy_colors[i] = `oklch(${a.join(' ')})`; + }); + $css_prop('--efy_piped_color', String(efy_colors)); + }; efy_piped_color(); + + $event($('#efy_gradient'), 'change', efy_piped_color); }, 1); \ No newline at end of file