Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Simple Code Snippets For GOG
- // @description A project to add minor changes to GOG and to improve the overall feel.
- // @include https://www.gog.com/*
- // @require https://code.jquery.com/jquery-3.3.1.slim.min.js
- // @version 1.0
- // @grant none
- // ==/UserScript==
- // Change game title color & show game titles:
- $(".product-tile__title").not(".product-tile--list:not(.product-tile--active) .product-tile__title").each(function () {
- $(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%" });
- });
- // Remove videos on hover:
- $(".product-tile").each(function () {
- $(this).removeAttr("product-dynamic-cover");
- });
- $(".product-tile__dynamic-cover.js-dynamic-cover").each(function () {
- $(this).remove();
- });
- // Change color of library tag:
- $(".product-tile__label--in-library").each(function () {
- $(this).css("color", "black");
- });
- $(".product-tile__label--in-library .product-tile__label-icon").each(function () {
- $(this).css("fill", "black");
- });
- // Align discount tag:
- $(".product-tile__discount").each(function () {
- $(this).css({ "position": "absolute", "right": "50px", "bottom": "2px" });
- });
- $(".product-tile__price-discounted").each(function () {
- $(this).css("line-height", "18px");
- });
- $(document).ready(function () {
- // Move news post to the top of the page:
- $("div.content.cf div.container").has("div.news-section-wrapper").insertAfter("div.content.cf div.big-spot__carousel-container");
- // Move game spotlight below discover games:
- $("div.content.cf div.container").has("div.small-spots__container").insertAfter("div.content.cf div.container.container--two-columns");
- // Capitalize the titles on the home pages (ie Discover games vs Discover Games):
- $("div.section-title__title-wrapper").css("text-transform", "capitalize");
- // Remove GOG Galaxy banner:
- $("div.galaxy-section-wrapper").remove();
- // Add title Game Spotlight To 4 random games on the homepage and remove the padding:
- 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>";
- $("div.content.cf div.container").has("div.small-spots__container").prepend(spotlightTitle);
- $("div.content.cf div.container div.small-spots__container").css("padding-top", "0px");
- // Remove video from carousel:
- $(".big-spot__media").remove();
- // Adds space to top of footer:
- $(".footer-microservice.main-footer").css("margin-top", "20px");
- // Remove the big video button on the store pages and shrink the size down to 300px. Less scrolling:
- $("a.productcard-player__play-button.ng-scope").remove();
- $("div.productcard-player").css({ "height": "300px", "min-height": "300px" });
- // Remove popular achievements from the store pages:
- $("div.layout-container div.layout-main-col div.content-summary-section.content-summary-offset div").has("div.popular-achievements.ng-scope").remove();
- // Add a link to the review rating at the top of the store page:
- var reviews = $(".productcard-rating ").html();
- $(".productcard-rating ").html("<a href=\"#reviews\">" + reviews + "</a>");
- // Change color of library tag:
- $(".owned-status").css("color", "black");
- // Adds filters for release year:
- if (window.location.href.indexOf('https://www.gog.com/games') > -1) {
- var url = "https://www.gog.com/games?page=1&sort=popularity";
- $(".catalog__search-container").after("<div style=\"margin-top:20px;\"><span>Release Year (Filter):</span> " +
- "<a style=\"background-color:#2c2c2c; padding:4px; color:white; border-radius:2px;\" href=\"" + url + "&release=p2000\">Pre-2000</a>" +
- " | <a style=\"background-color:#2c2c2c; padding:4px; color:white; border-radius:2px;\" href=\"" + url + "&release=2000_2004\">2000 to 2004</a>" +
- " | <a style=\"background-color:#2c2c2c; padding:4px; color:white; border-radius:2px;\" href=\"" + url + "&release=2005_2009\">2005 to 2009</a>" +
- " | <a style=\"background-color:#2c2c2c; padding:4px; color:white; border-radius:2px;\" href=\"" + url + "&release=2010_2014\">2010 to 2014</a>" +
- " | <a style=\"background-color:#2c2c2c; padding:4px; color:white; border-radius:2px;\" href=\"" + url + "&release=a2015\">After 2015</a></div>");
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement