跳到正文

个人记录

一些有用の小工具合集

Forever_Rain约 29 分钟
原文

这是 2025年9月8日 存档的第 4 版,不是当前版本。查看当前版本

文章信息与版本

文章信息

收录
2025年12月12日
更新
2025年12月12日
篇幅
约 29 分钟

版本

  1. v5当前
  2. v4
  3. v3
  4. v2
更早的 1 个版本
  1. v1

虽然转载但是持续更新,欢迎投稿qwq

目录:

  1. 排版

  2. 删犇器

  3. 犇犇屏蔽器

  4. 洛谷颜色对照表


排版

排版

我是居中

我是右居中

CF 风格 epigraph

大家好啊,我是说的道理,今天来点大家想看的东西。

——otto
我是标题

大家好啊,我是说的道理,今天来点大家想看的东西。

我是警告
不要
滥用
嵌套

不然会被 chen_zhe 封号!!!!!

∑i=1n∑j=1ngcd⁡(i,j)\displaystyle\sum_{i = 1}^n \sum_{j = 1}^n \gcd(i, j)

数学公式也是可以出现在标题上的。

Markdown:

Markdown
## 排版


:::align{center}


![](https://cdn.luogu.com.cn/upload/usericon/1.png)


## 我是居中

:::

:::align{right}


### 我是右居中

:::

## CF 风格 epigraph

:::epigraph[——otto]
大家好啊,我是说的道理,今天来点大家想看的东西。
:::

::::info[我是标题]
大家好啊,我是说的道理,今天来点大家想看的东西。
::::

::::::warning[我是警告]

:::::warning[不要]

::::warning[滥用]

:::warning[嵌套]
不然会被 chen_zhe 封号!!!!!
:::
::::
:::::
::::::

::::success[$$\displaystyle\sum_{i = 1}^n \sum_{j = 1}^n \gcd(i, j)$$]
数学公式也是可以出现在标题上的。
::::
删犇器

输入下方的这段代码。

JavaScript
switchMode('my');
function load(){
	console.log('page '+feedPage);
	$.get("/feed/"+feedMode+"?page="+feedPage,function(resp){
		$feed.append(resp);
		$("#feed-more").children("a").text("点击查看更多...")
		$("[name=feed-delete]").click(function(){
			$.post("/api/feed/delete/"+$(this).attr('data-feed-id'), function (){switchMode('all');})
		});feedPage++;
		if(resp.indexOf('没有更多动态了')!=-1) console.log('finished');
		else setTimeout(load, 200);
	});
}setTimeout(load, 1000)

等待完成。接着输入以下代码:

JavaScript
var l=$('#feed>li>div.am-comment-main>header>div>a:nth-child(2)');
function f(i){
$.post("/api/feed/delete/"+$(l[i]).attr('data-feed-id'),function(){
console.log(i);
if(i<l.length-1)setTimeout(`f(${i+1})`,200);})
}f(0);

@Kevin1211的补充:如果你控制台中输完了之后删掉了全部犇犇然后一直报错,输入如下代码:

JavaScript
const highestId = setTimeout(() => {}, 0);
    for (let i = highestId; i >= 0; i--) {
      clearTimeout(i);
      clearInterval(i);
    }
  1. 如果出现 503\rm 503 界面重新再次重复上述过程。

直到删完为止,重新加载整个界面,建议重启浏览器。

犇犇屏蔽器
JavaScript
// ==UserScript==
// @name         洛谷犇犇屏蔽工具
// @namespace    https://www.luogu.com.cn/user/1510406
// @version      1.1
// @description  屏蔽指定用户的犇犇
// @author       FlowerRed
// @match        *://www.luogu.com.cn/
// @grant        GM_addStyle
// @grant        GM_setValue
// @grant        GM_getValue
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';

    const buk = 'luogu_benben_block_list';
    const bek = 'luogu_benben_blocker_enabled';
    const minb = 10;

    let ial = false;
    let vbc = 0;
    let bbl = 0;

    GM_addStyle(`
        .lg-benben-blocker-btn { margin-left: 10px; }
        .lbb-movl { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 9999; display: none; justify-content: center; align-items: center; }
        .lbb-mcon { background-color: #fff; padding: 20px 30px; border-radius: 8px; width: 400px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; }
        .lbb-mcon h2 { margin-top: 0; margin-bottom: 20px; text-align: center; color: #333; }
        .lbb-mcon textarea { width: 100%; height: 150px; resize: vertical; margin-bottom: 15px; padding: 8px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; }
        .lbb-mcon .srow { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
        .lbb-mcon .disc { font-size: 12px; color: #888; margin-top: 15px; text-align: center; }
        .lbb-mcon .mbtns { display: flex; justify-content: flex-end; gap: 10px; }
        .switch { position: relative; display: inline-block; width: 50px; height: 28px; }
        .switch input { opacity: 0; width: 0; height: 0; }
        .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 28px; }
        .slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
        input:checked + .slider { background-color: #3498db; }
        input:checked + .slider:before { transform: translateX(22px); }
    `);

    function bb() {
        const on = GM_getValue(bek, true);
        if (!on) {
            document.querySelectorAll('#feed .feed-li[data-blocked="true"]').forEach(el => {
                el.style.display = '';
                el.removeAttribute('data-blocked');
            });
            return;
        }

        const ul = GM_getValue(buk, []);
        if (ul.length === 0) return;
        const us = new Set(ul);

        const its = document.querySelectorAll('#feed .feed-li:not([data-p])');
        its.forEach(it => {
            it.setAttribute('data-p', '1');
            const ue = it.querySelector('.feed-username a:first-child');
            if (ue) {
                const u = ue.textContent.trim();
                if (us.has(u)) {
                    it.style.display = 'none';
                    it.setAttribute('data-blocked', 'true');
                }
            }
        });
    }

    function csm() {
        const mo = document.createElement('div');
        mo.className = 'lbb-movl';
        mo.innerHTML = `
            <div class="lbb-mcon">
                <h2>犇犇屏蔽设置</h2>
                <div class="srow">
                    <span>启用屏蔽功能</span>
                    <label class="switch">
                        <input type="checkbox" id="lbb-tg">
                        <span class="slider"></span>
                    </label>
                </div>
                <label for="lbb-usrs">屏蔽用户名列表 (一行一个):</label>
                <textarea id="lbb-usrs"></textarea>
                <div class="mbtns">
                    <button class="am-btn am-btn-default am-btn-sm" id="lbb-cancel">取消</button>
                    <button class="am-btn am-btn-primary am-btn-sm" id="lbb-save">保存</button>
                </div>
                <p class="disc">改动设置后,可能需要手动刷新页面以生效。</p>
                <p class="disc">同时,本插件还具有以下功能:当用户点击"点击查看更多..."后,若新刷出来的犇犇在屏蔽后的剩余数量过少,则自动点击"点击查看更多..."直到数量&nbsp;≥10。此功能的目的是防止因为屏蔽的犇犇数量过多而导致的点击刷新后没有或只有极少量犇犇被刷出来。</p>
                <p class="disc">Developed&nbsp;by&nbsp;<a href="https://www.luogu.com.cn/user/1510406">@FlowerRed</a>.</p>
            </div>
        `;
        document.body.appendChild(mo);
        const ta = document.getElementById('lbb-usrs');
        const tg = document.getElementById('lbb-tg');
        const cd = mo.querySelector('.lbb-mcon');
        cd.addEventListener('click', e => e.stopPropagation());
        mo.addEventListener('click', () => { mo.style.display = 'none'; });
        document.getElementById('lbb-cancel').addEventListener('click', () => { mo.style.display = 'none'; });
        document.getElementById('lbb-save').addEventListener('click', () => {
            const usrs = ta.value.split('\n').map(u => u.trim()).filter(Boolean);
            const on = tg.checked;
            GM_setValue(buk, usrs);
            GM_setValue(bek, on);
            mo.style.display = 'none';
            document.querySelectorAll('#feed .feed-li[data-p]').forEach(el => {
                el.removeAttribute('data-p');
            });
            bb();
        });
        return mo;
    }

    function osm(m) {
        const ul = GM_getValue(buk, []);
        const on = GM_getValue(bek, true);
        document.getElementById('lbb-usrs').value = ul.join('\n');
        document.getElementById('lbb-tg').checked = on;
        m.style.display = 'flex';
    }

    function clm() {
        if (!ial) return;

        const allb = document.querySelectorAll('#feed .feed-li');
        const newb = Array.from(allb).slice(bbl);

        let nvc = 0;
        newb.forEach(b => {
            if (b.style.display !== 'none') {
                nvc++;
            }
        });
        vbc += nvc;

        const lml = document.querySelector('#feed-more a');
        const lmb = document.getElementById('feed-more');

        if (vbc < minb && lml && lmb && window.getComputedStyle(lmb).display !== 'none' && lml.textContent.includes('点击查看更多')) {
            bbl = allb.length;
            lml.click();
        } else {
            ial = false;
        }
    }

    function obf() {
        const fe = document.getElementById('feed');
        if (!fe) {
            setTimeout(obf, 500);
            return;
        }

        bb();

        ial = true;
        vbc = document.querySelectorAll('#feed .feed-li:not([style*="display: none"])').length;
        bbl = document.querySelectorAll('#feed .feed-li').length;

        const obs = new MutationObserver((mls) => {
            for(const mut of mls) {
                if (mut.type === 'childList' && mut.addedNodes.length > 0) {
                    bb();
                    clm();
                    break;
                }
            }
        });

        obs.observe(fe, { childList: true });
    }

    function init() {
        const sb = document.getElementById('feed-submit');
        if (!sb) {
            setTimeout(init, 500);
            return;
        }

        const setb = document.createElement('button');
        setb.textContent = '屏蔽设置';
        setb.className = 'am-btn am-btn-secondary am-btn-sm lg-benben-blocker-btn';
        const m = csm();
        setb.addEventListener('click', () => osm(m));
        sb.parentNode.insertBefore(setb, sb.nextSibling);

        const lmb = document.querySelector('#feed-more');
        if (lmb) {
            lmb.addEventListener('click', () => {
                if (!ial) {
                    ial = true;
                    vbc = 0;
                    bbl = document.querySelectorAll('#feed .feed-li').length;
                }
            });
        }
        obf();
    }

    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', init);
    } else {
        init();
    }

})();
颜色对照表
颜色十六进制RGB值颜色十六进制RGB值AC绿52C41A(82,196,26)入门红FE4C61(254,76,97)WA红E74C3C(231,76,60)普及-橙F39C11(243,156,17)RE紫9D3DCF(157,61,207)普及黄FFC116(255,193,22)CE黄FADB14(250,219,20)普及+提高 绿52C41A(82,196,26)TLE黑052242(5,34,66)提高+省选-蓝3498DB(52,152,219)MLE黑052242(5,34,66)省选紫9D3DCF(157,61,207)OLE黑052242(5,34,66)NOI黑0E1D69(14,39,105)UKE蓝0E1D69(14,29,105)未评定灰BFBFBF(191,191,191)紫名8E44AD(142,68,173)排行绿52C41A(82,196,26)红名E74C3C(231,76,60)排行橙F39C11(243,156,17)橙名E67E22(230,126,34)排行黄FADB14(250,219,20)绿名5EB95E(94,185,94)排行红E74C3C(231,76,60)蓝名0E90D2(14,144,210)通过钩绿52C41A(82,196,26)灰名BFBFBF(191,191,191)不通过叉红E74C3C(231,76,60)吉利红E74C3C(231,76,60)官方比赛红E74C3C(231,76,60)中平绿5EB95E(94,185,94)团队比赛绿054310(5,67,16)凶兆黑000000(0,0,0)个人比赛蓝3498DB(52,152,219)ACM制紫8E44AD(142,68,173)Rated绿5EB95E(94,185,94)IOI制黄F1C40F(241,196,15)未开始绿5EB95E(94,185,94)乐多制黄F1C40F(241,196,15)已结束红E74C3C(231,76,60)OI制橙F39C11(243,156,17)进行中*暂时无暂时无背景灰EFEFEF(239, 239, 239)小字灰7F7F7F(127,127,127)按钮蓝0E90D2(14,144,210)链接蓝3498DB(52,152,219)按钮红DD514C(221,81,76)通过率蓝3498DB(52,152,219)金钩黄FFE169(255,225,105)背景粉F5CECD(245,206,205)绿钩绿5EB95E(94,185,94)背景绿C9E7C9(201,231,201)蓝钩蓝3498DB(52,152,219)背景蓝CAEBFB(202,235,251)题目来源蓝3498DB(52,152,219)灰色7F7F7F(127,127,127)题目算法红E74C3C(231,76,60)白色FFFFFF(255,255,255)题目地点绿52C41A(82,196,26)黑色000000(0,0,0)\def\arraystretch{1.2} \begin{array}{|c|l|l||c|l|l|} \hline 颜色 & 十六进制 & RGB值 & 颜色 & 十六进制 & RGB值 \\ \hline \color{#52C41A}\text{AC绿} & \text{52C41A} & \text{(82,196,26)} & \color{#FE4C61}\text{入门红} & \text{FE4C61} & \text{(254,76,97)} \\ \hline \color{#E74C3C}\text{WA红} & \text{E74C3C} & \text{(231,76,60)} & \color{#F39C11}\text{普及-橙} & \text{F39C11} & \text{(243,156,17)} \\ \hline \color{#9D3DCF}\text{RE紫} & \text{9D3DCF} & \text{(157,61,207)} & \color{#FFC116}\text{普及黄} & \text{FFC116} & \text{(255,193,22)}\\ \hline \color{#FADB14}\text{CE黄} & \text{FADB14} & \text{(250,219,20)} & \color{#52C41A}\text{普及+提高 绿} & \text{52C41A} & \text{(82,196,26)} \\ \hline \color{#052242}\text{TLE黑} & \text{052242} & \text{(5,34,66)} & \color{#3498DB}\text{提高+省选-蓝} & \text{3498DB} & \text{(52,152,219)} \\ \hline \color{#052242}\text{MLE黑} & \text{052242} & \text{(5,34,66)} & \color{#9D3DCF}\text{省选紫} & \text{9D3DCF} & \text{(157,61,207)} \\ \hline \color{#052242}\text{OLE黑} & \text{052242} & \text{(5,34,66)} & \color{#0E1D69}\text{NOI黑} & \text{0E1D69} & \text{(14,39,105)} \\ \hline \color{#0E1D69}\text{UKE蓝} & \text{0E1D69} & \text{(14,29,105)} & \color{#BFBFBF}\text{未评定灰} & \text{BFBFBF} & \text{(191,191,191)} \\ \hline \hline \color{#8E44AD}\text{紫名} & \text{8E44AD} & \text{(142,68,173)} & \color{#52C41A}\text{排行绿} & \text{52C41A} & \text{(82,196,26)} \\ \hline \color{#E74C3C}\text{红名} & \text{E74C3C} & \text{(231,76,60)} & \color{#F39C11}\text{排行橙} & \text{F39C11} & \text{(243,156,17)} \\ \hline \color{#E67E22}\text{橙名} & \text{E67E22} & \text{(230,126,34)} & \color{#FADB14}\text{排行黄} & \text{FADB14} & \text{(250,219,20)} \\ \hline \color{#5EB95E}\text{绿名} & \text{5EB95E} & \text{(94,185,94)} & \color{#E74C3C}\text{排行红} & \text{E74C3C} & \text{(231,76,60)}\\ \hline \color{#0E90D2}\text{蓝名} & \text{0E90D2} & \text{(14,144,210)} & \color{#52C41A}\text{通过钩绿} & \text{52C41A} & \text{(82,196,26)} \\ \hline \color{#BFBFBF}\text{灰名} & \text{BFBFBF} & \text{(191,191,191)} & \color{#E74C3C}\text{不通过叉红} & \text{E74C3C} & \text{(231,76,60)} \\ \hline \hline \color{#E74C3C}\text{吉利红} & \text{E74C3C} & \text{(231,76,60)} & \color{#E74C3C}\text{官方比赛红} & \text{E74C3C} & \text{(231,76,60)} \\ \hline \color{#5EB95E}\text{中平绿} & \text{5EB95E} & \text{(94,185,94)} & \color{#054310}\text{团队比赛绿} & \text{054310} & \text{(5,67,16)} \\ \hline \color{#000000}\text{凶兆黑} & \text{000000} & \text{(0,0,0)} & \color{#3498DB}\text{个人比赛蓝} & \text{3498DB} & \text{(52,152,219)} \\ \hline \hline \color{#8E44AD}\text{ACM制紫} & \text{8E44AD} & \text{(142,68,173)} & \color{#5EB95E}\text{Rated绿} & \text{5EB95E} & \text{(94,185,94)} \\ \hline \color{#F1C40F}\text{IOI制黄} & \text{F1C40F} & \text{(241,196,15)} & \color{#5EB95E}\text{未开始绿} & \text{5EB95E} & \text{(94,185,94)} \\ \hline \color{#F1C40F}\text{乐多制黄} & \text{F1C40F} & \text{(241,196,15)} & \color{#E74C3C}\text{已结束红} & \text{E74C3C} & \text{(231,76,60)} \\ \hline \color{#F39C11}\text{OI制橙} & \text{F39C11} & \text{(243,156,17)} & \color{#52C410}\text{进行中*} & \text{暂时无} & \text{暂时无} \\ \hline \hline \color{#EFEFEF}\text{背景灰} & \text{EFEFEF} & \text{(239, 239, 239)} & \color{#7F7F7F}\text{小字灰} & \text{7F7F7F} & \text{(127,127,127)} \\ \hline \hline \color{#0E90D2}\text{按钮蓝} & \text{0E90D2} & \text{(14,144,210)} & \color{#3498DB}\text{链接蓝} & \text{3498DB} & \text{(52,152,219)} \\ \hline \color{#DD514C}\text{按钮红} & \text{DD514C} & \text{(221,81,76)} & \color{#3498DB}\text{通过率蓝} & \text{3498DB} & \text{(52,152,219)} \\ \hline \hline \color{#FFE169}\text{金钩黄} & \text{FFE169} & \text{(255,225,105)} & \color{#F5CECD}\text{背景粉} & \text{F5CECD} & \text{(245,206,205)} \\ \hline \color{#5EB95E}\text{绿钩绿} & \text{5EB95E} & \text{(94,185,94)} & \color{#C9E7C9}\text{背景绿} & \text{C9E7C9} & \text{(201,231,201)} \\ \hline \color{#3498DB}\text{蓝钩蓝} & \text{3498DB} & \text{(52,152,219)} & \color{#CAEBFB}\text{背景蓝} & \text{CAEBFB} & \text{(202,235,251)} \\ \hline \hline \color{#3498DB}\text{题目来源蓝} & \text{3498DB} & \text{(52,152,219)} &\color{#7F7F7F}\text{灰色} & \text{7F7F7F} & \text{(127,127,127)} \\ \hline \color{#E74C3C}\text{题目算法红} & \text{E74C3C} & \text{(231,76,60)}& \color{#FFFFFF}\text{白色} & \text{FFFFFF} & \text{(255,255,255)} \\ \hline \color{#52C41A}\text{题目地点绿} & \text{52C41A} & \text{(82,196,26)}& \color{#000000}\text{黑色} & \text{000000} & \text{(0,0,0)} \\ \hline \end{array}