DDSteam

Add search links for games on Steam pages

目前為 2024-01-06 提交的版本,檢視 最新版本

// ==UserScript==
// @name         DDSteam
// @version      1.0
// @description  Add search links for games on Steam pages
// @author       johnromerobot
// @license MIT
// @match        https://store.steampowered.com/*
// @namespace https://gf.qytechs.cn/users/1243768
// ==/UserScript==

(function() {
    'use strict';

    function createButton(searchLink, buttonText, tooltipText, iconPath) {
        const gameNameElement = document.getElementById("appHubAppName");
        if (gameNameElement) {
            const linkButton = document.createElement("a");
            linkButton.href = searchLink;
            linkButton.setAttribute("target", "_blank");
            linkButton.title = tooltipText;
            linkButton.style.display = 'inline-block';
            linkButton.style.marginRight = '10px';
            linkButton.style.position = 'relative';

            const img = new Image();
            img.src = iconPath;
            img.alt = buttonText;
            img.style.width = '64px';
            img.style.height = '32px';
            img.style.objectFit = 'contain';
            img.style.transition = 'transform 0.3s ease-in-out';
            img.style.borderRadius = '8px';
            img.style.boxShadow = '0 0 5px rgba(0, 0, 0, 0.3)';
            img.style.backgroundColor = 'rgba(0, 0, 0, 0.2)'; // Slightly darker background

            linkButton.appendChild(img);
            gameNameElement.parentNode.appendChild(linkButton);
        }
    }

    const formattedGameName = document.getElementById("appHubAppName").textContent.trim().toLowerCase().replace(/'/g, '').replace(/_/g, ' ');



    const steamrip = `https://steamrip.com/?s=${formattedGameName}`;
    createButton(steamrip, "SteamRIP", "Search on SteamRIP", "https://i.imgur.com/tmvOT86.png");

  const ovagames = `https://www.ovagames.com/?s=${formattedGameName}&x=0&y=0`;
    createButton(ovagames, "OvaGames", "Search on OvaGames", "https://www.ovagames.com/wp-content/uploads/2014/05/ovagames-logo.jpg");

   const pivigames= `https://pivigames.blog/?s=${formattedGameName}`;
    createButton(pivigames, "PiviGames", "Search on Pivi", "https://pivigames.blog/wp-content/uploads/2018/05/logo-pivigames.png");

  const blizzboygames = `https://www.blizzboygames.net/?s=${formattedGameName}`;
    createButton(blizzboygames, "BlizzBoyGames", "Search on BlizzBoyGames", "https://www.blizzboygames.net/wp-content/uploads/2016/07/logo.png");

  const gamezfull = `https://www.gamezfull.com/?s=${formattedGameName}`;
    createButton(gamezfull, "Gamezfull", "Search on Gamezfull", "https://www.gamezfull.com/wp-content/themes/MystiqueR3/favicon_gf.ico");

   const gog = `https://www.gog-games.to/search/${formattedGameName}`;
    createButton(gog, "GOG", "Search on GOG", "https://i.imgur.com/wXfz72C.png");

   const hltb = `https://howlongtobeat.com/?q=${formattedGameName}`;
    createButton(hltb, "HowLongToBeat", "Search on HowLongToBeat", "https://howlongtobeat.com/img/icons/apple-touch-icon-72x72.png");


    GM_addStyle(`
        body {
            background-color: #222;
            font-family: Arial, sans-serif;
            padding: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }

        a {
            display: inline-block;
            transition: transform 0.3s ease-in-out;
            margin-right: 10px;
            position: relative;
        }

        a img {
            width: 64px;
            height: 32px;
            object-fit: contain;
            transition: transform 0.3s ease-in-out;
            border-radius: 8px;
            box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
            background-color: rgba(0, 0, 0, 0.2); /* Slightly darker background */
        }

        a:hover img {
            transform: scale(1.1);
        }
    `);
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址