Gray Swan Arena - Clean UI

Hide header and sidebar for focused chat interface on Gray Swan Arena

当前为 2025-07-31 提交的版本,查看 最新版本

// ==UserScript==
// @name         Gray Swan Arena - Clean UI
// @namespace    http://tampermonkey.net/
// @version      1.3
// @license      MIT
// @description  Hide header and sidebar for focused chat interface on Gray Swan Arena
// @author       KarthiDreamr
// @match        https://app.grayswan.ai/*
// @grant        GM_addStyle
// @homepage     https://github.com/yourusername/grayswan-clean-ui
// @supportURL   https://github.com/yourusername/grayswan-clean-ui/issues
// ==/UserScript==

(function() {
    'use strict';

    // Add CSS styles for hiding elements and toggle button
    GM_addStyle(`
        /* Hide header */
        .gsa-clean-mode .bg-background.fixed.top-0 {
            display: none !important;
        }

        /* Hide sidebar */
        .gsa-clean-mode #sidebar,
        .gsa-clean-mode .relative.hidden.h-full.md\\:block {
            display: none !important;
        }

        /* Hide breadcrumb navigation */
        .gsa-clean-mode nav[data-slot="breadcrumb"] {
            display: none !important;
        }

        /* Hide top tab navigation */
        .gsa-clean-mode .scrollbar-hide.-mb-1.flex.max-w-screen {
            display: none !important;
        }

        /* Hide mobile menu button */
        .gsa-clean-mode .md\\:hidden button[data-slot="sheet-trigger"] {
            display: none !important;
        }

        /* ENHANCED: Remove all padding and margins from main containers */
        .gsa-clean-mode .flex.flex-1.flex-col.overflow-hidden.pt-\\[4\\.5rem\\] {
            padding-top: 0 !important;
            padding-left: 0 !important;
            padding-right: 0 !important;
        }

        .gsa-clean-mode .relative.mx-auto.flex.h-full.w-full.flex-1 {
            padding: 0 !important;
            margin: 0 !important;
            max-width: none !important;
        }

        .gsa-clean-mode .flex.md\\:h-full.md\\:w-full.md\\:gap-4 {
            gap: 0 !important;
            padding: 0 !important;
        }

        /* ENHANCED: Make chat area completely full screen */
        .gsa-clean-mode .relative.flex.h-full.w-full.flex-col.gap-3 {
            max-width: none !important;
            margin: 0 !important;
            padding: 8px !important;
            gap: 8px !important;
        }

        /* ENHANCED: Remove padding from chat container */
        .gsa-clean-mode .dark\\:border-border.relative.flex.min-h-0.flex-1.flex-col.overflow-hidden {
            margin: 0 !important;
        }

        /* ENHANCED: Optimize chat content area spacing */
        .gsa-clean-mode .flex.h-full.min-h-0.flex-1.flex-col.overflow-auto {
            padding: 12px !important;
        }

        /* ENHANCED: Remove excessive margins from chat messages area */
        .gsa-clean-mode .mx-auto.flex.h-full.w-full.max-w-prose.flex-col.items-center.justify-center.space-y-2 {
            max-width: none !important;
            margin: 0 !important;
            padding: 0 !important;
        }

        /* ENHANCED: Optimize input area spacing */
        .gsa-clean-mode .relative.mx-auto.w-full.max-w-\\[75ch\\].shrink-0 {
            max-width: none !important;
            margin: 0 !important;
            padding: 8px !important;
        }

        /* ENHANCED: Remove body margins in clean mode */
        .gsa-clean-mode body {
            margin: 0 !important;
            padding: 0 !important;
        }

        /* ENHANCED: Make main content container full height */
        .gsa-clean-mode .flex.min-h-screen.w-full.flex-col.overflow-hidden {
            min-height: 100vh !important;
        }

        /* Toggle button styles - positioned in bottom-left */
        #gsa-clean-toggle {
            position: fixed;
            top: 10px;
            left: 10px;
            z-index: 9999;
            background: rgba(0,0,0,0.8);
            color: white;
            border: 2px solid #007bff;
            border-radius: 50px;
            padding: 10px 15px;
            font-family: Arial, sans-serif;
            font-size: 14px;
            font-weight: bold;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
            transition: all 0.3s ease;
        }

        #gsa-clean-toggle:hover {
            background: rgba(0,0,0,0.9);
            border-color: #0056b3;
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(0,0,0,0.4);
        }

        #gsa-clean-toggle.active {
            background: #28a745;
            border-color: #1e7e34;
        }

        #gsa-clean-toggle.active:hover {
            background: #218838;
        }
    `);

    // Wait for page to load
    window.addEventListener('load', function() {
        // Create toggle button
        const toggleButton = document.createElement('button');
        toggleButton.id = 'gsa-clean-toggle';
        toggleButton.textContent = '🎯 Clean Mode';
        toggleButton.title = 'Toggle clean chat interface (F1)';

        document.body.appendChild(toggleButton);

        // Toggle function
        function toggleCleanMode() {
            const isActive = document.body.classList.contains('gsa-clean-mode');

            if (isActive) {
                document.body.classList.remove('gsa-clean-mode');
                toggleButton.classList.remove('active');
                toggleButton.textContent = '🎯 Clean Mode';
                console.log('Clean mode: OFF');
            } else {
                document.body.classList.add('gsa-clean-mode');
                toggleButton.classList.add('active');
                toggleButton.textContent = '✨ Normal Mode';
                console.log('Clean mode: ON');
            }
        }

        // Button click event
        toggleButton.addEventListener('click', toggleCleanMode);

        // Keyboard shortcut (F8)
        document.addEventListener('keydown', function(e) {
            if (e.key === 'F8') {
                e.preventDefault();
                toggleCleanMode();
            }
        });

        console.log('Gray Swan Arena Clean Mode script loaded. Press F1 or click the button to toggle.');
    });
})();