User:Polygnotus/Scripts/Claude6.js: Difference between revisions

Content deleted Content added
next to page instead of on top?
 
No edit summary
Line 15:
}
createUI() {
// Wrap the existing page content
const pageWrapper = document.createElement('div');
pageWrapper.id = 'claude-page-wrapper';
// Move all body children into the wrapper, except scripts
const bodyChildren = Array.from(document.body.children);
bodyChildren.forEach(child => {
if (child.tagName !== 'SCRIPT') {
pageWrapper.appendChild(child);
}
});
// Create sidebar container
const sidebar = document.createElement('div');
Line 56 ⟶ 44:
const style = document.createElement('style');
style.textContent = `
body {
display: flex !important;
margin: 0 !important;
padding: 0 !important;
}
#claude-page-wrapper {
flex: 1;
min-width: 0;
transition: all 0.3s ease;
}
#claude-proofreader-sidebar {
pageWrapper.appendChild(child)position: fixed;
margintop: 0 !important;
paddingright: 0 !important;
width: ${this.sidebarWidth};
min-height: 100vh;
background: #fff;
border-left: 2px solid #0645ad;
box-shadow: -2px 0 8px rgba(0,0,0,0.1);
flexz-index: 110000;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
font-size: 14px;
display: flex;
flex-direction: column;
flex-shrink: 0;
transition: all 0.3s ease;
}
Line 197 ⟶ 178:
background: transparent;
cursor: ew-resize;
minz-widthindex: 010001;
}
#claude-resize-handle:hover {
Line 212 ⟶ 194:
#ca-claude a:hover {
text-decoration: underline !important;
}
body {
margin-right: ${this.isVisible ? this.sidebarWidth : '0'} !important;
transition: allmargin-right 0.3s ease;
}
.claude-error {
Line 219 ⟶ 205:
padding: 8px;
border-radius: 4px;
}
#.claude-pagesidebar-wrapperhidden body {
displaymargin-right: flex0 !important;
}
.claude-sidebar-hidden #claude-proofreader-sidebar {
Line 228 ⟶ 217:
`;
document.head.appendChild(style);
// Add wrapper and sidebar to body
document.body.appendChild(pageWrapper);
document.body.appendChild(sidebar);
Line 284 ⟶ 270:
const widthPx = newWidth + 'px';
sidebar.style.width = widthPx;
document.body.style.marginRight = widthPx;
this.sidebarWidth = widthPx;
localStorage.setItem('claude_sidebar_width', widthPx);
Line 299 ⟶ 286:
document.body.classList.remove('claude-sidebar-hidden');
if (claudeTab) claudeTab.style.display = 'none';
document.body.style.marginRight = this.sidebarWidth;
this.isVisible = true;
Line 308 ⟶ 297:
document.body.classList.add('claude-sidebar-hidden');
if (claudeTab) claudeTab.style.display = 'list-item';
document.body.appendChild(pageWrapper)style.marginRight = '0';
this.isVisible = false;
Line 313 ⟶ 303:
}
adjustMainContent() {
if (childthis.tagName !== 'SCRIPT'isVisible) {
// No longer needed since we use flexbox layout
document.body.style.marginRight = this.sidebarWidth;
} else }{
document.body.style.marginRight = '0';
});
}
attachEventListeners() {