Communitygithub.com

ComeOnOliver/skillshub

实现、审查或改进 SwiftUI 功能,使用 iOS 26+ 的 Liquid Glass API。当被要求在新 SwiftUI UI 中采用 Liquid Glass、重构现有功能或审查 Liquid Glass 使用的正确性、性能和设计一致性时使用。

skillshub 是什么?

该技能专注于指导开发者使用 iOS 26 及以上版本引入的 Liquid Glass API 来构建、审查或改进 SwiftUI 功能。它强调优先使用原生 API(如 `glassEffect`、`GlassEffectContainer` 和玻璃按钮样式),而非自定义模糊效果,以确保与苹果设计准则一致。技能提供了一条决策树,帮助用户根据当前任务(审查现有功能、改进功能或实现新功能)选择正确的路径。核心指导原则包括:正确排列修饰符顺序、使用 `GlassEffectContainer` 管理多个玻璃元素、仅在可交互元素上应用 `.interactive()` 修饰符,并通过 `#available(iOS 26, *)` 提供向后兼容的降级方案。此外,技能还包含了详细的审查清单、实现清单和可直接使用的代码片段,覆盖了从形状一致性到变形过渡(使用 `glassEffectID` 和 `@Namespace`)等关键方面。该技能适用于任何基于 iOS 的 SwiftUI 项目,尤其是需要现代玻璃视觉效果的应用,如工具、设置面板或卡片式界面。支持的平台包括所有支持 iOS 26+ 的苹果设备,并可扩展到 visionOS 和 macOS 的相关场景。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/dimillian/swiftui-liquid-glass

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

SwiftUI Liquid Glass

概述

使用此技能来构建或审查完全符合 iOS 26+ Liquid Glass API 的 SwiftUI 功能。优先使用原生 API(glassEffect、GlassEffectContainer、玻璃按钮样式)和 Apple 设计指南。保持用法一致,在需要的地方实现交互,并注意性能。

工作流程决策树

根据请求选择相应路径:

1) 审查现有功能

  • 检查应该在哪些地方使用 Liquid Glass,以及哪些地方不应使用。
  • 验证修饰符顺序、形状使用和容器放置是否正确。
  • 检查是否正确处理了 iOS 26+ 的可用性,并提供了合理的降级方案。

2) 使用 Liquid Glass 改进功能

  • 确定需要应用玻璃效果的目标组件(表面、标签、按钮、卡片)。
  • 在多个玻璃元素同时出现时,重构为使用 GlassEffectContainer。
  • 仅对可点击或可获得焦点的元素引入交互式玻璃效果。

3) 使用 Liquid Glass 实现新功能

  • 首先设计玻璃表面和交互(形状、突出度、分组)。
  • 在布局/外观修饰符之后添加玻璃修饰符。
  • 仅当视图层次结构随动画变化时,才添加变形过渡。

核心指南

  • 优先使用原生 Liquid Glass API,而非自定义模糊效果。
  • 多个玻璃元素共存时使用 GlassEffectContainer。
  • 在布局和视觉修饰符之后应用 .glassEffect(...)。
  • 对响应触摸/指针的元素使用 .interactive()。
  • 保持相关元素的形状一致,以获得统一的视觉效果。
  • 使用 #available(iOS 26, *) 进行条件判断,并提供非玻璃效果的降级方案。

审查清单

  • 可用性: 存在 #available(iOS 26, *) 并带有降级 UI。
  • 组合: 多个玻璃视图包裹在 GlassEffectContainer 中。
  • 修饰符顺序: glassEffect 在布局/外观修饰符之后应用。
  • 交互性: 仅在有用户交互的地方使用 interactive()。
  • 过渡: 使用 glassEffectID 配合 @Namespace 实现变形效果。
  • 一致性: 整个功能中的形状、色调和间距保持一致。

实现清单

  • 定义目标元素和期望的玻璃突出度。
  • 将分组玻璃元素包裹在 GlassEffectContainer 中,并调整间距。
  • 根据需要,使用 .glassEffect(.regular.tint(...).interactive(), in: .rect(cornerRadius: ...))。
  • 对操作按钮使用 .buttonStyle(.glass) / .buttonStyle(.glassProminent)。
  • 当层次结构变化时,使用 glassEffectID 添加变形过渡。
  • 为早期 iOS 版本提供降级材料和视觉效果。

快速代码片段

直接使用这些模式,并根据需要调整形状、色调和间距。

if #available(iOS 26, *) {
    Text("Hello")
        .padding()
        .glassEffect(.regular.interactive(), in: .rect(cornerRadius: 16))
} else {
    Text("Hello")
        .padding()
        .background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 16))
}
GlassEffectContainer(spacing: 24) {
    HStack(spacing: 24) {
        Image(systemName: "scribble.variable")
            .frame(width: 72, height: 72)
            .font(.system(size: 32))
            .glassEffect()
        Image(systemName: "eraser.fill")
            .frame(width: 72, height: 72)
            .font(.system(size: 32))
            .glassEffect()
    }
}
Button("确认") { }
    .buttonStyle(.glassProminent)

资源

  • 参考指南: references/liquid-glass.md
  • 获取最新 API 详情请优先参考 Apple 文档。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

相关技能