Skip to content

Commit 523eeb9

Browse files
committed
Add a homepage tagline
1 parent b8b893f commit 523eeb9

File tree

5 files changed

+61
-13
lines changed

5 files changed

+61
-13
lines changed

app/content/pages/index.html.erb

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,24 @@ title: Joy of Rails
33
---
44

55
<% articles = Page.all.published.order(published_at: :desc) %>
6-
<section style="min-height: 51vh">
7-
<div class="main-content container py-gap lg:py-3xl">
8-
<% articles.take(3).zip(%w[left right].cycle).each do |(page, side)| %>
9-
<%= render Pages::Summary.from_page(page, side: side) %>
6+
<%= render Pages::Header::Container.new do |c| %>
7+
<div class="hero">
8+
<%= c.title do %>
9+
Experience the<br><span class="text-gradient">Joy of Ruby on Rails</span>
1010
<% end %>
11-
12-
<h3 class="mt-16">More articles</h3>
13-
<%= render Pages::List.new(articles.drop(3).take(6)) %>
11+
<p>
12+
Interactive lessons to learn the framework that will make you fall in love with building web apps all over again 💜
13+
</p>
1414
</div>
15-
</section>
15+
<% end %>
16+
<div class="main-content container py-gap lg:py-3xl">
17+
<% articles.take(3).zip(%w[left right].cycle).each do |(page, side)| %>
18+
<%= render Pages::Summary.from_page(page, side: side) %>
19+
<% end %>
20+
21+
<h3 class="mt-16">More articles</h3>
22+
<%= render Pages::List.new(articles.drop(3).take(6)) %>
23+
</div>
1624
<section>
1725
<%= render "users/newsletter_subscriptions/banner" %>
1826
</section>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,44 @@
11
.page-header {
2+
--gradient-from: rgb(86 55 251 / 85%);
3+
--gradient-from: var(--joy-text-theme);
4+
--gradient-to: rgb(255 0 0 / 85%);
5+
--gradient-stops: var(--gradient-from), var(--gradient-to);
6+
27
background-color: var(--joy-background-header);
38
padding-block-start: var(--grid-gutter);
49
padding-block-end: var(--grid-gutter);
10+
11+
& .text-gradient {
12+
color: var(--gradient-from);
13+
}
14+
15+
& .hero {
16+
max-width: 718px;
17+
18+
& h1 {
19+
font-family: var(--sans-serif-thick);
20+
font-weight: normal;
21+
font-size: var(--step-5);
22+
}
23+
24+
& p {
25+
text-wrap: balance;
26+
font-size: var(--step-1);
27+
font-weight: 300;
28+
}
29+
}
530
}
631

732
.extend-page-header-bg {
833
background-color: var(--joy-background-header);
934
}
35+
36+
@supports (background-clip: text) or (-webkit-background-clip: text) {
37+
.page-header {
38+
& .text-gradient {
39+
background-clip: text;
40+
-webkit-text-fill-color: rgba(0, 0, 0, 0);
41+
background-image: linear-gradient(to right, var(--gradient-stops));
42+
}
43+
}
44+
}

app/javascript/css/config/theme.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
--joy-text-subtle: var(--color-stone-700);
124124
--joy-text-heading: var(--joy-color-200);
125125
--joy-text-emphasis: var(--joy-color-500);
126-
--joy-text-theme: var(--joy-text);
126+
--joy-text-theme: var(--joy-color-400);
127127

128128
--joy-link-primary: var(--joy-link-4);
129129
--joy-link-visited: var(--joy-link-3);

app/javascript/css/utilities/tailwind.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,3 +1139,8 @@ focus\:ring-0:focus {
11391139
.list-decimal {
11401140
list-style-type: decimal;
11411141
}
1142+
1143+
.bg-clip-text {
1144+
-webkit-background-clip: text;
1145+
background-clip: text;
1146+
}

app/views/components/pages/header.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ def view_template(&)
2626
end
2727
end
2828

29-
def title(&)
30-
h1(class: "mb-4", &)
29+
def title(**attributes, &)
30+
h1(**mix(attributes, class: "mb-4"), &)
3131
end
3232

33-
def description(&)
34-
p(class: "description", &)
33+
def description(**attributes, &)
34+
p(**mix(attributes, class: "description"), &)
3535
end
3636

3737
def actions(&)

0 commit comments

Comments
 (0)