Reworking css

This commit is contained in:
tyler
2026-05-19 01:49:18 -04:00
parent 83494bb023
commit 78941479db
+14 -8
View File
@@ -880,23 +880,29 @@ FRONTEND_JS_TEMPLATE = r"""
// Move AI Overview outside #answers, place it before #results // Move AI Overview outside #answers, place it before #results
(function relocateBox() { (function relocateBox() {
const answersDiv = document.getElementById('answers'); const answersDiv = document.getElementById('answers');
const resultsDiv = document.getElementById('results') ||
document.querySelector('.results') ||
document.querySelector('#urls');
if (!box || !answersDiv) return; if (!box || !answersDiv) return;
// Create our own container // Create our own container
const aiContainer = document.createElement('div'); const aiContainer = document.createElement('div');
aiContainer.id = 'ai-answers'; aiContainer.id = 'ai-answers';
aiContainer.style.cssText = 'margin-bottom: 1rem;'; aiContainer.style.cssText = [
'background: var(--color-answer-background)',
'padding: 1rem',
'margin: 0 0 1rem 0',
'color: var(--color-answer-font)',
'border-radius: 8px',
'box-sizing: border-box',
'width: 100%'
].join('; ');
// Move our box into the new container // Move our box into the new container
aiContainer.appendChild(box); aiContainer.appendChild(box);
// Insert before results, or before #answers if no results found const resultsGrid = document.getElementById('results');
if (resultsDiv) { if (resultsGrid) {
resultsDiv.parentNode.insertBefore(aiContainer, resultsDiv); // Insert as first child of #results grid so grid-area:answers applies
resultsGrid.insertBefore(aiContainer, resultsGrid.firstChild);
} else { } else {
answersDiv.parentNode.insertBefore(aiContainer, answersDiv); answersDiv.parentNode.insertBefore(aiContainer, answersDiv);
} }
@@ -2056,7 +2062,7 @@ class SXNGPlugin(Plugin):
.replace("__JS_Q__", js_q) .replace("__JS_Q__", js_q)
html_payload = f''' html_payload = f'''
<article id="sxng-stream-box" class="answer" style="display:none; margin-top: 0; margin-bottom: 0;"> <article id="sxng-stream-box" class="answer" style="display:none; margin: 0; padding: 0;">
<style> <style>
@keyframes sxng-fade-pulse {{ @keyframes sxng-fade-pulse {{
0%, 100% {{ opacity: 0.1; }} 0%, 100% {{ opacity: 0.1; }}