Google Custom Style with Tampermonkey Settings

Customize Google's logos, buttons, icons, and text with Tampermonkey's settings interface

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

You will need to install an extension such as Tampermonkey to install this script.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Google Custom Style with Tampermonkey Settings
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Customize Google's logos, buttons, icons, and text with Tampermonkey's settings interface
// @author       You
// @match        https://www.google.com/*
// @grant        GM_addStyle
// @grant        GM_registerMenuCommand
// @grant        GM_setValue
// @grant        GM_getValue
// ==/UserScript==

(function() {
    'use strict';

    // Default settings
    let defaultSettings = {
        logoSize: 100,
        logoPosition: 0,
    };

    // Get stored settings or use defaults
    let logoSize = GM_getValue('logoSize', defaultSettings.logoSize);
    let logoPosition = GM_getValue('logoPosition', defaultSettings.logoPosition);

    // Apply initial styles
    function applyStyles() {
        GM_addStyle(`
            img[alt="Google"] {
                width: ${logoSize}px !important;
                transform: translateX(${logoPosition}px) !important;
            }
        `);
    }

    // Function to prompt user for input and save settings
    function openSettings() {
        logoSize = parseInt(prompt('Set logo size (50-300):', logoSize), 10);
        logoPosition = parseInt(prompt('Set logo position (-100 to 100):', logoPosition), 10);

        // Save new settings
        GM_setValue('logoSize', logoSize);
        GM_setValue('logoPosition', logoPosition);

        // Apply new styles
        applyStyles();
    }

    // Register the settings menu command in Tampermonkey
    GM_registerMenuCommand('Customize Google Style', openSettings);

    // Apply the initial styles when the script runs
    applyStyles();
})();