From c8c4facb60d3b187b1445bb292d7a8a6f743ec24 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 6 Jul 2024 12:49:25 -0700 Subject: [PATCH] Fix styling for embed page for image-only SWF assets This doesn't actually really matter, because this doesn't actually get used in the app right now? But I figure, hey it's not hard to maintain, let's just do it for consistency! --- app/assets/stylesheets/swf_assets/show.css | 1 + app/views/swf_assets/show.html.haml | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/swf_assets/show.css b/app/assets/stylesheets/swf_assets/show.css index 306a23ea..591f951d 100644 --- a/app/assets/stylesheets/swf_assets/show.css +++ b/app/assets/stylesheets/swf_assets/show.css @@ -1,4 +1,5 @@ #asset-canvas, +#asset-image, #fallback { position: absolute; left: 0; diff --git a/app/views/swf_assets/show.html.haml b/app/views/swf_assets/show.html.haml index 4d710b09..7fae5113 100644 --- a/app/views/swf_assets/show.html.haml +++ b/app/views/swf_assets/show.html.haml @@ -7,13 +7,13 @@ Embed for Asset ##{@swf_asset.id} | #{t "app_name"} %link{href: image_path("favicon.png"), rel: "icon"} + -# Load the stylesheet first, because displaying things correctly is the + -# actual most essential thing. + = stylesheet_link_tag "swf_assets/show", debug: false + -# NOTE: For all these assets, the Content-Security-Policy doesn't account -# for asset debug mode, so let's just opt out of it with `debug: false`! - if @swf_asset.canvas_movie? - -# Load the stylesheet first, because displaying things correctly is the - -# actual most essential thing. - = stylesheet_link_tag "swf_assets/show", debug: false - -# This is optional, but preloading the sprites can help us from having -# to wait on all the other JS to load and set up before we start! - @swf_asset.canvas_movie_sprite_urls.each do |sprite_url| @@ -33,4 +33,4 @@ -# the browser won't bother to load it if it's not used. = image_tag @swf_asset.image_url, id: "fallback", alt: "", loading: "lazy" - else - = image_tag @swf_asset.image_url, alt: "" \ No newline at end of file + = image_tag @swf_asset.image_url, alt: "", id: "asset-image" \ No newline at end of file