Google Slides Custom Plus Button

Add a custom button to Google Slides toolbar for additional features

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey, Greasemonkey или Violentmonkey.

Для установки этого скрипта вам необходимо установить расширение, такое как Tampermonkey.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey или Violentmonkey.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey или Userscripts.

Чтобы установить этот скрипт, сначала вы должны установить расширение браузера, например Tampermonkey.

Чтобы установить этот скрипт, вы должны установить расширение — менеджер скриптов.

(у меня уже есть менеджер скриптов, дайте мне установить скрипт!)

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

(у меня уже есть менеджер стилей, дайте мне установить скрипт!)

// ==UserScript==
// @name         Google Slides Custom Plus Button
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Add a custom button to Google Slides toolbar for additional features
// @author       Your Name
// @match        https://docs.google.com/presentation/d/*
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';

    // Function to create and add a custom button to the toolbar
    const addCustomButton = () => {
        const toolbar = document.querySelector('[aria-label="Google Slides"] .punch-viewer-toolbar');
        if (toolbar) {
            // Create a new button
            const button = document.createElement('button');
            button.innerText = '+';
            button.style.marginLeft = '10px';
            button.style.fontSize = '20px';
            button.style.backgroundColor = '#f1f1f1';
            button.style.border = 'none';
            button.style.padding = '5px 10px';
            button.style.cursor = 'pointer';

            // Action for button click
            button.onclick = () => {
                // Example action: show an alert with options
                const action = prompt('Choose an action:\n1. Morph Transition\n2. Zoom\n3. Presenter Coach\n4. Animation\n5. Charts\n6. Slide Maker\n7. 3D Models\n8. Drawing\n9. Font Import\n10. Images');
                switch(action) {
                    case '1':
                        alert('Morph Transition feature (not implemented)');
                        break;
                    case '2':
                        alert('Zoom feature (not implemented)');
                        break;
                    case '3':
                        alert('Presenter Coach feature (not implemented)');
                        break;
                    case '4':
                        alert('Animation feature (not implemented)');
                        break;
                    case '5':
                        alert('Charts feature (not implemented)');
                        break;
                    case '6':
                        alert('Slide Maker feature (not implemented)');
                        break;
                    case '7':
                        alert('3D Models feature (not implemented)');
                        break;
                    case '8':
                        alert('Drawing feature (not implemented)');
                        break;
                    case '9':
                        alert('Font Import feature (not implemented)');
                        break;
                    case '10':
                        alert('Images feature (not implemented)');
                        break;
                    default:
                        alert('Invalid option');
                }
            };

            // Add button to toolbar
            toolbar.appendChild(button);
        } else {
            // Retry if toolbar not found
            setTimeout(addCustomButton, 1000);
        }
    };

    // Run the function to add the button
    addCustomButton();
})();