About & credits
What this website does, and the code, writing and fonts that helped build it.
About
A collection of web motion with live demos, clear names and plain-language descriptions. Select an effect to copy a prompt for your AI, or copy its vanilla JavaScript and CSS.
给 AI 用:每个效果都有一份给 AI 读的说明 /effects/<id>.md, with principles, parameters and reference code. JavaScript is not required to read it.
Favorites and recently copied effects stay in your own browser. They are not uploaded.
The author’s website: B.Museum
Credits & licenses
Third-party code, writing and fonts are used under their respective licenses.
Effects
- StyleKit · Stagger ChildrenLicense: MIT (full text)Used in Stagger fade-up. MIT licensed source; original usage note: 改写自它的入场动作和默认值(淡入加上移、每个 500ms、间隔 75ms、ease-out);改成原生 JS,内容默认可见,脚本出错时不会把内容藏住
- Animation Handbook · Clip-Path RevealLicense: MIT (full text)Used in Wipe reveal. MIT licensed source; original usage note: 改写自它的做法(clip-path: inset() 从一边拉开,图片本身不动);改成原生 JS,内容默认完整可见,脚本出错时不会被裁掉;时长从 800ms 调成 900ms,缓动换成两头慢的曲线
- StyleKit · Blur InLicense: MIT (full text)Used in Blur in. MIT licensed source; original usage note: 改写自它的动作(从模糊、透明开始回到清楚,ease-out);改成原生 JS,内容默认可见,脚本出错时不会把内容藏住;默认值从 500ms、10px 调成 700ms、14px,看得出模糊的过程
- StyleKit · Underline DrawLicense: MIT (full text)Used in Underline draw. MIT licensed source; original usage note: 改写自它的动作和默认值(从左往右画出、往右收回,300ms,cubic-bezier(0.4, 0, 0.2, 1),2px);改成原生 JS,键盘选中时也画,中途离开会从当前的位置收回,线的粗细改成参数
- Inspira UI · LensLicense: MIT (full text)Used in Magnifier lens. MIT licensed source; original usage note: 参考了原理(放大的副本加圆形遮罩,以鼠标位置为中心)和出现动画(从 0.58 倍放大、0.3 秒);代码是本站用原生 JS 重写的。原设计来自 Aceternity UI 的 Lens
- StyleKit · Spotlight CardLicense: MIT (full text)Used in Spotlight card. MIT licensed source; original usage note: 改写自它的做法和默认值(卡片上叠一层白色径向光,中心跟着鼠标;进出时 300ms 淡入淡出);改成原生 JS,光放在内容下面,不用 overflow: hidden;加了手机上按住亮起;光斑大小和亮度改成参数
- Animation Handbook · Shared Element TransitionLicense: MIT (full text)Used in Shared element transition. MIT licensed source; original usage note: 改写自它的做法和默认值(FLIP;500ms、cubic-bezier(0.2, 0.7, 0.3, 1);缩小时反算圆角);改成原生 JS 的 Web Animations,直接动切换后的元素,不复制;飞行途中压在旁边的内容上面
- Animation Handbook · Parallax ScrollingLicense: MIT (full text)Used in Parallax scrolling. MIT licensed source; original usage note: 改写自它的做法(远的层动得少、近的层动得多;滚动事件里每帧只排一次更新;用位移,减少动态时各层在原位);改成按区块中心离屏幕中心的距离乘速度(StyleKit 的 parallax-float 也是按距离乘速度),用 translate 属性不碰原来的 transform,可以放在自己会滚动的框里
- Animation Handbook · Marquee / TickerLicense: MIT (full text)Used in Marquee. MIT licensed source; original usage note: 改写自它的做法(内容接上一模一样的副本,挪过一份的宽度就从头再来;按每秒多少像素算一圈多久;鼠标停上去就停;副本不给读屏读);改成原生 JS 的 Web Animations,副本按外框宽度接够、宽度变了重排,没有脚本和减少动态时换行排开
- Animation Handbook · Click / Tap RippleLicense: MIT (full text)Used in Ripple. MIT licensed source; original usage note: 改写自它的做法(按下的地方放一个圆,放大并变淡,播完拿掉;键盘按下的 click 没有位置,从中心长出来;减少动态时只亮一下)和默认值(600ms、ease-out);改成原生 JS 的 Web Animations,半径改成到最远那个角的距离,浓度先保持再变淡,圆放在单独一层里裁剪(按钮自己不加 overflow),浓度改成参数
- StyleKit · Fade In UpLicense: MIT (full text)Used in Fade in up. MIT licensed source; original usage note: 改写自它的动作(从下方一小段、透明开始,往上回到原位,ease-out);改成原生 JS,快进入屏幕时才播,内容默认可见,脚本出错时不会把内容藏住;用 translate 属性,不碰元素原来的 transform;默认值从 600ms、20px 调成 800ms、30px,曲线换成缓一点的 ease-out(滚到时还看得见浮上来)
- Animation Handbook · Typewriter EffectLicense: MIT (full text)Used in Typewriter. MIT licensed source; original usage note: 改写自它的做法(一个字一个字地出现,最后一个字后面跟着光标;读屏读整句,打字的那份不给读屏);改成原生 JS 的 Web Animations,字一开始就排好、没轮到的透明,遇到标点多停一会儿(原版是随机快慢),打完光标闪两下收起,打完换回原来的文字
- StyleKit · Counter RollLicense: MIT (full text)Used in Odometer counter. MIT licensed source; original usage note: 改写自它的做法(每一位一个小窗口,一列数字竖着滚到最终的那一位,只动位置)和缓动;改成原生 JS 的 Web Animations,最终的数字一直写在页面里、只在滚的时候临时拆开,低位多转一两圈、一起停下
- Animation Handbook · Rolling NumbersLicense: MIT (full text)Used in Odometer counter. MIT licensed source; original usage note: 参考它的两条做法:数字等宽(tabular-nums)免得左右晃;滚动的数字不给读屏读,读屏只读最终的数字
- StyleKit · Hand-Drawn AnnotationLicense: MIT (full text)Used in Hand-drawn circle. MIT licensed source; original usage note: 改写自它画线的做法(一笔 SVG 线条,pathLength="1" 加 stroke-dasharray: 1,把 stroke-dashoffset 从 1 拨到 0);画的东西换成本站开屏红笔的那一圈,加了每个圈随机的形状变化,词变大变小时按同一组随机数重画
- StyleKit · Hover LiftLicense: MIT (full text)Used in Hover lift. MIT licensed source; original usage note: 改写自它的 CSS 和默认值(往上 4px、影子变大变深,200ms,cubic-bezier(0.33, 1, 0.68, 1),浮起时的影子);改用 translate 属性,不盖掉原来的 transform;距离、时长、缓动和影子写成 CSS 变量
- Animation Handbook · Hover State AnimationLicense: MIT (full text)Used in Hover lift. MIT licensed source; original usage note: 两条做法:悬停只在能悬停的设备上生效(@media (hover: hover),手机点一下不会一直浮着);键盘选中(:focus-visible)写在这个条件外面,用键盘时也浮起来。没有复制代码
- Animation Handbook · Parallax 3D TiltLicense: MIT (full text)Used in 3D tilt. MIT licensed source; original usage note: 改写自它的做法(按鼠标在卡片上的位置算绕横轴、绕竖轴的角度,鼠标靠哪边哪边往里压,离开时回正;perspective 1000px);参数改成边上倾斜的角度,跟着鼠标和回正用同一个过渡,手机上按住倾斜、不挡页面滚动,减少动态时不倾斜;没有用它的反光、内部视差和放大
- StyleKit · 3D TiltLicense: MIT (full text)Used in 3D tilt. MIT licensed source; original usage note: 对照了同一个算法(rotateX = -y × 最大角度,rotateY = x × 最大角度)和它的提醒(角度保持在 5–15 度、只动 transform、离开时回正);没有复制代码
- Animation Handbook · Magnetic ButtonLicense: MIT (full text)Used in Magnetic button. MIT licensed source; original usage note: 改写自它的做法和默认值(按钮朝鼠标挪过去,离中心越远吸得越弱、到范围边上为零;字多挪 35%;吸力 35%、范围 160px;弹回 550ms cubic-bezier(.22, 1, .36, 1));改成量按钮没被吸动时的位置,只用 translate 属性,键盘选中和手机上不动,减少动态时不动
- StyleKit · Magnetic HoverLicense: MIT (full text)Used in Magnetic button. MIT licensed source; original usage note: 对照了同一个做法(按钮挪过去鼠标到中心距离的 30%,离开弹回)和它的提醒(只动 transform、减少动态时关掉);没有复制代码
- Inspira UI · Link Preview(移植自 Aceternity UI 的 Link Preview)License: MIT (full text)Used in Link preview. MIT licensed source; original usage note: 改写自它的做法(鼠标停在链接上,上方弹出预览图,横向跟着鼠标、不出屏幕;从小放大、冲过头一点再回来);用原生 JS 重写(原版是 Vue),预览图改用自己的封面、不用第三方截图服务,加了停一会儿才弹、预览图放在链接里(挪上去不消失、点它也能打开)、键盘选中时弹出、按 Esc 收起、上面放不下时弹在下面
- Inspira UI · Tracing BeamLicense: MIT (full text)Used in Tracing beam. MIT licensed source; original usage note: 改写自它的做法和样子(文章左边一条淡线,一道前头亮、往后淡掉的光沿着线往下走;默认的青色到靛蓝取自它的渐变);用原生 JS 重写(原版是 Vue 加弹簧),前头的位置改成按读到全文的几成算,光的长度按屏幕高算,前头加了亮点,可以放在自己会滚动的框里
- Animation Handbook · Hide-on-Scroll HeaderLicense: MIT (full text)Used in Hide-on-scroll header. MIT licensed source; original usage note: 改写自它的做法和默认值(往下滑藏起来、往上滑出现、离顶上两条顶栏高以内一直在;6px 以内的抖动不算、只有算数的一次才记下位置;位置限制在能滚的范围里;藏起来推出自身高度再多 2px;键盘选中时出现;减少动态时淡出淡入;300ms、cubic-bezier(0.2, 0.7, 0.3, 1));改用 translate 属性,不盖掉顶栏原来的 transform,减少动态时藏着的顶栏点不到
- StyleKit · Slide SwapLicense: MIT (full text)Used in Slide-fade page transition. MIT licensed source; original usage note: 改写自它的动法和默认值(旧的往左挪 30px 淡出、新的从右边挪 30px 进来淡入,两页同时动;400ms、cubic-bezier(0.16, 1, 0.3, 1));改成 View Transitions 的写法,用 translate 属性,往回走时反过来
- Animation Handbook · View Transitions APILicense: MIT (full text)Used in Slide-fade page transition. MIT licensed source; original usage note: 学它的写法(单页应用用 document.startViewTransition 包住换页的代码,多页网站用 @view-transition { navigation: auto; },动画写在 ::view-transition-old/new(root) 上,不支持时直接换页,减少动态时不做);没有复制代码
- Animation Handbook · FLIP TechniqueLicense: MIT (full text)Used in FLIP layout animation. MIT licensed source; original usage note: 改写自它的做法和默认值(First、Last、Invert、Play;先全部读完位置再改样式;只动位移;500ms、cubic-bezier(0.2, 0.7, 0.3, 1));改成 element.animate,位移叠加在项原来的 translate 上,加了筛选(新出现的淡入、筛掉的在原地淡出不占位置)和连点时从现在的位置接着滑
- Animation Handbook · Accordion Open/CloseLicense: MIT (full text)Used in Smooth accordion. MIT licensed source; original usage note: 改写自它的做法和默认值(量出真实高度再动,不用 max-height;箭头开着时转过来;减少动态时不动;300ms、ease-in-out);改成原生的 details(没有脚本也能开合、键盘和读屏是浏览器自带的),动整个 details 的高度,收完再关上,正在开合时从此刻的高度掉头,details 用 flow-root 让里面的外边距不漏出去
- Animation Handbook · Progress AnimationLicense: MIT (full text)Used in Smooth progress bar. MIT licensed source; original usage note: 改写自它的做法(填充条和轨道一样宽、用位移藏起没到的部分、不改宽度;先快后慢的缓动;role="progressbar" 和 aria-valuenow;不造假进度);改成每次拿到真实进度就挪一小段(CSS 过渡,正在挪时从此刻接着挪),时长改成 600ms,用 translate 属性
- Animation Handbook · Gradient BorderLicense: MIT (full text)Used in Border beam. MIT licensed source; original usage note: 改写自它的做法和默认值(转一层画着锥形渐变、两倍宽的方块,只动 transform 不转渐变的角度;一圈 4 秒;一屏一两个;减少动态时停住);改成用遮罩抠出边上一圈(元素自己的背景不用改),用 rotate 属性,没有用它的模糊光晕
- StyleKit · Border BeamLicense: MIT (full text)Used in Border beam. MIT licensed source; original usage note: 学它的样子(大半圈透明、最后一段由紫到青亮起来的光;边框 2px;用遮罩只露出边上一圈);没有复制代码,没有用它"转渐变的角度"的写法
- Animation Handbook · AuroraLicense: MIT (full text)Used in Aurora background. MIT licensed source; original usage note: 改写自它的做法和数值(光带的位置和高度;三组 translateX、skewY、scaleX 关键帧;周期 1、1.15、0.85 倍;模糊 35px;比区块宽 60%、区块裁掉;减少动态时不动);光带改成横向有明有暗(原版左右是匀的,挪的时候看不出在动),上下渐隐改用遮罩,周期改成 20 秒,颜色改成三个变量,光带垫在内容下面,加了滑出屏幕时可以暂停的 is-paused
- Motion Lexicon · skeleton-shimmerLicense: MIT (full text)Used in Skeleton shimmer. MIT licensed source; original usage note: 改写自它的做法(盖在整个骨架上的一层半透明的光,用位移扫过、一直重复,外框 role="status" 写明正在加载,减少动态时不扫);用原生 CSS 重写(原版是 React 加 motion),用 translate 属性,时长改成 1.5 秒,没有用它的倾斜
- Animation Handbook · Shimmer EffectLicense: MIT (full text)Used in Skeleton shimmer. MIT licensed source; original usage note: 学它的几条做法和默认值(扫一次 1.5 秒;一页上的骨架往同一个方向扫;光不要太亮;和脉冲二选一;外框 overflow: hidden);没有复制代码,没有用它"挪背景位置"的写法
This website
- 思源黑体 Noto Sans SCLicense: OFL-1.1 (full text)Noto Sans SC, self-hosted Unicode subsets via Fontsource. Font files are unmodified.
- 霞鹜文楷屏幕版 LXGW WenKai ScreenLicense: OFL-1.1 (full text)LXGW WenKai Screen for display type and brush annotations. Self-hosted, unmodified subsets; the webfont package is MIT licensed.