Skip to content

Instantly share code, notes, and snippets.

@RoxasShadow
Last active October 13, 2017 19:21
Show Gist options
  • Save RoxasShadow/2301e5963fc508dc9b7eaf124e025802 to your computer and use it in GitHub Desktop.
Save RoxasShadow/2301e5963fc508dc9b7eaf124e025802 to your computer and use it in GitHub Desktop.
@RoxasShadow
Copy link
Author

RoxasShadow commented Oct 7, 2017

alternative working on both gallery and single page

// ==UserScript==
// @name        pixiv-gallery-hq
// @namespace   pixiv-gallery-hq
// @description Make pixiv galleries optimized for hires screens
// @include     https://www.pixiv.net/member_illust.php*
// @version     1
// @grant       none
// ==/UserScript==

if(window.screen.height > 1080) {
  $(document).bind('DOMNodeInserted', function(event) {
    $('._thumbnail').each((i, e_) => {
      let e = $(e_);
      if(e.length) {
        let s = e.attr('data-src').replace('150x150', '600x600');
        e.removeAttr('data-filter');
        e.removeAttr('data-src');
        e.attr('src', s);
      }
    });

    $('._thumbnail').css('width', '100%').css('height', 'auto');
    $('.work').css('width', 'auto').css('height', 'auto');
  });

  let e = $('.works_display > ._layout-thumbnail > img');
  if(e.length) {
    e.attr('src', e.attr('src').replace('c/600x600/', ''));
    $('.works_display').css('width', 'auto').css('height', '100%');
    $('#illust-recommend')
      .css('width', '25vh')
      .css('position', 'fixed')
      .css('right', '10vh')
      .css('margin', '0')
      .css('top', '-0.5vh')
      .css('overflow', 'scroll')
      .css('height', '100%');
  }

  // pics
  $('._thumbnail').css('width', '100%').css('height', 'auto');
  $('.work').css('width', 'auto').css('height', 'auto');
  $('.image-item').css('width', 'auto').css('height', 'auto');

  // images box
  $('.layout-column-2').css('width', '126vh').css('margin-right', '35vh');
  $('.layout-a').css('width', '100%');
  $('#wrapper').css('width', '100%').css('margin', '0');

  // user box
  $('.layout-column-1').css('margin-left', '17vh').css('width', '10vh');
}

@RoxasShadow
Copy link
Author

If the script does not get activate, replace window.screen.height with $(document).height()

@RoxasShadow
Copy link
Author

$('.image-item').css('width', '22%').css('height', 'auto'); could work fine too (1440p on W10)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment