Advertisement
InfraRaven

bunny

Apr 19th, 2025
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function () {
  2.     if (OWOP.bunnyRun) return OWOP.bunnyRun.toggle();
  3.  
  4.     const container = document.getElementById("toole-container");
  5.     if (!container) return alert("Tool container not found");
  6.  
  7.     const tools = [...container.children];
  8.     OWOP.bunnyRun = {
  9.         active: true,
  10.         tools: tools,
  11.         positions: [],
  12.         ears: [],
  13.         setup() {
  14.             container.style.overflow = "visible";
  15.             this.tools.forEach((tool, i) => {
  16.                 tool.style.position = "absolute";
  17.                 tool.style.left = "0px";
  18.                 tool.style.top = i * 42 + "px";
  19.                 this.positions[i] = { x: 0, y: i * 42 };
  20.  
  21.                 // Add bunny ears
  22.                 const ear = document.createElement("div");
  23.                 ear.style.position = "absolute";
  24.                 ear.style.top = "-8px";
  25.                 ear.style.left = "6px";
  26.                 ear.style.width = "8px";
  27.                 ear.style.height = "12px";
  28.                 ear.style.background = "#fff";
  29.                 ear.style.borderRadius = "4px 4px 0 0";
  30.                 ear.style.border = "1px solid #000";
  31.                 ear.style.zIndex = "9";
  32.                 tool.appendChild(ear);
  33.                 this.ears[i] = ear;
  34.  
  35.                 // Hopping behavior
  36.                 tool.onmouseover = () => this.jump(i);
  37.             });
  38.         },
  39.         jump(i) {
  40.             const pos = this.positions[i];
  41.             const dx = (Math.random() - 0.5) * 80;
  42.             const dy = (Math.random() - 0.5) * 80;
  43.             pos.x += dx;
  44.             pos.y += dy;
  45.             const tool = this.tools[i];
  46.             tool.style.left = pos.x + "px";
  47.             tool.style.top = pos.y + "px";
  48.         },
  49.         toggle() {
  50.             this.active = !this.active;
  51.             if (!this.active) {
  52.                 this.tools.forEach((tool, i) => {
  53.                     tool.style.left = "0px";
  54.                     tool.style.top = i * 42 + "px";
  55.                     this.positions[i] = { x: 0, y: i * 42 };
  56.                 });
  57.             }
  58.         }
  59.     };
  60.  
  61.     OWOP.bunnyRun.setup();
  62. })();
  63.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement