blobermayne2

can you create a chrome plugin that allows me to explore the web in a "yumi nikki" esque way?

Kodari AI
KodariApr 30 at 12:23 am 10,008 (v2)

I’ll create a surreal web exploration extension inspired by Yume Nikki’s dreamlike atmosphere.

DreamWebExplorer
Transform your web browsing into a surreal, dreamlike experience inspired by Yume Nikki. Apply various reality-distorting effects to any webpage including glitch animations, dream-world color palettes, visual distortions, and eerie filters. Switch between different "dream worlds" each with unique visual styles. Features adjustable intensity, random element transformations, and the ability to save favorite distorted pages. Turn ordinary websites into abstract, explorable dreamscapes.

Your Dream Web Explorer extension is ready! Click the extension icon to enter dream mode, then explore any website with surreal visual effects inspired by Yume Nikki.

Features:

  • 🌀 7 Dream Worlds - Each with unique visual distortions (Neon, Monochrome, Glitch, Pastel, Decay, Underwater, Nexus)

  • 🎚️ Adjustable Intensity - Control how surreal things get (1-10)

  • ✨ Random Events - Elements randomly distort and transform as you browse

  • 📺 Glitch Effects - Periodic screen glitches for that corrupted reality feeling

  • 🎲 Randomize - Jump to a random dream world instantly

Navigate regular websites and watch them transform into abstract, dreamlike landscapes!

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 826
content.js
// Dream state
let dreamActive = false;
let currentWorld = 'nexus';
let intensity = 5;
let randomEventsEnabled = true;
let glitchEnabled = true;
let randomInterval = null;
let glitchInterval = null;

// Initialize on load
chrome.storage.local.get(['dreamActive', 'currentWorld', 'intensity', 'randomEvents', 'glitchFx'], (data) => {
  dreamActive = data.dreamActive || false;
  currentWorld = data.currentWorld || 'nexus';
  intensity = data.intensity || 5;
  randomEventsEnabled = data.randomEvents !== false;
  glitchEnabled = data.glitchFx !== false;
  
  if (dreamActive) {
    activateDream();
  }
});

// Listen for messages from popup
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
  if (message.action === 'enableDream') {
    dreamActive = true;
    activateDream();
  } else if (message.action === 'disableDream') {
    dreamActive = false;
    deactivateDream();
  } else if (message.action === 'changeWorld') {
    currentWorld = message.world;
    if (dreamActive) {
      applyWorldEffects();
    }
  } else if (message.action === 'changeIntensity') {
    intensity = message.intensity;
    if (dreamActive) {
      applyWorldEffects();
    }
  } else if (message.action === 'toggleRandomEvents') {
    randomEventsEnabled = message.enabled;
    if (dreamActive) {
      if (randomEventsEnabled) {
        startRandomEvents();
      } else {
        stopRandomEvents();
      }
    }
  } else if (message.action === 'toggleGlitch') {
    glitchEnabled = message.enabled;
    if (dreamActive) {
      if (glitchEnabled) {
        startGlitchEffects();
      } else {
        stopGlitchEffects();
      }
    }
  }
  
  sendResponse({ success: true });
  return true;
});

function activateDream() {
  document.body.classList.add('dream-active');
  applyWorldEffects();
  
  if (randomEventsEnabled) {
    startRandomEvents();
  }
  
  if (glitchEnabled) {
    startGlitchEffects();
  }
}

function deactivateDream() {
  document.body.classList.remove('dream-active');
  document.body.removeAttribute('data-dream-world');
  document.body.removeAttribute('data-dream-intensity');
  
  stopRandomEvents();
  stopGlitchEffects();
  
  // Remove random transformations
  document.querySelectorAll('.dream-distorted').forEach(el => {
    el.classList.remove('dream-distorted');
    el.style.transform = '';
    el.style.filter = '';
  });
}

function applyWorldEffects() {
  document.body.setAttribute('data-dream-world', currentWorld);
  document.body.setAttribute('data-dream-intensity', intensity);
}

function startRandomEvents() {
  stopRandomEvents();
  
  const baseInterval = 5000;
  const intervalTime = baseInterval - (intensity * 300);
  
  randomInterval = setInterval(() => {
    randomDistortElement();
  }, Math.max(intervalTime, 1000));
}

function stopRandomEvents() {
  if (randomInterval) {
    clearInterval(randomInterval);
    randomInterval = null;
  }
}

function startGlitchEffects() {
  stopGlitchEffects();
  
  const baseInterval = 8000;
  const intervalTime = baseInterval - (intensity * 500);
  
  glitchInterval = setInterval(() => {
    applyGlitchEffect();
  }, Math.max(intervalTime, 2000));
}

function stopGlitchEffects() {
  if (glitchInterval) {
    clearInterval(glitchInterval);
    glitchInterval = null;
  }
}

function randomDistortElement() {
  // Get random visible element
  const elements = Array.from(document.querySelectorAll('p, h1, h2, h3, img, div, span, a, button'))
    .filter(el => {
      const rect = el.getBoundingClientRect();
      return rect.width > 20 && rect.height > 20 && rect.top < window.innerHeight && rect.bottom > 0;
    });
  
  if (elements.length === 0) return;
  
  const element = elements[Math.floor(Math.random() * elements.length)];
  const duration = 2000 + Math.random() * 3000;
  
  element.classList.add('dream-distorted');
  
  const transforms = [
    `skewX(${(Math.random() - 0.5) * intensity * 2}deg)`,
    `skewY(${(Math.random() - 0.5) * intensity * 2}deg)`,
    `rotate(${(Math.random() - 0.5) * intensity}deg)`,
    `scale(${1 + (Math.random() - 0.5) * intensity * 0.1})`,
    `translateX(${(Math.random() - 0.5) * intensity * 3}px)`
  ];
  
  const filters = [
    `hue-rotate(${Math.random() * intensity * 20}deg)`,
    `saturate(${100 + (Math.random() - 0.5) * intensity * 30}%)`,
    `brightness(${100 + (Math.random() - 0.5) * intensity * 20}%)`
  ];
  
  element.style.transform = transforms[Math.floor(Math.random() * transforms.length)];
  element.style.filter = filters.join(' ');
  element.style.transition = `all ${duration}ms ease-in-out`;
  
  // Reset after duration
  setTimeout(() => {
    element.classList.remove('dream-distorted');
    element.style.transform = '';
    element.style.filter = '';
  }, duration);
}

function applyGlitchEffect() {
  document.body.classList.add('dream-glitching');
  
  setTimeout(() => {
    document.body.classList.remove('dream-glitching');
  }, 300);
}