aicu体验优化

优化aicu

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         aicu体验优化
// @namespace    https://www.aicu.cc/
// @version      1.1
// @description  优化aicu
// @author       Darknights
// @match        *.aicu.cc/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=aicu.cc
// @grant        none
// @license      MIT
// ==/UserScript==

'use strict';

setInterval(function () {
    const content = document.querySelector("#content");
    if (content) {
        content.style.display = 'flex';
        content.style.flexWrap = 'wrap';
        content.style.width = '70%';
        content.style.marginLeft = '15%';
    }

    const cards = document.querySelectorAll("#content > .card");
    for (const card of cards) {
        card.style.width = '30%';
        card.style.maxWidth = 'auto';
        card.style.minWidth = '400px';
    }
}, 500);

function removeBackground() {
    document.body.style.backgroundImage = 'url("#")';
    document.body.style.backgroundColor = '#767d72';
}

let rbId = setInterval(function () {
    if (location.search.split('&')[0].indexOf('uid') > -1) {
        clearInterval(rbId);
        return;
    }
    if (document.body.style.backgroundImage === 'url("#")') {
        clearInterval(rbId);
        return;
    }
    removeBackground();
}, 10);