返回论坛

【内附模板】简单分享下个人主页美化吧

个人主页装扮 · OPEN SOURCE
OPEN SOURCE / 纯CSS / NO JS

个人主页装扮 · 模板分享PROFILE SKIN · TEMPLATE SHARE

最近平台上了「个人主页」这玩意,浅浅做了五套后感觉还挺好玩的,昨天做了个简单的番长同人主题,决定分享下,让大伙也能方便地整上好看的个人主页,理论上来说换个图链和主题配色就是新的一套皮肤了。完整 CSS 都在下面可以直接复制。虽然 20 级确实高了点,等级没到的也可以先学一下——都是简单的纯 CSS。

虽说开源,不过我技术也很烂,算是抛砖引玉,给大伙提供个骨架和想法;有遗漏或不对的地方还请大佬们轻喷并指正,目的还是为了分享。

FIG.01 · PC 静息 立绘+背景
PC 静息
FIG.02 · PC HOVER 露出作品
PC hover
FIG.03 · 手机纵向流(感谢土豆老师截图)MOBILE
手机
需要注意:该页面和作品内的内置 CSS 一样——都不可以使用 JS,只能用纯 CSS 来搞。
RIKAKU 头像
RIKAKU · 我的主页LIVE
点击跳转至我的主页预览实际美化情况,记得登录~
前往主页 →

能力边界

Capabilities

先划清能做与不能做,少走弯路。

可用
  • 改任意元素样式(色 / 版式 / 字体 / 背景 / 动画 / 伪元素)
  • @font-face 外链字体 woff2
  • @property / 渐变 / mask / clip-path / filter
  • :hover / :has() / 结构伪类 驱动交互
  • @media 响应式(桌面 / 手机)
  • 伪元素 content 注入装饰文字
部分可用
  • 作品卡若干属性被锁,需绕法(见下)
  • :has() / @property 旧内核需降级
  • background-attachment:fixed 手机不稳,改 position:fixed 伪元素
  • 字体子集有限,中文需配兜底
不可用
  • 任何 JavaScript
  • @import 外链 CSS
  • 增 / 删 / 重排 DOM(自定义元素只能用 ::before/::after 模拟)
  • 触达 #profileBuiltInCss 之外
  • 持久"点击切换"状态
  • 替换昵称文本(只可样式化)
关于"点一下翻页并停住":纯 CSS 没有 JS,也不能注入 <input> / 复选框 / #锚点 来"记住点击"。替代:① hover / 手机轻触翻面(鼠标离开会弹回);② 滚动驱动(最稳,内容完全可交互)。
被锁属性(作品卡):background-image / box-shadow / filter / 内层<a>宽度(240px) 改不动。绕法:阴影→filter:drop-shadow 或伪元素;边框→outline;放大→内层 <a>{zoom:1.x};色块/图→伪元素背景。

入口与基本规则

Entry

变量定义在 #profile-page

不要用 :root(会失效)。

字体走 @font-face

禁 @import;外链 cdn.jsdelivr.net/npm/@fontsource/… woff2。

长度上限

CSS 约 10 万字符上限,超出会被拒。

页面全部可设置 ID

ID Map

这是目前扒出来的整个页面 ID,基本每个组件都有了,包括金 / 银 / 无冠作品。我总感觉金银冠的图也能换——自定义冠的时代要到来了吗?

id-tree.txtREF · STRUCTURE
#profileBuiltInCss                          ← 注入根(你的 CSS 只作用在这里面)
└ #profile-page                             ← 整页画布(设背景 / 整体布局 / CSS变量都写这)
  ├ #profile-header-banner                  ← 顶部横幅(头像·昵称·徽章·关注·签名)
  │ ├ #profile-header-avatar                ← 头像框(外层容器)
  │ │ ├ #profile-avatar                     (圆形外壳)
  │ │ │ └ #profile-avatar-image             (头像图 <img>)
  │ │ └ #profile-header-level               (等级牌「32」)
  │ ├ #profile-header-name-row              ← 昵称行
  │ │ ├ #profile-header-personalize-icon    (昵称旁的小图标 svg)
  │ │ └ #profile-user-name                  (昵称文字)
  │ ├ #profile-header-medals                ← 徽章区(成就/勋章图标,无独立子 id)
  │ ├ #profile-header-stats                 ← 关注 / 粉丝区
  │ │ ├ #profile-following                  (关注块)
  │ │ │ ├ #profile-following-label          「关注」二字
  │ │ │ └ #profile-following-value          关注数字
  │ │ └ #profile-followers                  (粉丝块)
  │ │   ├ #profile-followers-label          「粉丝」二字
  │ │   └ #profile-followers-value          粉丝数字
  │ └ #profile-signature                    ← 签名 / 简介
  │   └ #profile-signature-root
  │     └ #profile-signature-box
  │       └ #profile-signature-text         (签名文字本体)
  ├ #profile-decoration-trigger             ← 「个性化」按钮(右下角,也是上传 CSS 的入口)
  └ #profile-tabs                           ← 标签 + 作品区
    ├ #profile-tabs-header                  ← 标签头
    │ ├ #profile-tabs-list
    │ │ └ #profile-tab-work-card            (「我的作品」标签)
    │ │   └ #profile-work-card-tab
    │ │     └ #profile-work-card-type-trigger
    │ ├ #profile-display-mode-trigger       (显示模式切换)
    │ └ #profile-sort-trigger               (「默认排序」)
    └ #profile-tabs-content
      └ #profile-tab-content-work-card
        └ #profile-apps-section
          └ #profile-apps
            └ #profile-apps-grid            ← 作品网格(卡片容器)
              ├ #profile-app-card-<UUID>    每张作品卡(按 UUID,见第二节)
              ├ #profile-apps-empty         (没有作品时的空状态)
              └ #profile-apps-pagination    (翻页器)
