Jump to content

[Plugin] FolderView


Recommended Posts

Posted (edited)
9 hours ago, Free Man said:

It's not super clear to those of us who don't CSS all the time, but this works:

/* Desaturate docker container icons, saturate on hover */
/*
.folder-preview-wrapper img {
  filter: saturate(0);
}
*/
.folder-preview-wrapper:hover img {
  filter: saturate(1);
}

The saturate(false) needs to be disabled - the docs list both, as though both need to be commented out.
This is what I get for doing IT when I'm tired...

 

Thanks again!!

Hmmmm...yeah you should be able to comment out the whole block (both rules) and have it revert to default state (saturated). It may have just been your browser caching the desaturate CSS. CTRL+F5 will refresh and grab updated files and clear up stuff like that more often than not. But what you did will definitely work, it's just redundant. "Please fully saturate this fully-saturated icon." 😄 

 

Just FYI: The 0 is not really for false, it's more of a percentage. saturate(0) is 0%, saturate(1) is 100%. Using decimals between 0 and 1, you can get granular with it.

If you REALLY like color, you can super-saturate by going over 1. Like saturate(4) if you're feeling crazy. 😄 

 

Ant any rate, I'm glad you got it sorted!

Edited by Mattaton
  • Like 1
Link to comment
5 hours ago, Mattaton said:

ust FYI: The 0 is not really for false, it's more of a percentage. saturate(0) is 0%, saturate(1) is 100%. Using decimals between 0 and 1, you can get granular with it.

If you REALLY like color, you can super-saturate by going over 1. Like saturate(4) if you're feeling crazy.

 

i was using disabled (commented) this part from back then , but now enabled on hover saturate(2) , just wanted to ask from your  art experience its OK 200% saturate for on hover?

Link to comment
53 minutes ago, Masterwishx said:

 

i was using disabled (commented) this part from back then , but now enabled on hover saturate(2) , just wanted to ask from your  art experience its OK 200% saturate for on hover?

That really is a completely subjective thing. With something like this, it's all about what YOU want to see.

I think it's fine. Might even try it myself. 😄

  • Thanks 1
Link to comment

@Mattaton also added to make larger icon on hover , its look OK but its right command or better to use something else for it ?

 

.folder-preview-wrapper:hover img {
  filter: saturate(2); /* saturate 200% on hover, was (1) 100% */
  --container-logo-size: 35px; /* Make larger icon on hover, normal 32px */
}

 

Link to comment
Posted (edited)
4 hours ago, Masterwishx said:

@Mattaton also added to make larger icon on hover , its look OK but its right command or better to use something else for it ?

 

.folder-preview-wrapper:hover img {
  filter: saturate(2); /* saturate 200% on hover, was (1) 100% */
  --container-logo-size: 35px; /* Make larger icon on hover, normal 32px */
}

 

I suppose this would work. Redefining the variable's value in the selector.

What I would do to keep things organized is create a new variable alongside the --container-logo-size with the rest of variable definitions. Something like --container-logo-size-hover and then set the hover size you want there.

Then a width/height rule should be in the selector with its value set to the new variable.

 

I've updated the github code for the urblack-theme to add variables for icon hover size and both initial saturation and hover saturation.

 

Added this to the 02-vars.docker.css file:

--container-logo-size-hov: 38px;
--container-logo-saturation: 0; /* Initial color depth for container icons - 0 is fully-desaturated (grayscale), 1 is default saturation */
--container-logo-saturation-hov: 1; /* 1 is 100% or default color depth - Values above 1 will saturate beyond default colors, Example: 4 = 400% */

 

Changed the saturation rules at the top of 04-table.docker.css (not just for saturation anymore):

/*************************************************/
/* CONTAINER LOGO ICON HOVER EFFECTS */
/*************************************************/
.folder-preview-wrapper img {
  /* Desaturate docker container icons */
  filter: saturate(var(--container-logo-saturation));
}
.folder-preview-wrapper:hover img {
  /* Saturate docker container icons - Values above 1 will further saturate */
  filter: saturate(var(--container-logo-saturation-hov));
  /* Set the hover size for icons */
  width: var(--container-logo-size-hover);
  height: var(--container-logo-size-hover);
}

 

With these changes, icon saturation and size should now only be altered by changing the variable definitions in 02-vars.docker.css, and not the rules in 04-table.docker.css

This makes it easier for folks who don't want to or have the knowledge to dig into the CSS selectors and rules. Just change the variable values and it will take effect.

 

I'll update the other 2 color themes soon. But the changes above can easily be copied into the files you already have in place on your system.

 

P.S.: I don't know if it's just me, but the CSS color scheme for code here on the unRAID forums is horrible to read against the dark gray background of Dark Mode. The red comments especially are very hard to read.

