forked from GitHub/dbot
increment size with image count
This commit adds functionality to the loading callout in the imgur module. The size of the font used in the loading callout now increases in a linear fashion in proportion to the number of images viewed in a row. The size starts at 12px, and will increase to 72px at image 2000, with round figures at most "standard" font sizes. This is largely an experiment to see what it looks like: it might not be as nice looking now that the callout contains extra information (such as the view count). It may be worth experimenting with just increasing the count number and leaving the "a w with x views (y*z)" message at a static size, or perhaps by editing the colour variant, or even the position on the screen. I really just wanted some feedback to make it a bit more interesting for a heavy user that has reached high numbers of images. Some figures: * 12px is reached after 0 images * 14px is reached after 66 images * 16px is reached after 133 images * 18px is reached after 200 images * 21px is reached after 300 images * 24px is reached after 400 images * 36px is reached after 800 images * 48px is reached after 1,200 images * 60px is reached after 1,600 images * 72px is reached after 2,000 images * 144px is reached after 4,400 images.
This commit is contained in:
parent
3b5ef9f55e
commit
1a2595aaf2
@ -14,6 +14,7 @@
|
||||
border-top-right-radius:5px;
|
||||
color:#85bf25;
|
||||
font-family:sans-serif;
|
||||
font-size:12px;
|
||||
font-weight:700;
|
||||
left:0;
|
||||
padding:20px;
|
||||
|
@ -10,6 +10,7 @@ html(lang='en')
|
||||
function getNewImage() {
|
||||
count += 1;
|
||||
$('#loading').text('Loading image ' + count + '...');
|
||||
$('#loading').css('font-size', ((count * 0.03) + 12));
|
||||
$('#image').load(function(){});
|
||||
$.get("/api/imgur/getRandomImage", function(d) {
|
||||
$('#image').attr('src', d.data[0]);
|
||||
|
Loading…
Reference in New Issue
Block a user