金 / 银 / 无冠没有独立 id,藏在卡片首个 <span> 的 img src 文件名,用 :has() 命中:
crown.cssREF · 冠级别
[id^="profile-app-card-"]:has(span:first-child img[src*="gold.webp"]) { /* 金冠 */ }
[id^="profile-app-card-"]:has(span:first-child img[src*="silver.webp"]) { /* 银冠 */ }
[id^="profile-app-card-"]:not(:has(span:first-child img[src*="gold.webp"])):not(:has(span:first-child img[src*="silver.webp"])) { /* 无冠 */ }

完整皮肤源码

GLOSS ONE / Source

整段可复制。换三处图链 + 配色变量,就是一套你的新皮肤。

  • · 左信息列 + 全屏 banner 底图 + 右侧立绘幕(hover 滑开露出作品)
  • · 头像狗牌切角;昵称白字 + 扫光 + 硬阴影
  • · 作品卡流光边框、桌面横向"档案条"
  • · 桌面 / 手机两套布局 + prefers-reduced-motion 降级
主页_hajime.cssFULL · 整段复制
工具卡封面
个人主页美化代码助手
感谢牢塞(光能族猎杀器)做的工具卡,让大家都能简单用上美化。理论上把我提供的 CSS 丢进去,输入「先理解这份 css,然后将整体主题色系改为 xxxxx」;或者细致一些——选一个你需要的 ID(例如勋章区 #profile-header-medals),在帖子里找到对应 id,再说你想改成什么样式、颜色。
打开工具卡 →

重点技巧

Notes
自定义图链(背景 / 立绘 / 手机背景)

三个图变量集中在 #profile-page 令牌区,改这三行即可换图。手机背景 ::before 取用 --img-portrait,与立绘同图;竖图更适合手机。

images.css
--img-banner:url('……');   /* 桌面横幅底图 */
--img-portrait:url('……');  /* 立绘(桌面右侧幕 + 手机背景 共用一张) */
--img-avatar:url('……');   /* 头像 */

换图步骤:上传图片到「创作图库」→ 复制图片直链 → 替换上面的 url('…')。

作品封面替换(让封面更清晰)

平台默认封面是缩略图,放大偏糊;上传高清原图到创作图库,复制图链,用 background-image 覆盖封面区,按冠级别分别指定。

cover.css分冠替换
[id^="profile-app-card-"]>a>div:first-of-type{flex:0 0 230px!important;width:230px!important;border-radius:0!important;overflow:hidden!important;position:relative!important;align-self:stretch!important;background-color:var(--violet-deep)!important;background-size:cover!important;background-position:center 26%!important;background-repeat:no-repeat!important;}
#profile-apps-grid [id^="profile-app-card-"]>a>div:first-of-type img{opacity:0!important;position:absolute!important;width:1px!important;height:1px!important;}
#profile-apps-grid [id^="profile-app-card-"]:has(img[src*="gold.webp"])>a>div:first-of-type{background-image:url(https://catai.wiki/5a69f725-7341-4f49-8dfe-816f595ff500/w=1000)!important;}
#profile-apps-grid [id^="profile-app-card-"]:has(img[src*="silver.webp"])>a>div:first-of-type{background-image:url(https://catai.wiki/f31ffbae-51f4-47c7-b4e8-d76ff7256200/w=1000)!important;}
#profile-apps-grid [id^="profile-app-card-"]:not(:has(img[src*="gold.webp"])):not(:has(img[src*="silver.webp"]))>a>div:first-of-type{background-image:url(https://catai.wiki/0b780f86-8b7d-4b56-3e67-0b3435718d00/w=1000)!important;}
其它通用技巧

!important 会压过 animation

被动画的属性别加 !important,背景用长写法。

绕框流光(border-beam)

@property 角度 + conic-gradient + mask-composite:exclude 做 1px 渐变边环。

hover 揭示

纯 CSS 用 :hover 切 opacity;本皮肤用立绘幕滑开露出作品。

隐藏元素

display:none:头像、关注粉丝、翻页、拉黑按钮。

响应式

手机优先纵向流;@media(min-width:960px) 切桌面双栏。

显示名只样式化

昵称是真实 ID,仅改样式,不用 content 替换文字。

本身开源也是喜欢暖暖,给需要的大伙都能快速上手。理论上把这套 CSS 丢给 AI,让它给你换个主题色 + 图链,就是一套新的了。分享出去就是给大伙弄着玩的——署不署名随意。

↑ TOP
✕ 关闭
轟はじめ - DeepDive * 轟はじめ - DeepDive * 
评论 32
登录后可参与讨论 去登录
还没有评论,来说第一句。
相关帖子