<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Motion | 锤子前端</title><description>Now vibe coding, so learning hammer FE ?</description><link>https://channel.meo-ai.com</link><item><title>《CSS 与 JavaScript 动画性能之争》</title><link>https://channel.meo-ai.com/posts/648</link><guid isPermaLink="true">https://channel.meo-ai.com/posts/648</guid><pubDate>Sat, 30 May 2026 00:02:44 GMT</pubDate><content:encoded>&lt;span class=&quot;post-title-source&quot;&gt;《CSS 与 JavaScript 动画性能之争》&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;标签：&lt;a href=&quot;/search/result?q=%23%E5%89%8D%E7%AB%AF&quot; title=&quot;#前端&quot;&gt;#前端&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23CSS%E5%8A%A8%E7%94%BB&quot; title=&quot;#CSS动画&quot;&gt;#CSS动画&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23JavaScript%E5%8A%A8%E7%94%BB&quot; title=&quot;#JavaScript动画&quot;&gt;#JavaScript动画&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23WebAnimationsAPI&quot; title=&quot;#WebAnimationsAPI&quot;&gt;#WebAnimationsAPI&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96&quot; title=&quot;#性能优化&quot;&gt;#性能优化&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23GSAP&quot; title=&quot;#GSAP&quot;&gt;#GSAP&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23Motion&quot; title=&quot;#Motion&quot;&gt;#Motion&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;总结：&lt;br /&gt;本文通过交互式演示拆解了 CSS 与 JS 动画的性能差异真相：CSS Keyframes 和 Transitions 运行在独立线程，主线程阻塞时依然流畅；而传统 JS 动画（如 requestAnimationFrame 循环）与主线程争抢资源，容易卡顿。但 &lt;mark class=&quot;highlight&quot;&gt;Motion&lt;/mark&gt; 库通过底层调用 Web Animations API（WAAPI）绕过了这一限制，实现了与 CSS 同级别的流畅度。作者建议优先使用原生 CSS，遇到 CSS 无法覆盖的场景时选择 &lt;mark class=&quot;highlight&quot;&gt;Motion&lt;/mark&gt; 等 WAAPI 方案，而非直接上 GSAP 这类纯主线程库。&lt;br /&gt;&lt;br /&gt;文章要点：&lt;br /&gt;1. CSS 动画的核心优势不是&quot;计算快&quot;，而是运行在独立线程，主线程再忙也不影响动画流畅度&lt;br /&gt;2. 传统 JS 动画（requestAnimationFrame）每帧都在主线程计算，React 重渲染或 fetch 解析时容易掉帧&lt;br /&gt;3. &lt;mark class=&quot;highlight&quot;&gt;Motion&lt;/mark&gt; 库（原 Framer &lt;mark class=&quot;highlight&quot;&gt;Motion&lt;/mark&gt;）底层使用 Web Animations API，能接入与 CSS 相同的底层动画引擎，主线程阻塞时照样丝滑&lt;br /&gt;4. GSAP 功能极其强大，但坚持在主线程运行，是&quot;能力换性能&quot;的取舍，适合复杂序列动画而非简单过渡&lt;br /&gt;5. 现代 CSS 已经很能打，View Transitions、linear()、Animation Timeline 等新 API 大幅减少了必须上 JS 的场景&lt;br /&gt;6. 选型建议：能用 CSS 就不用库 → CSS 搞不定优先选 &lt;mark class=&quot;highlight&quot;&gt;Motion&lt;/mark&gt;/WAAPI → 只有复杂时间线控制才考虑 GSAP&lt;br /&gt;&lt;br /&gt;URL：&lt;a href=&quot;https://www.joshwcomeau.com/animation/css-vs-javascript/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;https://www.joshwcomeau.com/animation/css-vs-javascript/&quot;&gt;https://www.joshwcomeau.com/animation/css-vs-javascript/&lt;/a&gt;&lt;a class=&quot;tgme_widget_message_link_preview&quot; href=&quot;https://joshwcomeau.com/animation/css-vs-javascript&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;There are a bunch of JavaScript animation libraries out there, and you might have wondered whether there’s a performance cost compared to traditional CSS transitions and keyframe animations. In this blog post, we’ll compare the same animation across several…&quot;&gt;
  
  &lt;div class=&quot;link_preview_site_name accent_color&quot;&gt;Joshwcomeau&lt;/div&gt;
  &lt;img class=&quot;link_preview_image&quot; alt=&quot;CSS vs. JavaScript • Josh W. Comeau&quot; src=&quot;/static/https://cdn4.telesco.pe/file/j6pHpHOiid85hW-PiHO5RbHQNhUfz8DCzWKspZ6INAOvz1cGOLiCr4icJdVWszb3YD9dLs05A3Hd7EFas5ZsW-R5_tDkwte5eHWsZo06if-Y-ojVVBb0HKR_g1VBbjGnA1nk7Kyp-2o2HK7w6SuzPySg8h20PO-8_JlOyaHI8ygvgqC0LS2hxasm1JN8YYC7N-QeaC7370uBuBtmrggiIKtw04s15QlT-AMhl02e04AH8vKNK16Cz7YPZjODUVKtBj5CVEz9ewIhA6qLKjtE9Rkz7wYZ4b2SmiUD1QH0shZkEmvzzws7oAszCWv_aKZ5rF4-0UBBxvgvcF1jYGDb7g.jpg&quot; width=&quot;1200&quot; height=&quot;630&quot; loading=&quot;eager&quot; /&gt;
  &lt;div class=&quot;link_preview_title&quot;&gt;CSS vs. JavaScript • Josh W. Comeau&lt;/div&gt;
  &lt;div class=&quot;link_preview_description&quot;&gt;There are a bunch of JavaScript animation libraries out there, and you might have wondered whether there’s a performance cost compared to traditional CSS transitions and keyframe animations. In this blog post, we’ll compare the same animation across several…&lt;/div&gt;
