本帖最后由 FengYing 于 2025-6-11 14:50 编辑
原本「我的勋章」排序因为高度和宽度不一致,
显得非常杂乱,
作为强迫症患者实在无法接受。
于是我请GPT帮我优化了展示方式,
现在看起来整齐且舒服多了!
【改进后预览】
【油猴脚本代码】 - // ==UserScript==
- // @name GameMale - 美化「我的勛章」显示
- // @namespace https://www.gamemale.com/space-uid-677863.html
- // @version 1.0
- // @description 调整 我的勛章 勋章排列为表格式
- // @author FengYing
- // @match https://www.gamemale.com/wodexunzhang-showxunzhang.html*
- // @match https://www.gamemale.com/plugin.php?id=wodexunzhang%3Ashowxunzhang&fid=*
- // @match https://www.gamemale.com/plugin.php?id=wodexunzhang%3Ashowxunzhang&action=*
- // @match https://www.gamemale.com/plugin.php?id=wodexunzhang:showxunzhang&action=my
- // @icon https://www.gamemale.com/template/mwt2/extend/img/favicon.ico
- // @grant GM_addStyle
- // ==/UserScript==
- (function() {
- 'use strict';
- GM_addStyle(`
- .myfldiv {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
- gap: 10px;
- justify-content: center;
- }
- .myfldiv .myblok {
- margin: 0;
- height: auto;
- }
- .myfldiv img {
- max-width: 100%;
- max-height: 80px;
- display: block;
- margin: 0 auto;
- }
- .myfldiv .myblok:hover {
- transform: translateY(-5px);
- box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
- transition: all 0.2s ease-in-out;
- }
- .myblok span {
- display: block;
- font-size: 12px;
- margin-top: 5px;
- }
- `);
- })();
复制代码
|