User:Jono Bean/common.js

From DQWiki
Jump to navigationJump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* Lorekeeper Standalone Terminal v6.1 - Royal Carzala Theme */
(function() {
    var checkCount = 0;
    var initTimer = setInterval(function() {
        if (document.body) { clearInterval(initTimer); setupLore(); }
        if (checkCount++ > 100) clearInterval(initTimer);
    }, 100);

    function setupLore() {
        if (document.getElementById('lore-terminal-btn')) return;

        var css = 
            '#lore-chat::-webkit-scrollbar { width: 5px; }' +
            '#lore-chat::-webkit-scrollbar-thumb { background: #f97316; border-radius: 10px; }' +
            '.lore-msg { margin-bottom: 12px; padding: 12px 16px; border-radius: 15px; font-size: 14px; line-height: 1.5; }' +
            '.lore-user { background: #f97316; color: #000; align-self: flex-end; margin-left: 35px; border-bottom-right-radius: 4px; font-weight: 500; }' +
            '.lore-ai { background: #24140e; color: #f7f3e8; align-self: flex-start; margin-right: 35px; border-left: 4px solid #f97316; border-bottom-left-radius: 4px; }';
        
        var style = document.createElement('style');
        style.type = 'text/css';
        style.appendChild(document.createTextNode(css));
        document.head.appendChild(style);

        var btn = document.createElement('div');
        btn.id = 'lore-terminal-btn';
        btn.innerHTML = '✨';
        btn.setAttribute('style', 'position:fixed !important; bottom:25px !important; right:25px !important; width:65px !important; height:65px !important; background:#2d140e !important; border-radius:50% !important; display:flex !important; align-items:center !important; justify-content:center !important; font-size:32px !important; cursor:pointer !important; box-shadow:0 10px 30px rgba(0,0,0,0.6) !important; z-index:9999999 !important; border:3px solid #f97316 !important;');

        var box = document.createElement('div');
        box.id = 'lore-terminal-box';
        box.setAttribute('style', 'position:fixed !important; bottom:105px !important; right:25px !important; width:410px !important; height:600px !important; background:#1a0d09 !important; border:1px solid #412a23 !important; border-radius:24px !important; display:none; flex-direction:column !important; box-shadow:0 30px 80px rgba(0,0,0,0.9) !important; z-index:9999999 !important; color:#f7f3e8 !important; font-family:serif !important; overflow:hidden;');
        
        box.innerHTML = 
            '<div style="padding:18px 20px; border-bottom:1px solid #412a23; background:rgba(249,115,22,0.05); display:flex; justify-content:space-between; align-items:center;">' +
                '<div><b style="color:#f97316; font-size:16px; letter-spacing:1px; text-transform:uppercase;">Lorekeeper</b><br><small style="opacity:0.6; font-size:10px;">Duchy of Carzala - Seagate Archives</small></div>' +
                '<span id="lore-close" style="cursor:pointer; font-size:24px; opacity:0.5; color:#f97316;">&times;</span>' +
            '</div>' +
            '<div id="lore-chat" style="flex:1; overflow-y:auto; padding:20px; display:flex; flex-direction:column; background:#1a0d09;">' +
                '<div class="lore-msg lore-ai">Greetings, Traveler. I am the Scribe of the Seagate Archives. What knowledge of <b>Carzala</b> do you seek today?</div>' +
            '</div>' +
            '<div style="padding