fix: load CSS for floating button on blog sites to restore position and styling
This commit is contained in:
parent
3f9cb2c40f
commit
a1a53fcf07
1 changed files with 12 additions and 0 deletions
12
src/ui.js
12
src/ui.js
|
|
@ -324,6 +324,18 @@ export function createFloatingAIButton() {
|
|||
// Ensure ChunkFive font is loaded
|
||||
initializeChunkFiveFont();
|
||||
|
||||
// Load CSS for floating button if not already loaded
|
||||
const hasPicoCSS = document.querySelector('link[href*="pico"]') !== null;
|
||||
const cssFile = hasPicoCSS ? 'uncloseai-modal-pico.css' : 'uncloseai-modal-builtin.css';
|
||||
|
||||
if (!document.querySelector(`link[href*="${cssFile}"]`)) {
|
||||
const link = document.createElement('link');
|
||||
link.rel = 'stylesheet';
|
||||
link.href = `https://uncloseai.com/src/${cssFile}`;
|
||||
document.head.appendChild(link);
|
||||
console.log(`uncloseai.js: Loaded ${cssFile} for floating button styles.`);
|
||||
}
|
||||
|
||||
// Remove any existing floating button first
|
||||
const existingButton = document.getElementById("floating-ai-button");
|
||||
if (existingButton) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue