主题切换: - 抽出 useTheme 全局单例,主题在挂载前初始化,登录页不再闪白底 - 用 View Transitions API 以点击点为圆心做圆形揭示;不支持的浏览器 加 .no-vt 类退化为整页淡变,两者互斥避免揭示区露出过渡中的颜色 - 尊重 prefers-reduced-motion;过渡被浏览器跳过时静默降级为直接切换 - 主题按钮图标旋转切换 新规则: - bilibili-private-message:向指定 UID 发送 B 站私信, 发送者 UID 自动从账号 Cookie 读取 视觉打磨: - 统计数字改为缓出计数动画,等宽数字避免跳动时抖动 - 补 :focus-visible 焦点环 说明:当前 SDK 未提供视频投稿接口,无法支持定时投稿视频, 详见 docs/bilibili-config.md。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
35 lines
863 B
Go
35 lines
863 B
Go
package bilibili
|
|
|
|
import (
|
|
"context"
|
|
"log"
|
|
|
|
"github.com/ssdomei232/goodBaby/model"
|
|
)
|
|
|
|
// BilibiliDynamicExecutor B站动态执行器
|
|
type BilibiliDynamicExecutor struct{}
|
|
|
|
func (e *BilibiliDynamicExecutor) GetType() string {
|
|
return RuleTypeDynamic
|
|
}
|
|
|
|
func (e *BilibiliDynamicExecutor) Execute(ctx context.Context, rule *model.Rule) error {
|
|
log.Printf("执行B站动态规则: %s (ID: %d)", rule.Name, rule.ID)
|
|
|
|
return SendBiliDynamicMsg(ctx, rule)
|
|
}
|
|
|
|
// BilibiliPrivateMessageExecutor B站私信执行器
|
|
type BilibiliPrivateMessageExecutor struct{}
|
|
|
|
func (e *BilibiliPrivateMessageExecutor) GetType() string {
|
|
return RuleTypePrivateMessage
|
|
}
|
|
|
|
func (e *BilibiliPrivateMessageExecutor) Execute(ctx context.Context, rule *model.Rule) error {
|
|
log.Printf("执行B站私信规则: %s (ID: %d)", rule.Name, rule.ID)
|
|
|
|
return SendBiliPrivateMessage(ctx, rule)
|
|
}
|