Quillbot Premium Pro

Professional Quillbot Premium Unlocker with Persistent Toggle

// ==UserScript==
// @name         Quillbot Premium Pro
// @namespace    quillbot.kyrillosatef.com
// @version      4.0.0
// @description  Professional Quillbot Premium Unlocker with Persistent Toggle
// @author       Kyrillos Atef
// @match        https://quillbot.com/*
// @icon         https://quillbot.com/favicon.png
// @require      https://greasyfork.org/scripts/455943-ajaxhooker/code/ajaxHooker.js?version=1124435
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_addStyle
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Configuration
    const CONFIG = {
        version: "4.0.0",
        author: "Kyrillos Atef",
        debug: true,
        premiumFeatures: [
            "Unlimited Word Count",
            "Premium Writing Modes",
            "Advanced Grammar Checks",
            "Premium Synonyms",
            "Fluency Enhancements"
        ],
        theme: {
            primary: "#4CAF50",
            secondary: "#2196F3",
            danger: "#F44336",
            dark: "#2C3E50",
            light: "#ECF0F1",
            shadow: "0 4px 8px rgba(0,0,0,0.2)",
            radius: "8px",
            transition: "all 0.3s ease"
        }
    };

    // State Management
    const STATE = {
        isActive: GM_getValue("premiumStatus", false),
        isInitialized: false
    };

    // Logger System
    const logger = {
        system: (message) => console.log(`%c[Quillbot Pro] ${message}`, "color: #3498DB; font-weight: bold"),
        success: (message) => console.log(`%c✓ ${message}`, "color: #2ECC71"),
        error: (message) => console.error(`%c✗ ${message}`, "color: #E74C3C")
    };

    // API Interceptor
    const apiInterceptor = {
        init: function() {
            ajaxHooker.hook((request) => {
                if (request.url.includes("get-account-details")) {
                    request.response = (response) => {
                        try {
                            if (!STATE.isActive) return;

                            const responseData = JSON.parse(response.responseText);
                            const modifiedData = responseData.data || responseData;

                            // Premium Modifications
                            modifiedData.profile = {
                                ...modifiedData.profile,
                                premium: true,
                                client_type: "premium",
                                premium_tier: "premium_plus",
                                subscription_expires_at: new Date(Date.now() + 365 * 24 * 60 * 60 * 1000).toISOString()
                            };

                            // Unlimited Limits
                            Object.keys(modifiedData.limits || {}).forEach(key => {
                                modifiedData.limits[key] = {
                                    limit: 999999,
                                    premium_limit: 999999,
                                    used: 0
                                };
                            });

                            response.responseText = JSON.stringify(responseData);
                            logger.success("Injected premium account data");
                        } catch (e) {
                            logger.error("Failed to modify API response");
                        }
                    };
                }
            });
            logger.system("API Interceptor initialized");
        }
    };

    // UI Controller
    // UI Controller (Improved Version)
