ElkArte Community

Elk Development => Feature Discussion => Topic started by: Saiyen on May 10, 2016, 10:00:36 am

Title: When changing rank icons to higher sizes than 16px allow resizing them.
Post by: Saiyen on May 10, 2016, 10:00:36 am
Hello I just came up with a nice idea.

How about if you change User rank images on {theme}/images/group_icons and if you upload a high resolution image then there is a option to resize it to 16px which is the default icon.png size, but in same time keeping the quality of the image.

At this moment if you edit image sizes in group_icons folder I guess that they will displayed bigger on forum posts and other sections too which completely destroys the theme and makes page bigger.
 In shorter: You can upload any size images, but you can select size that they are resized to when being displayed on forums yet they keep the quality of it in same time.

I am very sure that it is posibble to code it.

Thank you!
Title: Re: When changing rank icons to higher sizes than 16px allow resizing them.
Post by: emanuele on May 10, 2016, 02:42:44 pm
Hi Sayen and welcome to elkarte.net. :)

I don't remember all the places the icons are shown, but in general I would avoid a "setting" for such things, better either properly resize the image[1] or just use some css like:
Code: [Select]
#forumposts .icons img {
    width: 16px;
    height: 16px;
}
You can stuff that into a custom.css in your theme folder and be done with it.
The advantage is that if you want an icon 32x32 for desktops and a 16x16 for mobile, with css you can, with a setting you'd need yet another two (one for the size and one for the screen size for the toggling). ;)
This is a good thing because you save bandwidth as well.
Title: Re: When changing rank icons to higher sizes than 16px allow resizing them.
Post by: Saiyen on May 13, 2016, 07:06:47 am
Quote from: emanuele – Hi Sayen and welcome to ElkArte.net. :)

I don't remember all the places the icons are shown, but in general I would avoid a "setting" for such things, better either properly resize the image[1] or just use some css like:
Code: [Select]
#forumposts .icons img {
    width: 16px;
    height: 16px;
}
You can stuff that into a custom.css in your theme folder and be done with it.
The advantage is that if you want an icon 32x32 for desktops and a 16x16 for mobile, with css you can, with a setting you'd need yet another two (one for the size and one for the screen size for the toggling). ;)

I guess this is what I wanted. I wanted the images to keep same quality, however they are scaled down.

Which CSS code would I be required to use to do same for smileys?

Oh and probaly a noob question, but where do I put the CSS class? Which file?
This is a good thing because you save bandwidth as well.
Title: Re: When changing rank icons to higher sizes than 16px allow resizing them.
Post by: radu81 on May 13, 2016, 09:20:17 am
Quote from: Saiyen – Oh and probaly a noob question, but where do I put the CSS class? Which file?

You can use a custom css file in Ellkarte
Title: Re: When changing rank icons to higher sizes than 16px allow resizing them.
Post by: meetdilip on May 13, 2016, 09:52:35 am
In fact, you need to create custom_variant-name.css file in corresponding directory.
Title: Re: When changing rank icons to higher sizes than 16px allow resizing them.
Post by: emanuele on May 13, 2016, 01:10:48 pm
Actually, for that change that can affect all the variants, you can just create the file directly in the "css" directory, it's not necessary to create one per variant. ;)
Title: Re: When changing rank icons to higher sizes than 16px allow resizing them.
Post by: meetdilip on May 13, 2016, 01:30:08 pm
@emanuele , news to me. Thanks.