impress/app/views/application/_outfit_viewer.html.haml

20 lines
829 B
Text

- html_options = {} unless defined? html_options
- html_options[:id] ||= "outfit-viewer-#{SecureRandom.hex(8)}"
= content_tag "outfit-viewer", **html_options do
.loading-indicator= render partial: "hanger_spinner"
- outfit.visible_layers.each do |swf_asset|
%outfit-layer{
data: {
"asset-id": swf_asset.id,
"zone": swf_asset.zone.label,
},
}
- if swf_asset.canvas_movie?
%iframe{src: swf_asset_path(swf_asset, playing: outfit_viewer_is_playing ? true : nil)}
- elsif preferred_image_format == :svg && swf_asset.svg_url?
= image_tag swf_asset.svg_url, alt: "", loading: "lazy"
- elsif swf_asset.image_url?
= image_tag swf_asset.image_url, alt: "", loading: "lazy"
- else
/ No movie or image available for SWF asset: #{swf_asset.url}