npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@proteus-vue/glass

v0.3.0-beta.28

Published

Proteus Glass(G-07):液态玻璃横切能力——preset/intensity/resolve/degrade/capability 纯逻辑 SSOT + <pg-glass> 统一入口的解析与降级决策,零依赖

Readme

@proteus-vue/glass

G-07 液态玻璃(Liquid Glass)横切能力 —— 用统一声明式 API,在各端映射到该端所能达到的最强玻璃实现。 规格:docs/proteus-glass-plan/(02 架构 / 03 能力矩阵 / 07 Web·Skyline / 08 降级 / 09 预设 / 11 审计)。

一句话

<pg-glass> 是业务唯一写入口;本包是它的纯逻辑内核(preset 表 + props 归一 + 三级降级决策 + 能力矩阵),零依赖。

不存在「一套代码五端像素级相同」——框架承诺 L1 基础玻璃(blur + tint + radius + border)全端必达,L2 质感尽力提升,L3 系统材质仅原生端(iOS 26+ / 鸿蒙 NEXT)解锁。

分层

| 层级 | 内容 | 端 | |------|------|----| | L3 系统级 | iOS UIGlassEffect / 鸿蒙 fractal | App 原生 + 高版本 | | L2 高级质感 | noise / 高光边 / 动态形变 | Web·Skyline 可(CSS) | | L1 基础玻璃 | blur + tint + radius + border | 三端必达 ✅ |

用法

<pg-glass preset="navigationBar">…</pg-glass>
<pg-glass preset="card" :noise="0.03">…</pg-glass>
<pg-glass preset="custom" :radius="32" :intensity="1.2" fallback="flat">…</pg-glass>

纯逻辑内核(测试 / 工具 / 其他端 Backend 直接消费):

import { resolveGlass, resolveGlassLevel, glassStyleFor, glassClassList } from '@proteus-vue/glass'

const resolved = resolveGlass({ preset: 'card', radius: 20 })
const level = resolveGlassLevel({ platform: 'web', backdropFilter: true }) // 'l2'
const style = glassStyleFor(resolved, level) // { backdropFilter: 'blur(10px)', background: 'rgba(255,255,255,0.08)', … }

导出

  • GLASS_PRESETS / GLASS_PRESET_NAMES / GLASS_INTENSITY_SCALE — 七内置预设 + 强度缩放(唯一事实源)
  • defineGlassPreset / getGlassPreset / hasGlassPreset — 预设扩展(业务品牌玻璃)
  • resolveGlass(props) — props → ResolvedGlass(preset 为底 + 显式覆盖)
  • resolveGlassLevel(env) — 三级降级决策 → 'l3' | 'l2' | 'l1' | 'solid' | 'flat'
  • glassStyleFor / glassClassList / showsDecoration — 渲染层产物(:style / class)
  • GLASS_CAPABILITY / glassCeilingFor / GLASS_DEGRADE_CHAIN — 平台能力矩阵 + 降级链

降级(不崩溃、不白屏)

resolveGlassLevel 顺序:强制/无障碍(prefers-reduced-transparency)/无 backdrop-filter → solid;低端设备 → l1;原生 + 系统材质 → l3;其余 → l2。能力不足一律降级实色,绝不渲染黑块。

铁律(GLS001-006)

  1. 单入口:业务只写 <pg-glass>,禁止裸 backdrop-filter(GLS001,CI error)
  2. L1 必达:blur + tint + radius + border 全端一致
  3. 降级不崩溃:能力不足 → 实色,禁止白屏/黑块
  4. 无障碍优先:prefers-reduced-transparency 自动关闭玻璃
  5. 系统级仅原生端:L3 只对 iOS/鸿蒙/Android
  6. 嵌套 ≤ 2 层、单页玻璃节点 ≤ 10(性能预算,审计 warn/error)

诚实边界

  • L2/L3 视觉一致性依赖各端系统能力,不保证像素级相同(系统材质差异不可消除)
  • 国内 ROM 私有玻璃特效不可达(系统特权)
  • L3 需真机验证(本包只做能力声明与降级决策)