moar flavor

This commit is contained in:
24c02 2025-12-18 12:33:11 -05:00
parent 06a617f6ec
commit dc73779ed0
4 changed files with 14 additions and 21 deletions

View file

@ -3,17 +3,9 @@
scenario_class = application&.onboarding_scenario_class
scenario = scenario_class&.new(current_identity)
custom_logo_path = scenario&.logo_path
light_bg = scenario&.background_path
dark_bg = scenario&.dark_mode_background_path
%>
<% if light_bg || dark_bg %>
<style>
body { background-size: cover; background-position: center; }
<% if light_bg %>html[data-theme="light"] body { background-image: url('<%= vite_asset_path(light_bg) %>'); }<% end %>
<% if dark_bg %>html[data-theme="dark"] body { background-image: url('<%= vite_asset_path(dark_bg) %>'); }<% end %>
</style>
<% end %>
<div class="auth-container<%= ' has-background' if light_bg || dark_bg %>">
<%= render "shared/scenario_background_style", scenario: %>
<div class="auth-container<%= ' has-background' if scenario&.background_path || scenario&.dark_mode_background_path %>">
<div class="auth-brand">
<%= vite_image_tag "images/hc-square.png", alt: "Hack Club logo", class: "brand-logo" %>
<% if custom_logo_path %>

View file

@ -26,16 +26,10 @@
<%
body_style = content_for?(:body_style) ? yield(:body_style) : nil
portal_scenario = respond_to?(:portal_onboarding_scenario) ? portal_onboarding_scenario : nil
light_bg = portal_scenario&.background_path
dark_bg = portal_scenario&.dark_mode_background_path
%>
<body class="<%= content_for?(:portal_wrapper) ? '' : (content_for?(:body_class) ? yield(:body_class) : 'auth-layout') %>" hx-headers='{"X-CSRF-Token": "<%= form_authenticity_token %>"}' hx-boost="false"<%= " style=\"#{body_style}\"".html_safe if body_style %>>
<% if content_for?(:portal_wrapper) && (light_bg || dark_bg) %>
<style>
body { background-size: cover; background-position: center; }
<% if light_bg %>html[data-theme="light"] body { background-image: url('<%= vite_asset_path(light_bg) %>'); }<% end %>
<% if dark_bg %>html[data-theme="dark"] body { background-image: url('<%= vite_asset_path(dark_bg) %>'); }<% end %>
</style>
<% if content_for?(:portal_wrapper) %>
<%= render "shared/scenario_background_style", scenario: portal_scenario %>
<% end %>
<% if content_for?(:portal_wrapper) %>
<main class="container portal-container">

View file

@ -0,0 +1,9 @@
<% light_bg = scenario&.background_path %>
<% dark_bg = scenario&.dark_mode_background_path %>
<% if light_bg || dark_bg %>
<style>
body { background-size: cover; background-position: center; }
<% if light_bg %>html[data-theme="light"] body { background-image: url('<%= vite_asset_path(light_bg) %>'); }<% end %>
<% if dark_bg %>html[data-theme="dark"] body { background-image: url('<%= vite_asset_path(dark_bg) %>'); }<% end %>
</style>
<% end %>

View file

@ -1,9 +1,7 @@
<% service_name = @program&.name || "the application" %>
<% scenario_class = @program&.onboarding_scenario_class %>
<% scenario = scenario_class&.new(nil) %>
<% if scenario&.background_path %>
<% content_for(:body_style) { "background-image: url('#{scenario.background_path}'); background-size: cover; background-position: center;" } %>
<% end %>
<%= render "shared/scenario_background_style", scenario: %>
<%= render Components::AuthWelcome.new(
headline: "Continue to #{service_name}",
subtitle: "Sign in or create an account to continue",