案例作品集 浏览精选项目

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

搜索
图库与细节展示

商品正反面切换

把正面和背面分别停住看图案位置。当两张图都已准备好时再比较翻转手感;买家必须能明确知道当前看到的是哪一面。

触屏没有持续悬停,给正反面一个明确可点的切换入口。切到背面后再改颜色,核对背图也属于新颜色;只测试单一颜色会漏掉跨变体串图。

两次切换都有对应的状态。图片很相似时,前后标记可以帮助核对状态与所选按钮是否一致。

复现实验与读数

从正面切到背面,再切回正面,记录当前视角的状态文字。

908、316 px,两种偏好
Front view,再到 Back view,再到 Front view

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

2026-11-24 · Chrome 157.0.8103.79

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

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

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

窗口 / 预览宽度操作观察结果
390 / 316 pxBack原为“Front view”。操作后显示“Back view”。
1440 / 908 pxBack原为“Front view”。操作后显示“Back view”。

正在准备预览

特效说明

把另一面交给顾客主动查看

衣服背面可能有图案,设备背面可能有接口。给正反两面各一个清楚的按钮,避免顾客必须猜测手势或等轮播。

示例源码

查看 3 个源文件HTML · CSS · MJS
product-front-back.html
<section class="fx angle-demo" lang="en" aria-label="Product front and back preview">
  <div class="angle-copy">
    <h2>Sky blue tee</h2>
    <p>Check the graphic and the print placement from both sides.</p>
    <div class="angle-actions" role="group" aria-label="Product view">
      <button type="button" data-side="front" aria-pressed="true">Front</button>
      <button type="button" data-side="back" aria-pressed="false">Back</button>
    </div>
  </div>
  <figure class="angle-figure">
    <div class="angle-scene">
      <div class="angle-flip">
        <img class="angle-front" src="__WW_VISUAL_1__" alt="Front of a sky blue T-shirt with a drop graphic">
        <img class="angle-back" src="__WW_VISUAL_2__" alt="Back of the same T-shirt with a small Codrops wordmark" aria-hidden="true">
      </div>
    </div>
    <figcaption role="status">Front view</figcaption>
  </figure>
</section>

接入与验收

接入主题

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

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

  2. 把素材接到区块设置

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

  3. 绑定编辑器生命周期

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

使用位置

  • 服装印花、设备背板和配件连接面。

交互逻辑

  • 两张图共用同一尺寸,由按钮决定显示哪一面,当前角度同时用文字标出。

触摸与无障碍

  • 触屏和键盘操作相同。减少动态时直接换图。

本效果的接入说明

从当前商品变体取图,替换为对应的正面和背面照片,并为两张图分别写替代文本。

上线检查

接入文件
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