AIO Side Bar to Floating Windows - grundos.cafe

Moves the AIO Side Bars to separate floating windows.

目前为 2023-10-18 提交的版本。查看 最新版本

// ==UserScript==
// @name             AIO Side Bar to Floating Windows - grundos.cafe
// @namespace        Firestix
// @match            https://www.grundos.cafe/*
// @grant            GM_log
// @grant            GM_addStyle
// @grant            GM_getValue
// @grant            GM_setValue
// @grant            GM_registerMenuCommand
// @require https://greasyfork.org/scripts/477480-floatingwindow/code/FloatingWindow.js?version=1266847
// @version          0.0.1
// @author           Firestix
// @license          MIT
// @description Moves the AIO Side Bars to separate floating windows.
// ==/UserScript==

GM_addStyle(`
.floatingWindowTitleBar {
  background-color:#ffa;
  padding:2px;
  line-height:20px;
}
`);

if (document.getElementById("aio_sidebar")) {
  let categories = document.querySelectorAll("#aio_sidebar > div");
  for (let x = 0, xlen = categories.length; x < xlen; x++) {
    let category = categories[x];
    if (!category.className || category.className === "") continue;
    let title = category.querySelector(".aio-section-header").innerText;
    let bodyElems = category.querySelectorAll(".aioImg > div");
    let fWin = new FloatingWindow(title,{open:false,position:{x:window.innerWidth-200,y:x*24},bodyDisplay:"flex"});
    for (let b of bodyElems) {
      fWin.body.appendChild(b.cloneNode(true))
    }
//     category.style.display = "none";
  }
}