2024-09-30 16:21:47 -07:00
|
|
|
- html_options = {} unless defined? html_options
|
2026-01-03 10:44:10 -08:00
|
|
|
- html_options[:id] ||= "outfit-viewer-#{SecureRandom.hex(8)}"
|
2024-09-30 16:21:47 -07:00
|
|
|
= content_tag "outfit-viewer", **html_options do
|
2024-07-07 21:32:41 -07:00
|
|
|
.loading-indicator= render partial: "hanger_spinner"
|
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-12-07 11:45:01 -08:00
|
|
|
- elsif preferred_image_format == :svg && swf_asset.svg_url?
|
|
|
|
|
= image_tag swf_asset.svg_url, alt: "", loading: "lazy"
|
|
|
|
|
- elsif swf_asset.image_url?
|
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}
|