zaron_rw

make me a fox themed Gui

Kodari AI
KodariNov 8 at 3:34 am 1
FoxDenGUI
A fox-themed graphical user interface plugin that transforms standard UI elements into a whimsical woodland experience. Features custom fox avatars, paw-print cursors, autumn leaf color schemes, and animated fox animations across menus and toolbars. Includes themed buttons, sliders, and panels with forest textures, plus a customizable fox companion that reacts to user interactions. Provides settings panel for adjusting fur color, tail size, and ambient sounds like rustling leaves and gentle fox calls.

I’ll build a fox-themed popup with a rotating fox fact and a toggle for a warm glow on the current tab.

zaron_rw

so how do I use this

Kodari AI
KodariNov 8 at 3:35 am 1
  1. Download the extension as a ZIP and unzip it.

  2. In Chrome, open chrome://extensions.

  3. Turn on Developer mode.

  4. Click Load unpacked and select the unzipped folder containing manifest.json.

  5. Click the Extensions puzzle-piece icon and pin the fox extension. Click its icon to open the popup.

Use it on a regular website—not a chrome:// page. If you edit the files later, click Reload on the extension’s card.

Kodari can make mistakes. Review important code before using.
Files
background.js
content.css
content.js
manifest.json
popup.css
popup.html
popup.js
Code
7 480
popup.js
const foxFacts = [
  "Foxes use more than 40 different sounds to communicate with one another.",
  "A fox’s whiskers on its legs help it feel its way through tall grass.",
  "Foxes can hear small animals moving beneath snow.",
  "A group of foxes is sometimes called a skulk or a leash.",
  "Foxes use the Earth’s magnetic field to help them judge pouncing distance.",
  "Fennec foxes have huge ears that help them lose heat in the desert."
];

const modeButton = document.getElementById("modeButton");
const modeLabel = document.getElementById("modeLabel");
const modeStatus = document.getElementById("modeStatus");
const factText = document.getElementById("factText");
const message = document.getElementById("message");
const themeButton = document.getElementById("themeButton");

let activeTabId = null;
let factIndex = Math.floor(Math.random() * foxFacts.length);

document.getElementById("today").textContent = new Intl.DateTimeFormat(undefined, {
  weekday: "long",
  month: "long",
  day: "numeric"
}).format(new Date());

factText.textContent = foxFacts[factIndex];

function setPageMode(enabled) {
  modeButton.setAttribute("aria-pressed", String(enabled));
  modeLabel.textContent = enabled ? "Turn off" : "Turn on";
  modeStatus.textContent = enabled
    ? "A warm woodland glow is wrapped around this page."
    : "Add a little autumn warmth to this page.";
}

async function readPageMode(tabId) {
  const results = await chrome.scripting.executeScript({
    target: { tabId },
    func: () => document.documentElement.classList.contains("kodari-fox-mode")
  });
  return Boolean(results[0]?.result);
}

async function loadPopup() {
  try {
    const { foxTheme } = await chrome.storage.local.get("foxTheme");
    document.documentElement.dataset.theme = foxTheme === "moon" ? "moon" : "sun";
    themeButton.textContent = foxTheme === "moon" ? "Switch to sunrise" : "Switch to moonlight";

    const [tab] = await chrome.tabs.query({ active: true, currentWindow: true });
    activeTabId = tab?.id ?? null;

    if (activeTabId === null) {
      modeButton.disabled = true;
      modeStatus.textContent = "Open a regular webpage to use woodland glow.";
      return;
    }

    setPageMode(await readPageMode(activeTabId));
  } catch (error) {
    console.error("Could not load Foxglow for this page:", error);
    modeButton.disabled = true;
    modeStatus.textContent = "This page can’t be styled. Try a regular website.";
  }
}

modeButton.addEventListener("click", async () => {
  if (activeTabId === null) return;

  modeButton.disabled = true;
  message.textContent = "";

  try {
    const enabled = !(await readPageMode(activeTabId));

    await chrome.scripting.executeScript({
      target: { tabId: activeTabId },
      files: ["content.js"]
    });

    if (enabled) {
      await chrome.scripting.insertCSS({
        target: { tabId: activeTabId },
        files: ["content.css"]
      });
    } else {
      await chrome.scripting.removeCSS({
        target: { tabId: activeTabId },
        files: ["content.css"]
      });
    }

    await chrome.tabs.sendMessage(activeTabId, {
      type: "FOX_MODE",
      enabled
    });

    setPageMode(enabled);
  } catch (error) {
    console.error("Could not toggle woodland glow:", error);
    message.textContent = "This page doesn’t allow the fox glow. Try a regular website.";
  } finally {
    modeButton.disabled = false;
  }
});

document.getElementById("factButton").addEventListener("click", () => {
  if (foxFacts.length > 1) {
    let nextIndex = factIndex;
    while (nextIndex === factIndex) {
      nextIndex = Math.floor(Math.random() * foxFacts.length);
    }
    factIndex = nextIndex;
  }
  factText.textContent = foxFacts[factIndex];
});

themeButton.addEventListener("click", async () => {
  const nextTheme = document.documentElement.dataset.theme === "moon" ? "sun" : "moon";
  document.documentElement.dataset.theme = nextTheme;
  themeButton.textContent = nextTheme === "moon" ? "Switch to sunrise" : "Switch to moonlight";

  try {
    await chrome.storage.local.set({ foxTheme: nextTheme });
  } catch (error) {
    console.error("Could not save Foxglow’s theme:", error);
    message.textContent = "Your theme couldn’t be saved.";
  }
});

loadPopup();