&lt;/a&gt;</content:encoded></item><item><title>#Tailwind #Motion 怎么用好这两个流行的 css 库</title><link>https://channel.meo-ai.com/posts/456</link><guid isPermaLink="true">https://channel.meo-ai.com/posts/456</guid><pubDate>Sat, 13 Sep 2025 08:38:42 GMT</pubDate><content:encoded>&lt;a href=&quot;/search/result?q=%23Tailwind&quot; title=&quot;#Tailwind&quot;&gt;#Tailwind&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23Motion&quot; title=&quot;#Motion&quot;&gt;#Motion&lt;/a&gt; 怎么用好这两个流行的 css 库&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://motion.dev/docs/react-tailwind&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;https://motion.dev/docs/react-tailwind&quot;&gt;https://motion.dev/docs/react-tailwind&lt;/a&gt;&lt;a class=&quot;tgme_widget_message_link_preview&quot; href=&quot;https://motion.dev/docs/react-tailwind&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;Learn how to combine Motion with the utility-first workflow of Tailwind CSS.&quot;&gt;
  
  &lt;div class=&quot;link_preview_site_name accent_color&quot;&gt;Motion&lt;/div&gt;
  &lt;img class=&quot;link_preview_image&quot; alt=&quot;Animating with Tailwind CSS | Motion React&quot; src=&quot;/static/https://cdn4.telesco.pe/file/VBosKK_xCWu07fwVcSZUAu04q2GdWbVV4qZ_8Dvr6Xaqc0S2kBFKRGIgSbfZHfZqPrtAJ6jtDm5FOSjdmGnXTffkfryGw38611JyQVitRxrxnGt8ND1RpiDW91RJzbvc40J6YbJEdtNZGx-7bt-iT8qp2gL3ozRP_HDK85gdUHef354w8bwwt899A0VkKDHQOJI_D8DGdYtp1Knw3yfSHG6ICb-wFsOjtWUC9zjV8ZED3OSWOqyKnREmQcxkCdGAuJID-h37aa4a1wlEXmOVq46IGes4FMglzhndY3d0EGe50XR7RNyKWOKlqLDCqDKTfCJHPKmwaY_CQr9pjN3rWg.jpg&quot; width=&quot;1200&quot; height=&quot;630&quot; loading=&quot;eager&quot; /&gt;
  &lt;div class=&quot;link_preview_title&quot;&gt;Animating with Tailwind CSS | &lt;mark class=&quot;highlight&quot;&gt;Motion&lt;/mark&gt; React&lt;/div&gt;
  &lt;div class=&quot;link_preview_description&quot;&gt;Learn how to combine &lt;mark class=&quot;highlight&quot;&gt;Motion&lt;/mark&gt; with the utility-first workflow of Tailwind CSS.&lt;/div&gt;
