Advertisement
BKGaming_

Simple Code Snippets For GOG

Apr 1st, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.62 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Simple Code Snippets For GOG
  3. // @description A project to add minor changes to GOG and to improve the overall feel.
  4. // @include https://www.gog.com/*
  5. // @require https://code.jquery.com/jquery-3.3.1.slim.min.js
  6. // @version 1.0
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. // Change game title color & show game titles:
  11. $(".product-tile__title").not(".product-tile--list:not(.product-tile--active) .product-tile__title").each(function () {
  12. $(this).css({ "height": "auto", "opacity": "1", "padding": "4px", "color": "white", "position": "absolute", "z-index": "99", "background-color": "rgba(26,26,26,0.7)", "width": "100%" });
  13. });
  14.  
  15. // Remove videos on hover:
  16. $(".product-tile").each(function () {
  17. $(this).removeAttr("product-dynamic-cover");
  18. });
  19. $(".product-tile__dynamic-cover.js-dynamic-cover").each(function () {
  20. $(this).remove();
  21. });
  22.  
  23. // Change color of library tag:
  24. $(".product-tile__label--in-library").each(function () {
  25. $(this).css("color", "black");
  26. });
  27. $(".product-tile__label--in-library .product-tile__label-icon").each(function () {
  28. $(this).css("fill", "black");
  29. });
  30.  
  31. // Align discount tag:
  32. $(".product-tile__discount").each(function () {
  33. $(this).css({ "position": "absolute", "right": "50px", "bottom": "2px" });
  34. });
  35. $(".product-tile__price-discounted").each(function () {
  36. $(this).css("line-height", "18px");
  37. });
  38.  
  39. $(document).ready(function () {
  40.  
  41. // Move news post to the top of the page:
  42. $("div.content.cf div.container").has("div.news-section-wrapper").insertAfter("div.content.cf div.big-spot__carousel-container");
  43.  
  44. // Move game spotlight below discover games:
  45. $("div.content.cf div.container").has("div.small-spots__container").insertAfter("div.content.cf div.container.container--two-columns");
  46.  
  47. // Capitalize the titles on the home pages (ie Discover games vs Discover Games):
  48. $("div.section-title__title-wrapper").css("text-transform", "capitalize");
  49.  
  50. // Remove GOG Galaxy banner:
  51. $("div.galaxy-section-wrapper").remove();
  52.  
  53. // Add title Game Spotlight To 4 random games on the homepage and remove the padding:
  54. var spotlightTitle = "<div class=\"section-title js-section-title section-title--with-border\"><div class=\"section-title__icon-wrapper\"><svg class=\"icon-wrapper-icon\"><use xlink:href=\"/svg/53aa1521.svg#icon-star\"></use></svg></div><div class=\"section-title__title-wrapper\"> Game Spotlight </div></div>";
  55. $("div.content.cf div.container").has("div.small-spots__container").prepend(spotlightTitle);
  56. $("div.content.cf div.container div.small-spots__container").css("padding-top", "0px");
  57.  
  58. // Remove video from carousel:
  59. $(".big-spot__media").remove();
  60.  
  61. // Adds space to top of footer:
  62. $(".footer-microservice.main-footer").css("margin-top", "20px");
  63.  
  64. // Remove the big video button on the store pages and shrink the size down to 300px. Less scrolling:
  65. $("a.productcard-player__play-button.ng-scope").remove();
  66. $("div.productcard-player").css({ "height": "300px", "min-height": "300px" });
  67.  
  68. // Remove popular achievements from the store pages:
  69. $("div.layout-container div.layout-main-col div.content-summary-section.content-summary-offset div").has("div.popular-achievements.ng-scope").remove();
  70.  
  71. // Add a link to the review rating at the top of the store page:
  72. var reviews = $(".productcard-rating ").html();
  73. $(".productcard-rating ").html("<a href=\"#reviews\">" + reviews + "</a>");
  74.  
  75. // Change color of library tag:
  76. $(".owned-status").css("color", "black");
  77.  
  78. // Adds filters for release year:
  79. if (window.location.href.indexOf('https://www.gog.com/games') > -1) {
  80. var url = "https://www.gog.com/games?page=1&sort=popularity";
  81. $(".catalog__search-container").after("<div style=\"margin-top:20px;\"><span>Release Year (Filter):</span> " +
  82. "<a style=\"background-color:#2c2c2c; padding:4px; color:white; border-radius:2px;\" href=\"" + url + "&release=p2000\">Pre-2000</a>" +
  83. " | <a style=\"background-color:#2c2c2c; padding:4px; color:white; border-radius:2px;\" href=\"" + url + "&release=2000_2004\">2000 to 2004</a>" +
  84. " | <a style=\"background-color:#2c2c2c; padding:4px; color:white; border-radius:2px;\" href=\"" + url + "&release=2005_2009\">2005 to 2009</a>" +
  85. " | <a style=\"background-color:#2c2c2c; padding:4px; color:white; border-radius:2px;\" href=\"" + url + "&release=2010_2014\">2010 to 2014</a>" +
  86. " | <a style=\"background-color:#2c2c2c; padding:4px; color:white; border-radius:2px;\" href=\"" + url + "&release=a2015\">After 2015</a></div>");
  87. }
  88.  
  89. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement