Turbo-Charge your browser for fanart.tv

Content for the site and social networks, have any ideas? Let us know about it.
User avatar
Dybal
Veteran
Veteran
Posts: 49
Joined: Fri Jul 11, 2014 3:00 pm

Re: Turbo-Charge your browser for fanart.tv

Post by Dybal »

akovia wrote:While you are at it, maybe you can convert the Chome extension for fanart.tv that Mordred made for FF users. ;)
LOL, maybe. That would definitely require a VM setup. In the meantime:

Code: Select all

img[src*="./images/smilies/"]{width:0px;height:15px;padding-left:15px;background-size:15px 15px;}

img[src="./images/smilies/icon_idea.gif"]{margin-left:-1px;margin-right:1px;background-image:url (
The beginning of icon_idea.gif line needs the margins adjusted a bit to be better centered.
User avatar
Dybal
Veteran
Veteran
Posts: 49
Joined: Fri Jul 11, 2014 3:00 pm

Re: Turbo-Charge your browser for fanart.tv

Post by Dybal »

The more universal smiley code successfully tested in Chromium Version 34.0.1847.116. Complete Stylish code: Chrome Large Smileys, Chrome Small Smileys, Firefox Large Smileys, Firefox Small Smileys. Perhaps you didn't apply the patch correctly? If you can confirm the Chrome version also works for you that would be great.

Slight tweak to additional colors, added dark grey & fixed topic post icons: Chrome & Firefox.
Original, lots of pink
Original, lots of pink
colors.png (6.33 KiB) Viewed 26074 times
additional colors
additional colors
colors.01.png (14.62 KiB) Viewed 26074 times
For your CSS apparently Chrome doesn't like ms. Works with seconds. Also updated my original post.
Dybal wrote:The only tweak I did with yours is to have the info roll back up quicker.
Around line 1071:
  • Code: Select all

        transition: margin-top ease-in 0.5s;
        -webkit-transition: margin-top ease-in 0.5s;
Finally, I ran a diff between the different versions of the imagus mod and came up with a bit ugly hack:

Code: Select all

// ==UserScript==
// @name           Imagus Background Toggle
// @version        0.0.4
// @description    Toggles the Imagus hover background color
// @match          http://*/*
// ==/UserScript==

// a function that loads jQuery and calls a callback function when jQuery has finished loading
function addJQuery(callback) {
  var script = document.createElement('script');
  script.setAttribute('src', '//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js');
  script.addEventListener('load', function() {
    var script = document.createElement('script');
    script.textContent = 'window.jQ=jQuery.noConflict(true);(' + callback.toString() + ')();';
    document.body.appendChild(script);
  }, false);
  document.body.appendChild(script);
}

function main(){

  var nextColor = (function() {
    var colorArray = ['black','white','red','#00ff00','transparent'];
    var count = -1;
    return function() {
      return colorArray[++count % colorArray.length];
    }
  }());

  function toggleImagusBorder() {
   var imagusDiv = jQ('div[style*="z-index: 2147483647"]');
   if (imagusDiv.css('display') !== 'none') {
      imagusDiv.css('background', nextColor());
   }
  }

  function toggleGutter() {
   var imagusDiv = jQ('div[style*="z-index: 2147483647"]');
   if (imagusDiv.css('display') !== 'none') {
    var img = jQ('div[style*="z-index: 2147483647"] img');
    if (img.css('background-image') == 'none') {
      img.css('background-image', 'url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iODAwcHgiIGhlaWdodD0iMzEwcHgiPjxnIG9wYWNpdHk9IjAuNyI+PHBhdGggZmlsbD0iI0ZGMDAwMCIgZD0iTTc5MCwxMHYyOTBIMTBWMTBINzkwIE04MDAsMGgtMTBIMTBIMHYxMHYyOTB2MTBoMTBoNzgwaDEwdi0xMFYxMFYwTDgwMCwweiIvPjwvZz48L3N2Zz4=)');
    } else { img.css('background-image', 'none');}
   }
  }
  
  function doc_keyUpToggleImagusBorder(e) {
    if (e.ctrlKey && e.altKey && e.keyCode == 81) {
      toggleImagusBorder();
    }
   if (e.ctrlKey && e.altKey && e.keyCode == 87) {
     toggleGutter();
   }
  }

  // register the handler 
  document.addEventListener('keyup', doc_keyUpToggleImagusBorder, false);
}

// load jQuery and execute the main function
addJQuery(main);
When you run a diff you can see the toggleGutter() function was removed during the update. Simple enough to stick it back in. Inside toggleGutter() I wrapped the older code with the fix from toggleImagusBorder(). That I'm sure can be done more elegantly, but it works.
Last edited by Dybal on Tue Aug 05, 2014 9:13 am, edited 2 times in total.
User avatar
Dybal
Veteran
Veteran
Posts: 49
Joined: Fri Jul 11, 2014 3:00 pm

Re: Turbo-Charge your browser for fanart.tv

Post by Dybal »

Hopefully, last tweak. Topic post icons were finished, but the code wasn't in place to see them. I was going to leave it broken, but after some random flailing around I believe I stumbled into the fix. Updated the Dark Forums Style pastebin links for Chrome & Firefox above. Both Moderation and The Playground have topics with topic post icons.
User avatar
akovia
Admin
Admin
Posts: 441
Joined: Wed Dec 18, 2013 3:37 pm

Re: Turbo-Charge your browser for fanart.tv

Post by akovia »

Dybal wrote: Perhaps you didn't apply the patch correctly?
I'm not sure I know what you mean. All I did was add that line of code to the original small smiley code and it works perfectly as shown in the screenshot.
I am using Version 34.0.1847.116 Ubuntu 12.04 (260972)
Dybal wrote:Slight tweak to additional colors, added dark grey & fixed topic post icons:
Will give it a go.
Dybal wrote:The only tweak I did with yours is to have the info roll back up quicker.
Around line 1071:
  • Code: Select all

        transition: margin-top ease-in 0.5s;
        -webkit-transition: margin-top ease-in 0.5s;
I'm fine with the delay I originally set, but I'm glad you pointed it out for anyone else that would like to tweak it to their liking.
Dybal wrote:Finally, I ran a diff between the different versions of the imagus mod and came up with a bit ugly hack:
Sounds good. Will give it a try when I get some time. :)
User avatar
akovia
Admin
Admin
Posts: 441
Joined: Wed Dec 18, 2013 3:37 pm

Re: Turbo-Charge your browser for fanart.tv

Post by akovia »

Everything is working great. Updated first post with link to Imagus-Mod 0.0.4
Thanks for your work ;)

P.S. I've given you access to be able to upload files to the main site.
http://fanart.tv/wp-admin/upload.php
You should really upload your files to the main site from now on instead of pastebin so they will never expire.
User avatar
Dybal
Veteran
Veteran
Posts: 49
Joined: Fri Jul 11, 2014 3:00 pm

Re: Turbo-Charge your browser for fanart.tv

Post by Dybal »

akovia wrote:
Dybal wrote: Perhaps you didn't apply the patch correctly?
I'm not sure I know what you mean. All I did was add that line of code to the original small smiley code and it works perfectly as shown in the screenshot.
I thought a few posts back you had tested the large smiley patch, but it wasn't working correctly for you? No matter. The updated smiley code works for either Firefox or Chrome. It's convenient to have one version. Well, minus the Stylish specific differences.
akovia wrote:I'm fine with the delay I originally set, but I'm glad you pointed it out for anyone else that would like to tweak it to their liking.
Yeah, with the other code it was effectively no delay in Chrome. Not quite what I intended.
akovia wrote:P.S. I've given you access to be able to upload files to the main site.
Cheers, I will upload them in a bit. Just tested the link, but getting an error: You do not have sufficient permissions to access this page.
User avatar
akovia
Admin
Admin
Posts: 441
Joined: Wed Dec 18, 2013 3:37 pm

Re: Turbo-Charge your browser for fanart.tv

Post by akovia »

Sorry about that, I think I have it fixed now. Let me know.
User avatar
Dybal
Veteran
Veteran
Posts: 49
Joined: Fri Jul 11, 2014 3:00 pm

Re: Turbo-Charge your browser for fanart.tv

Post by Dybal »

akovia wrote:Sorry about that, I think I have it fixed now. Let me know.
All working. I updated the links in the above post.
User avatar
Dybal
Veteran
Veteran
Posts: 49
Joined: Fri Jul 11, 2014 3:00 pm

Re: Turbo-Charge your browser for fanart.tv

Post by Dybal »

:idea: Dark Compact Style-b last updated on 2015-02-06.

Fixed zorensen's unreported z-index bug: Browse Artists icon above the menu.
Attachments
Fanart.tv-0.9.2-3b-2.FF.css
Firefox version
(51.71 KiB) Downloaded 769 times
Fanart.tv-0.9.2-3b-2.chrome.css
Chrome version
(51.66 KiB) Downloaded 753 times
Last edited by Dybal on Fri Feb 06, 2015 7:38 pm, edited 3 times in total.
User avatar
akovia
Admin
Admin
Posts: 441
Joined: Wed Dec 18, 2013 3:37 pm

Re: Turbo-Charge your browser for fanart.tv

Post by akovia »

Thanks for the updates Dybal! :!:
Post Reply