&lt;/a&gt;</content:encoded></item><item><title>#React #SVG #Motion 通过 React + Framer Motion 实现了一个创新性的无限滚动动画，元素沿自定义 SVG 路径动态移动，并支持多元素分布、深度排序、悬停交互、滚动联动等高级功能，同时提供**响应式适配方案（D3.js 动态路径缩放），兼顾性能与视觉细节</title><link>https://channel.meo-ai.com/posts/391</link><guid isPermaLink="true">https://channel.meo-ai.com/posts/391</guid><pubDate>Fri, 20 Jun 2025 01:57:12 GMT</pubDate><content:encoded>&lt;a href=&quot;/search/result?q=%23React&quot; title=&quot;#React&quot;&gt;#React&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23SVG&quot; title=&quot;#SVG&quot;&gt;#SVG&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23Motion&quot; title=&quot;#Motion&quot;&gt;#Motion&lt;/a&gt; &lt;b&gt;通过 React + Framer &lt;/b&gt;&lt;mark class=&quot;highlight&quot;&gt;&lt;b&gt;Motion&lt;/b&gt;&lt;/mark&gt; 实现了一个创新性的无限滚动动画，元素沿自定义 SVG 路径动态移动，并支持多元素分布、深度排序、悬停交互、滚动联动等高级功能，同时提供**响应式适配方案（D3.js 动态路径缩放），兼顾性能与视觉细节。  &lt;br /&gt;&lt;br /&gt;1. 路径动画突破：传统水平跑马灯升级为任意复杂路径动画（如交叉曲线）。  &lt;br /&gt;2. 交互增强：悬停减速、滚动速度联动、深度动态排序（解决路径交叉遮挡）。  &lt;br /&gt;3. 响应式设计：D3.js 动态缩放路径坐标，适配不同屏幕尺寸。  &lt;br /&gt;4. 性能优化：`useAnimationFrame` 逐帧控制 + 简化路径复杂度。&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://tympanus.net/codrops/2025/06/17/building-an-infinite-marquee-along-an-svg-path-with-react-motion/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;https://tympanus.net/codrops/2025/06/17/building-an-infinite-marquee-along-an-svg-path-with-react-motion/&quot;&gt;https://tympanus.net/codrops/2025/06/17/building-an-infinite-marquee-along-an-svg-path-with-react-motion/&lt;/a&gt;&lt;a class=&quot;tgme_widget_message_link_preview&quot; href=&quot;https://tympanus.net/codrops/2025/06/17/building-an-infinite-marquee-along-an-svg-path-with-react-motion&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;Learn how to create an infinite marquee that follows a custom SVG path using React and Motion.&quot;&gt;
  
  &lt;div class=&quot;link_preview_site_name accent_color&quot;&gt;Codrops&lt;/div&gt;
  &lt;img class=&quot;link_preview_image&quot; alt=&quot;Building an Infinite Marquee Along an SVG Path with React &amp;amp; Motion | Codrops&quot; src=&quot;/static/https://cdn4.telesco.pe/file/UaCqdEVUSNK_YGWdVYtVuj48H2Mb9l6kxJzqNLOP9TORmbTcuSJRCZVgr9UpfoEIoXA_Evdo4mp_3pRAqptzzrxJ99jdUycj3KLbO6PKTC3IGyk0SvvN9qIhb5fDwjOIMcfDl4wKbsh9wPvnziXlPzvVJ7zXOzvrb39cHS_gX7u2xU2up3G4IGX1PCXzio7lMEGPE35qNkhvVa-KeYoiRbX44ORPkirWWs7_igKBgeULF3feDANDt3NS2iuoYHjkxLt4InEGiqRZ6tyhIfzcAdBslvg9fZSqKcc3ZZ843q9pfRhEOEzeb0xj1lZUWQt5gM6OCQxHt4ocAmwJoDm_sw.jpg&quot; width=&quot;1200&quot; height=&quot;630&quot; loading=&quot;eager&quot; /&gt;
  &lt;div class=&quot;link_preview_title&quot;&gt;Building an Infinite Marquee Along an SVG Path with React &amp;amp; &lt;mark class=&quot;highlight&quot;&gt;Motion&lt;/mark&gt; | Codrops&lt;/div&gt;
  &lt;div class=&quot;link_preview_description&quot;&gt;Learn how to create an infinite marquee that follows a custom SVG path using React and &lt;mark class=&quot;highlight&quot;&gt;Motion&lt;/mark&gt;.&lt;/div&gt;
