Login | Register


All times are UTC - 7 hours


It is currently 2018-Nov-18 12:19 pm




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Can we constrain hovercard sizes?
AgePosted: 2018-Oct-17 3:15 am 
User avatar

Joined: 2016-Nov-27 2:39 pm
Age: Dragon
Many images on deckbox now have very large image sizes (not necessary high resolution).

The hovercard feature does not try to limit the size so it just presents whatever image it's given.

See for example: Mountain

Can the javascript be updated to limit the size to something like 223px width? (That's the exact width of most of the not-absolutely-huge card images on Deckbox.)

As far as I can tell, it just requires taking this bit around column 4455 in the minified JS:

Code:
var d=document.createElement("img");d.src=e.href+"/tooltip";
                                   ^


and adding this just after the indicated semicolon:

Code:
d.style.width="223px";


to make it say this instead this:

Code:
var d=document.createElement("img");d.style.width="223px";d.src=e.href+"/tooltip";
                                    ++++++++++++++++++++++


Or add the equivalent in the unminified source.

This maintains the cards at a consistent exact width. Since the height is unset the browser will maintain the image's aspect ratio so just shrink the card down to this nice size.


Top
 Offline Profile  
 
 Post subject: Re: Can we constrain hovercard sizes?
AgePosted: 2018-Oct-17 7:27 am 
User avatar

Joined: 2006-Dec-31 12:26 pm
Age: Elder Dragon
I love that you have the problem, and then provide a very detailed manner in how to fix the issue :)

I'll also second this. Would certainly be a nice update :)


Top
 Offline Profile  
 
 Post subject: Re: Can we constrain hovercard sizes?
AgePosted: 2018-Oct-17 7:07 pm 
User avatar

Joined: 2008-Dec-26 7:50 am
Age: Elder Dragon
Location: Amsterdam, Holland
That is indeed a pretty great post. Well done!


Top
 Offline Profile  
 
 Post subject: Re: Can we constrain hovercard sizes?
AgePosted: 2018-Oct-18 1:30 am 
User avatar

Joined: 2006-Dec-31 12:26 pm
Age: Elder Dragon
Alternately - for anyone browsing with the Chrome browser on a desktop, you can install the 'reStyle' extension, and write some custom CSS for this site.

Quote:
.deckbox_i_tooltip img {
max-width: 223px
}


That 'fixes' it for me. I mean, it's a band-aid solution, but it does keep that mountain to an appropriate size.

Chrome Web Store link for reStyle (I used to use "Stylish" but that seems to be breaking some of google's new rules -- and this reStyle seems to be doing the same thing with the same interface...)


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to: