案例作品集 浏览精选项目

WESWOO 提供 Shopify Plus 项目开发费抵扣,至多 US$4,800

搜索
图库与细节展示

商品筛选与卡片移位

先选暖色再选冷色,最后选 All。检查留下的商品、结果个数和恢复后的顺序,动画只解释卡片怎样移动,不能替代筛选结果核对。

固定筛选条件,分别查数据里匹配的 ID、画面上留下的卡片和结果总数。动画完成后有差异时,先查筛选逻辑与过期响应,再查 CSS 是否隐藏了正确卡片。

四件筛到两件后仍能恢复四件。复位也应验一次,否则只看第一次筛选会漏掉商品回不来的错误。

复现实验与读数

从全部商品切换到暖色,再返回全部,读取结果数量。

908、316 px,两种偏好
4 products,再到 2 products,再到 4 products

WESWOO 在独立 Chrome 窗口载入本页公开示例的 HTML、CSS 和 JavaScript,预览高 700 px。两种宽度下都单独测试默认偏好和减少动态效果。

2026-11-24 · Chrome 157.0.8103.79

下载测试条件与原始读数(JSON)

查看手机与桌面的演示记录

WESWOO · 2026-11-24。手机宽度开启了减少动态效果,桌面宽度使用默认动态设置。下表记录本站正式演示中的界面。

窗口 / 预览宽度操作观察结果
390 / 316 pxWarm tones选择 Warm tones 后,4 件变为 2 件,留下 Rose tee 和 Ochre tee。
1440 / 908 pxWarm tones选择 Warm tones 后,4 件变为 2 件,留下 Rose tee 和 Ochre tee。

正在准备预览

特效说明

筛选后,先让结果看得懂

试试 Warm tones 和 Cool tones。少掉的卡片应立即离开阅读顺序,保留的卡片会移动,结果数同时更新。

示例源码

查看 3 个源文件HTML · CSS · MJS
collection-filter-motion.html
<section class="fx filter-demo" lang="en" aria-label="Collection filter preview">
  <h2>Shop by color</h2>
  <div class="filter-actions" role="group" aria-label="Color family">
    <button type="button" data-filter="all" aria-pressed="true">All</button>
    <button type="button" data-filter="warm" aria-pressed="false">Warm tones</button>
    <button type="button" data-filter="cool" aria-pressed="false">Cool tones</button>
  </div>
  <p class="filter-count" role="status">4 products</p>
  <ul class="filter-cards"><li data-tone="cool"><figure><img src="__WW_VISUAL_1__" alt="Front of a sky T-shirt"><figcaption>Sky blue tee</figcaption></figure></li>
<li data-tone="warm"><figure><img src="__WW_VISUAL_2__" alt="Front of a rose T-shirt"><figcaption>Rose tee</figcaption></figure></li>
<li data-tone="warm"><figure><img src="__WW_VISUAL_3__" alt="Front of a ochre T-shirt"><figcaption>Ochre tee</figcaption></figure></li>
<li data-tone="cool"><figure><img src="__WW_VISUAL_4__" alt="Front of a sage T-shirt"><figcaption>Sage tee</figcaption></figure></li></ul>
</section>

接入与验收

接入主题

3 步
  1. 复制要接入的主题

    在主题副本里接入和预览示例。

  2. 把素材接到区块设置

    将示例文字与图片替换为 Section 设置,并把样式限定在当前 Section。

  3. 绑定编辑器生命周期

    用生命周期脚本处理主题编辑器重载、离屏暂停和卸载清理。

使用位置

  • 商品集合页、系列页和款式列表。

交互逻辑

  • 切换条件后更新可见商品和结果数量,过渡仅作用于仍可见的卡片。

触摸与无障碍

  • 手机用可点按的筛选按钮,减少动态时列表即时更新。

本效果的接入说明

真实集合页使用 Shopify 筛选结果作为数据来源,让筛选状态随 URL 保留。

上线检查

接入文件
sections/ww-effect.liquid
{% comment %} WESWOO example shell. Add ONE effect's HTML inside .fx-slot. {% endcomment %}
{{ 'ww-effects.css' | asset_url | stylesheet_tag }}
<section id="ww-effect-{{ section.id }}" data-ww-effect-section>
  <h2>{{ section.settings.heading | escape }}</h2>
  <button type="button" data-effect-toggle aria-pressed="false">Play / pause effect</button>
  <div class="fx-slot">
    {% comment %} Insert the chosen .fx element here; read copy/images from section settings. {% endcomment %}
  </div>
</section>
<script type="module" src="{{ 'ww-effect-section.js' | asset_url }}"></script>
{% schema %}
{"name":"WESWOO effect","settings":[{"type":"text","id":"heading","label":"Heading","default":"Our story"}],"presets":[{"name":"WESWOO effect"}]}
{% endschema %}

通用壳层需要填入所选效果。每个模块接入一种效果;多种效果需建立明确的注册与 Section 对应关系。

参考资料

示例范围与许可

示例由 WESWOO 和注明的开源作者提供,复制代码时请保留相应许可。在线项目画面与摄影的权利归原权利人;下载文件使用占位图片,接入时请替换为有权使用的素材。

Shopify/dawn · modal / slider base classesShopify/dawn · product media galleryShopify/dawn · license

资料核对 · 2026-11-24