&lt;/a&gt;</content:encoded></item><item><title>#文章 #Motion 集成 radix </title><link>https://channel.meo-ai.com/posts/203</link><guid isPermaLink="true">https://channel.meo-ai.com/posts/203</guid><pubDate>Sat, 08 Feb 2025 05:48:15 GMT</pubDate><content:encoded>&lt;a href=&quot;/search/result?q=%23%E6%96%87%E7%AB%A0&quot; title=&quot;#文章&quot;&gt;#文章&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23Motion&quot; title=&quot;#Motion&quot;&gt;#Motion&lt;/a&gt; 集成 radix &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://motion.dev/docs/radix&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;https://motion.dev/docs/radix&quot;&gt;https://motion.dev/docs/radix&lt;/a&gt;&lt;a class=&quot;tgme_widget_message_link_preview&quot; href=&quot;https://motion.dev/docs/radix&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;Learn how to add smooth animations to Radix UI with Motion for React. Exit, layout, and transition examples for Tooltips, Dialogs, and more.&quot;&gt;
  
  &lt;div class=&quot;link_preview_site_name accent_color&quot;&gt;motion.dev&lt;/div&gt;
  &lt;img class=&quot;link_preview_image&quot; alt=&quot;Radix: How to Add Animations to Radix | Motion&quot; src=&quot;/static/https://cdn4.telesco.pe/file/qfqxLOXHEQ0Ao__C1dZXZlQdSMZZAkT3DJJ84U7dS6-yZmnKVmGvZn2myjGFBCOSN8JPttv9MMYT0AG31RDeS0ZIBbr4nFHb_c3AVv6lNVpygRfayNsZ9YiOf_zdjkqwHmi8HVHe7OSH0Ks-y_cyHAjuABgwLc2yK-pmSZsnBbK61UqTPyLhpx6sUC17XAcxpjHlbW9ZmkUY8iyZ2_xiiBxZgoE_hiqR67ZvvfNyNMQagjY5nhaacmJRih1DLxIuJHKP_Iw3JM5Mgkt2xJpLqTAYwyF3H4xEGZUhHfXuf6P8paN3DiDAy9gULKpzOKZC0hWorQ4FBT1yoZutUam2Gg.jpg&quot; width=&quot;1200&quot; height=&quot;630&quot; loading=&quot;eager&quot; /&gt;
  &lt;div class=&quot;link_preview_title&quot;&gt;Radix: How to Add Animations to Radix | &lt;mark class=&quot;highlight&quot;&gt;Motion&lt;/mark&gt;&lt;/div&gt;
  &lt;div class=&quot;link_preview_description&quot;&gt;Learn how to add smooth animations to Radix UI with &lt;mark class=&quot;highlight&quot;&gt;Motion&lt;/mark&gt; for React. Exit, layout, and transition examples for Tooltips, Dialogs, and more.&lt;/div&gt;
&lt;/a&gt;</content:encoded></item></channel></rss>