const UI = {
    injectStyles: function() {
        GM_addStyle(`
            /* Main Panel Container */
            .qb-pro-panel {
                position: fixed;
                bottom: 25px;
                right: 25px;
                z-index: 99999;
                font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
                transform: translateY(20px);
                opacity: 0;
                transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
                will-change: transform, opacity;
            }

            .qb-pro-panel.appear {
                transform: translateY(0);
                opacity: 1;
            }

            /* Premium Toggle Button */
            .qb-pro-toggle {
                display: flex;
                align-items: center;
                gap: 12px;
                padding: 14px 22px;
                border-radius: 12px;
                border: none;
                font-weight: 600;
                font-size: 14px;
                cursor: pointer;
                transition: all 0.3s ease;
                box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
                background: ${STATE.isActive ? '#4361ee' : '#e74c3c'}; /* More vibrant, brand-aligned colors */
                color: white;
                position: relative;
                overflow: hidden;
                min-width: 180px;
                justify-content: center;
            }

            .qb-pro-toggle:hover {
                transform: translateY(-3px);
                box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
            }

            /* Ripple Effect on Click */
            .qb-pro-toggle::before {
                content: '';
                position: absolute;
                top: 50%;
                left: 50%;
                width: 5px;
                height: 5px;
                background: rgba(255, 255, 255, 0.5);
                opacity: 0;
                border-radius: 100%;
                transform: scale(1, 1) translate(-50%);
                transform-origin: 50% 50%;
            }

            .qb-pro-toggle:focus::before {
                animation: ripple 0.8s ease-out;
            }

            @keyframes ripple {
                0% {
                    transform: scale(0, 0) translate(-50%);
                    opacity: 0.5;
                }
                100% {
                    transform: scale(400, 400) translate(-50%);
                    opacity: 0;
                }
            }

            /* Toggle Icon Styling */
            .qb-pro-toggle svg {
                transition: transform 0.3s ease;
                transform: ${STATE.isActive ? 'scale(1)' : 'scale(0.9)'};
            }

            .qb-pro-toggle:hover svg {
                transform: scale(1.1);
            }

            /* Credit Text */
            .qb-pro-credit {
                margin-top: 10px;
                font-size: 10px;
                color: #95a5a6;
                text-align: center;
                font-style: italic;
                letter-spacing: 0.5px;
                transition: color 0.3s ease;
            }

            .qb-pro-toggle:hover + .qb-pro-credit {
                color: #bdc3c7;
            }

            /* Notification Toast */
            .qb-pro-notification {
                position: fixed;
                bottom: 90px;
                right: 25px;
                padding: 14px 20px;
                background: #2d3748;
                color: white;
                border-radius: 10px;
                box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
                z-index: 99999;
                display: flex;
                align-items: center;
                gap: 12px;
                font-size: 14px;
                transform: translateX(100%);
                opacity: 0;
                transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            }

            .qb-pro-notification.show {
                transform: translateX(0);
                opacity: 1;
            }

            .qb-pro-notification::before {
                content: '';
                display: inline-block;
                width: 20px;
                height: 20px;
                background-color: ${CONFIG.theme.primary};
                mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' d='M5 13l4 4L19 7'/%3E%3C/svg%3E") no-repeat 50% 50%;
                -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' d='M5 13l4 4L19 7'/%3E%3C/svg%3E") no-repeat 50% 50%;
            }

            .qb-pro-notification.danger::before {
                background-color: ${CONFIG.theme.danger};
                mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' d='M6 18L18 6M6 6l12 12'/%3E%3C/svg%3E") no-repeat 50% 50%;
                -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' d='M6 18L18 6M6 6l12 12'/%3E%3C/svg%3E") no-repeat 50% 50%;
            }

            /* Responsive Design */
            @media (max-width: 768px) {
                .qb-pro-panel {
                    bottom: 15px;
                    right: 15px;
                }
                .qb-pro-notification {
                    bottom: 70px;
                    right: 15px;
                    padding: 12px 16px;
                    font-size: 13px;
                }
                .qb-pro-toggle {
                    padding: 12px 18px;
                    font-size: 13px;
                    min-width: 160px;
                }
            }
        `);
    },

    createPanel: function() {
        const panel = document.createElement('div');
        panel.className = 'qb-pro-panel';

        const toggleBtn = document.createElement('button');
        toggleBtn.className = 'qb-pro-toggle';
        toggleBtn.type = 'button';
        toggleBtn.innerHTML = `
            <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
                <path d="${STATE.isActive ? 'M5 13l4 4L19 7' : 'M6 18L18 6M6 6l12 12'}"/>
            </svg>
            ${STATE.isActive ? 'PREMIUM ACTIVE' : 'ACTIVATE PREMIUM'}
        `;

        const credit = document.createElement('div');
        credit.className = 'qb-pro-credit';
        credit.textContent = `Enhanced by ${CONFIG.author} v${CONFIG.version}`;

        toggleBtn.addEventListener('click', () => {
            const wasActive = STATE.isActive;
            STATE.isActive = !STATE.isActive;
            GM_setValue("premiumStatus", STATE.isActive);

            // Show appropriate notification
            this.showNotification(
                STATE.isActive ? '✅ Premium Features Enabled' : '⚠️ Premium Features Disabled',
                !wasActive // Add 'danger' class if disabling
            );

            // Update button text and color immediately
            toggleBtn.innerHTML = `
                <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
                    <path d="${STATE.isActive ? 'M5 13l4 4L19 7' : 'M6 18L18 6M6 6l12 12'}"/>
                </svg>
                ${STATE.isActive ? 'PREMIUM ACTIVE' : 'ACTIVATE PREMIUM'}
            `;
            toggleBtn.style.background = STATE.isActive ? '#4361ee' : '#e74c3c';

            // Trigger ripple effect
            toggleBtn.focus();

            // Reload after a short delay
            setTimeout(() => location.reload(), 800);
        });

        panel.appendChild(toggleBtn);
        panel.appendChild(credit);
        document.body.appendChild(panel);

        // Trigger the entrance animation after a small delay for a smoother appearance
        setTimeout(() => {
            panel.classList.add('appear');
        }, 300);

        logger.system("UI Panel initialized");
    },

    showNotification: function(message, isDanger = false) {
        const existing = document.querySelector('.qb-pro-notification');
        if (existing) existing.remove();

        const notification = document.createElement('div');
        notification.className = `qb-pro-notification${isDanger ? ' danger' : ''}`;
        notification.textContent = message;

        document.body.appendChild(notification);

        // Trigger entrance animation
        setTimeout(() => {
            notification.classList.add('show');
        }, 10);

        // Auto-dismiss after 3 seconds
        setTimeout(() => {
            notification.style.opacity = '0';
            notification.style.transform = 'translateX(100%)';
            setTimeout(() => notification.remove(), 400);
        }, 3000);
    },

    init: function() {
        this.injectStyles();
        this.createPanel();

        if (STATE.isActive && !STATE.isInitialized) {
            this.showNotification('🚀 Premium Mode Already Active');
            STATE.isInitialized = true;
        }
    }
};

    // Main Initialization
    (function init() {
        logger.system(`Initializing Quillbot Pro v${CONFIG.version}`);
        apiInterceptor.init();

        const loadInterval = setInterval(() => {
            if (document.body) {
                clearInterval(loadInterval);
                UI.init();
                logger.success("System ready");
            }
        }, 100);
    })();
})();