Edited by Mattaton
  • Thanks 1
Link to comment
Posted (edited)
2 hours ago, Mattaton said:

This makes it easier for folks who don't want to or have the knowledge to dig into the CSS selectors and rules. Just change the variable values and it will take effect.

 

Size not working for me ...

Edited by Masterwishx
Link to comment
12 minutes ago, Masterwishx said:

 

Size not working for me ...

Had a typo and needed to add !important to overcome higher-specificity rule later in the code.

 

  width: var(--container-logo-size-hov) !important; /* important needed to overcome higher-specificity selector rule below */
  height: var(--container-logo-size-hov) !important; /* important needed to overcome higher-specificity selector rule below */

 

  • Like 1
Link to comment
6 minutes ago, Masterwishx said:

 

--container-logo-size: var(--container-logo-size-hov);

 working

I would not do it this way. It may work fine, but it also may have some unforeseen effects in changing the regular size variable to be the same value as the hover size. Better to use them separately, in my opinion.

  • Like 1
Link to comment
2 minutes ago, Mattaton said:
width: var(--container-logo-size-hov) !important; /* important needed to overcome higher-specificity selector rule below */
  height: var(--container-logo-size-hov) !important; /* important needed to overcome higher-specificity selector rule below */

 

5 minutes ago, Mattaton said:

Had a typo and needed to add !important to overcome higher-specificity rule later in the code.

 

OK , its working i saw typo but missed !important

Link to comment
2 minutes ago, Mattaton said:

Thanks! Let me know if you see anything else or think we should tweak anything. Once we get it all sorted I'll update the other themes to match.

 

its Already was Fine but now x2Fine ,

just curios if its OK when hover and image bigger in my case from 32px to 35px also have right part from this container moving right , is it OK or not ?

Link to comment
1 minute ago, Masterwishx said:

 

its Already was Fine but now x2Fine ,

just curios if its OK when hover and image bigger in my case from 32px to 35px also have right part from this container moving right , is it OK or not ?

Yeah, that's just a side-effect of the image growing. The image is taking more horizontal space, so everything to the right has to shift as it changes. 

That's the main reason I don't use the size change on hover. Just too much movement and shifting as the cursor moves around the screen.
To stop that from happening would take a lot more CSS rules and possibly even changes to the html.

  • Thanks 1
Link to comment
37 minutes ago, Mattaton said:

Yeah, that's just a side-effect of the image growing. The image is taking more horizontal space, so everything to the right has to shift as it changes. 

 

it seems this is working :  

 

folder-preview-wrapper img {
  /* Desaturate docker container icons */
  filter: saturate(var(--container-logo-saturation));
  /* Add a transition for smooth scaling */
  transition: transform 0.3s ease;
}
.folder-preview-wrapper:hover img {
  /* Saturate docker container icons - Values above 1 will further saturate */
  filter: saturate(var(--container-logo-saturation-hov));
  /* Set the hover size for icons */  
  width: var(--container-logo-size-hov) !important; /* important needed to overcome higher-specificity selector rule below */
  height: var(--container-logo-size-hov) !important; /* important needed to overcome higher-specificity selector rule below */
   /* Scale the image on hover */
  transform: scale(1.2); /* Adjust the scale factor as needed */
}

 

  • Like 1
Link to comment
1 minute ago, Masterwishx said:

 

it seems this is working :  

 

folder-preview-wrapper img {
  /* Desaturate docker container icons */
  filter: saturate(var(--container-logo-saturation));
  /* Add a transition for smooth scaling */
  transition: transform 0.3s ease;
}
.folder-preview-wrapper:hover img {
  /* Saturate docker container icons - Values above 1 will further saturate */
  filter: saturate(var(--container-logo-saturation-hov));
  /* Set the hover size for icons */  
  width: var(--container-logo-size-hov) !important; /* important needed to overcome higher-specificity selector rule below */
  height: var(--container-logo-size-hov) !important; /* important needed to overcome higher-specificity selector rule below */
   /* Scale the image on hover */
  transform: scale(1.2); /* Adjust the scale factor as needed */
}

 

Cool. Yeah, with the transform/transition approach, you can probably just ditch the width/height rules.
Then you can just make the value for --container-logo-size-hov be 1.2 and assign that to your scale function in the transform rule instead of setting the scale in the rule itself.

Not a bad way to tackle that! Nice job!

  • Like 1
Link to comment
Just now, Mattaton said:

Cool. Yeah, with the transform/transition approach, you can probably just ditch the width/height rules.
Then you can just make the value for --container-logo-size-hov be 1.2 and assign that to your scale function in the transform rule instead of setting the scale in the rule itself.

Not a bad way to tackle that! Nice job!

 

Thanks to Copilot Win

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...