Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion assets/css/_homepage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,25 @@
color: $gray-dark;
text-decoration: none;
}
svg {
width: 4em;
}

@include media-breakpoint-down(md) {
@include icon-size(3.25em);
svg {
width: 3.25em;
}
}

@include media-breakpoint-only(xs) {
@include icon-size(2.5em);
padding: 12px;
svg {
width: 2.5em;
}
}

[class*='c-svg__icon'] {
margin-bottom: math.div($base-spacing, 2);

Expand Down
10 changes: 9 additions & 1 deletion lib/dotcom_web/views/page_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ defmodule DotcomWeb.PageView do
end

def shortcut_icons do
[:commuter_rail, :subway, :bus, :ferry, :the_ride]
[:commuter_rail, :subway, :bus, :ferry, :the_ride, :football]
|> Enum.map(&shortcut_icon/1)
end

Expand All @@ -170,6 +170,9 @@ defmodule DotcomWeb.PageView do
defp shortcut_link(:commuter_rail),
do: schedule_path(DotcomWeb.Endpoint, :show, :"commuter-rail")

defp shortcut_link(:football),
do: ~p"/schedules/bostonstadium"

defp shortcut_link(mode), do: schedule_path(DotcomWeb.Endpoint, :show, mode)

@spec shortcut_text(atom) :: [Phoenix.HTML.Safe.t()]
Expand All @@ -195,6 +198,10 @@ defmodule DotcomWeb.PageView do
]
end

defp shortcut_text(:football) do
content_tag(:span, ~t"Boston Stadium Trains")
end

defp shortcut_text(mode) do
[
mode_name(mode),
Expand All @@ -205,6 +212,7 @@ defmodule DotcomWeb.PageView do
defp shortcut_svg_name(:stations), do: "icon-circle-t-default.svg"
defp shortcut_svg_name(:the_ride), do: "icon-the-ride-default.svg"
defp shortcut_svg_name(:commuter_rail), do: shortcut_svg_name(:"commuter-rail")
defp shortcut_svg_name(:football), do: "football.svg"
defp shortcut_svg_name(mode), do: "icon-mode-#{mode}-default.svg"

def schedule_separator do
Expand Down
2 changes: 1 addition & 1 deletion test/dotcom_web/views/page_view_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ defmodule DotcomWeb.PageViewTest do
describe "shortcut_icons/0" do
test "renders shortcut icons" do
icons = PageView.shortcut_icons()
assert length(icons) == 5
assert length(icons) == 6

icon =
List.first(icons)
Expand Down
Loading