From cfb3b6e6fc89b8b22fc7bfd9de623eac6babfebe Mon Sep 17 00:00:00 2001 From: tsundokul <42388638+tsundokul@users.noreply.github.com> Date: Sat, 23 Oct 2021 15:55:36 +0300 Subject: [PATCH] Fix card elements, add hero image (#31) * Remove gradient from card elements * Set min-height to auto for card elements * Add hero image to landing page Co-authored-by: catileptic --- .../stylesheets/custom/code4_styling.scss | 23 ++++++++++- app/views/custom/welcome/_header.html.erb | 22 ++++++++++ app/views/custom/welcome/index.html.erb | 40 +++++++++++++++++++ 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 app/views/custom/welcome/_header.html.erb create mode 100644 app/views/custom/welcome/index.html.erb diff --git a/app/assets/stylesheets/custom/code4_styling.scss b/app/assets/stylesheets/custom/code4_styling.scss index 14736f142b5..adea2eaba50 100644 --- a/app/assets/stylesheets/custom/code4_styling.scss +++ b/app/assets/stylesheets/custom/code4_styling.scss @@ -19,12 +19,33 @@ footer .logo a { .card-text-over { position: relative; + min-height: auto; figcaption { position: absolute; bottom: 0; left: 0; h3 { - text-shadow: 1px 1px $black; + color: black; } } } + +.home-header { + @extend .budget-header; + min-height: auto; + padding: 1.5rem 0; + padding-top: 3rem; + margin-bottom: 1.5rem; + margin-top: -1.5rem; + + &.with-background-image { + background-size: auto; + } + + h1 { + font-size: 2.75rem; + padding: 0; + margin: 0; + margin-bottom: 0.5rem; + } +} diff --git a/app/views/custom/welcome/_header.html.erb b/app/views/custom/welcome/_header.html.erb new file mode 100644 index 00000000000..68043569148 --- /dev/null +++ b/app/views/custom/welcome/_header.html.erb @@ -0,0 +1,22 @@ +<% if header.present? %> +
+ style="background-image: url(<%= asset_url header.image_url(:large) %>);" + <% end %> + > +
+
+ <%= header.label %> +

<%= header.title %>

+ +

<%= header.description %>

+ + <% if header.link_text.present? && header.link_url.present? %> +
+ <%= link_to header.link_text, header.link_url, class: "button expanded large" %> +
+ <% end %> +
+
+
+<% end %> diff --git a/app/views/custom/welcome/index.html.erb b/app/views/custom/welcome/index.html.erb new file mode 100644 index 00000000000..068773f1feb --- /dev/null +++ b/app/views/custom/welcome/index.html.erb @@ -0,0 +1,40 @@ +<% content_for :body_class, "home-page" %> + +<% content_for :canonical do %> + <%= render "shared/canonical", href: root_url %> +<% end %> + +<%= render Shared::BannerComponent.new("homepage") %> + +<% provide :social_media_meta_tags do %> + <%= render "shared/social_media_meta_tags", + social_url: root_url %> +<% end %> + +<%= render "welcome/header", header: @header %> + +
+ <%= render "feeds" %> + +
+ <% if @cards.any? %> +
"> +

<%= t("welcome.cards.title") %>

+ + <%= render "shared/cards", cards: @cards %> +
+ <% end %> + + <% if feed_processes_enabled? %> +
+ <%= render "processes" %> +
+ <% end %> +
+ + <% if feature?("user.recommendations") && (@recommended_debates.present? || @recommended_proposals.present?) %> + <%= render "recommended", + recommended_debates: @recommended_debates, + recommended_proposals: @recommended_proposals %> + <% end %> +