2024-07-08 13:43:28 -07:00
|
|
|
%outfit-viewer
|
2024-07-07 21:32:41 -07:00
|
|
|
.loading-indicator= render partial: "hanger_spinner"
|
2024-07-08 13:43:28 -07:00
|
|
|
|
2024-07-08 17:19:14 -07:00
|
|
|
%label.play-pause-button{title: "Pause/play animations"}
|
2024-07-08 16:27:38 -07:00
|
|
|
%input.play-pause-toggle{
|
|
|
|
type: "checkbox",
|
|
|
|
checked: outfit_viewer_is_playing,
|
|
|
|
}
|
2024-07-08 17:19:14 -07:00
|
|
|
%svg.playing-label{viewBox: "0 0 24 24", "aria-hidden": "true", "aria-label": "Pause"}
|
|
|
|
%path{fill: "currentColor", d: "M6 19h4V5H6v14zm8-14v14h4V5h-4z"}
|
|
|
|
%svg.paused-label{viewBox: "0 0 24 24", "aria-hidden": "true", "aria-label": "Play"}
|
|
|
|
%path{fill: "currentColor", d: "M8 5v14l11-7z"}
|
2024-07-08 13:43:28 -07:00
|
|
|
|
2024-07-02 22:43:36 -07:00
|
|
|
- outfit.visible_layers.each do |swf_asset|
|
|
|
|
%outfit-layer{
|
|
|
|
data: {
|
|
|
|
"asset-id": swf_asset.id,
|
|
|
|
"zone": swf_asset.zone.label,
|
|
|
|
},
|
|
|
|
}
|
2024-07-03 20:15:35 -07:00
|
|
|
- if swf_asset.canvas_movie?
|
2024-07-08 16:27:38 -07:00
|
|
|
%iframe{src: swf_asset_path(swf_asset, playing: outfit_viewer_is_playing ? true : nil)}
|
2024-09-06 17:57:18 -07:00
|
|
|
- elsif swf_asset.image_url.present?
|
2024-09-26 18:20:05 -07:00
|
|
|
= image_tag swf_asset.image_url, alt: "", loading: "lazy"
|
2024-07-03 20:15:35 -07:00
|
|
|
- else
|
2024-09-26 18:20:05 -07:00
|
|
|
/ No movie or image available for SWF asset: #{swf_asset.url}
|