Skip to content

Commit

Permalink
feat(home): add hover state over plans
Browse files Browse the repository at this point in the history
  • Loading branch information
castrolem committed Nov 26, 2019
1 parent 22b7a58 commit 4245595
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
6 changes: 6 additions & 0 deletions app/assets/stylesheets/static_pages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
color: $secondary-color;
border-radius: 0.4rem;
padding: 1.5rem;
text-decoration: none;

@media (min-width: 80rem) {
min-width: 18rem;
Expand All @@ -114,6 +115,11 @@
color: $primary-color;
}

&:hover {
background-color:lighten($primary-color,50);
border-color: lighten($primary-color,40);
}

h3 {
width: 100%;
font-weight: bold;
Expand Down
31 changes: 15 additions & 16 deletions app/views/static_pages/home.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,26 @@
<p id="notice"><%= notice %></p>
<div class="subscription--plans">
<% @plans.each do |plan| %>
<div class="subscription--plan" id="subscription-<%= plan.name.parameterize.underscore %>">
<h3>
<%= plan.name %>
<span class="subscription--plan-price"><%= number_to_currency(plan.amount).gsub(/\.00$/, "") %><span>/mo</span></span>
</h3>
<h4><%= plan.headline %></h4>
<%= plan.description %>
<% if @current_user_subscription&.plan&.id == plan.id %>
<p>Subscribed</p>
<% else %>
<p><%= link_to 'Subscribe', @current_user ? new_subscription_charge_path(plan_id: plan) : login_path %></p>
<% end %>
</div>
<%= link_to @current_user ? new_subscription_charge_path(plan_id: plan) : login_path, class: "subscription--plan", id: "subscription-#{plan.name.parameterize.underscore}" do %>
<div>
<h3>
<%= plan.name %>
<span class="subscription--plan-price"><%= number_to_currency(plan.amount).gsub(/\.00$/, "") %><span>/mo</span></span>
</h3>
<h4><%= plan.headline %></h4>
<%= plan.description %>
<% if @current_user_subscription&.plan&.id == plan.id %>
<p><strong>Current subscription</strong></p>
<% end %>
</div>
<% end %>
<% end %>
<div class="subscription--plan" id="one-time-donation">
<%= link_to new_charge_path, class: "subscription--plan", id: "one-time-donation" do %>
<h3>Other</h3>
<h4>Pay what you can. Every dollar counts.</h4>
<p>“To each according to their ability, to each according to their need.” Contributing what you can, where you can is what we’re all about.</p>
<p>Folks who donate $100 on a one-time basis will receive a free gift from our store. People who pay dues at the rate of $100 per month or more will receive a thank you call from us.</p>
<p><%= link_to 'Make a donation today', new_charge_path %></p>
</div>
<%end%>
</div>
</section>

Expand Down

0 comments on commit 4245595

Please sign in to comment.