From 346427381aefbaf69654c68f152ea19fdc685666 Mon Sep 17 00:00:00 2001 From: Julien Maille Date: Wed, 21 Apr 2021 21:37:14 +0200 Subject: [PATCH] IMP: color transitions for DribbblishDynamic, glass effect on menu and tooltips NEW: option to darken main color, gradient background --- DribbblishDynamic/dribbblish-dynamic.js | 5 +-- DribbblishDynamic/user.css | 49 +++++++++++++++++++------ 2 files changed, 39 insertions(+), 15 deletions(-) diff --git a/DribbblishDynamic/dribbblish-dynamic.js b/DribbblishDynamic/dribbblish-dynamic.js index 08c3713..3d959da 100644 --- a/DribbblishDynamic/dribbblish-dynamic.js +++ b/DribbblishDynamic/dribbblish-dynamic.js @@ -224,6 +224,7 @@ let nearArtistSpan = null let mainColor = getComputedStyle(document.documentElement).getPropertyValue('--modspotify_main_fg') let mainColor2 = getComputedStyle(document.documentElement).getPropertyValue('--modspotify_main_bg') let isLightBg = isLight(mainColor2) +let customDarken = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--custom_darken')) waitForElement([".artist"], (queries) => { nearArtistSpan = document.createElement("span"); @@ -233,8 +234,7 @@ waitForElement([".artist"], (queries) => { function updateColors(root) { if( root===null) return; - let colHex = mainColor - if( isLightBg ) colHex = LightenDarkenColor(colHex, -5) // vibrant color is always too bright for white bg mode + let colHex = LightenDarkenColor(mainColor, customDarken) let colRGB = hexToRgb(colHex) let darkerColHex = LightenDarkenColor(colHex, isLightBg ? 45 : -40) let darkerColRGB = hexToRgb(darkerColHex) @@ -281,7 +281,6 @@ function updateColorsAllIframes() { // code below works but then generate many errors on page change. let frames = document.getElementsByTagName("iframe"); for (i=0; i