Skip to content

Commit

Permalink
chore: fix logo sizes & alt
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Jan 18, 2025
1 parent 59bb040 commit a5def43
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 20 deletions.
4 changes: 2 additions & 2 deletions lib/ash_hq_web/templates/home/home.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
</span>
</h1>
<div class="bg-slate-950/50 overflow-hidden sm:mx-0 sm:rounded-2xl md:grid-cols-4 backdrop-blur-lg">
<div class={"grid #{logos_grid()} gap-0.5 justify-center justify-items-center mt-12"}>
<div class={"grid #{logos_grid()} gap-0.5 justify-center justify-items-center my-12"}>
<%= for {name, %{href: href, src: src}} <- logos() do %>
<%= if name == :placeholder do %>
<div />
Expand All @@ -267,7 +267,7 @@
href={href}
title={name}
alt={name}
class="content-center w-full py-4"
class="content-center w-full py-2 max-w-36"
>
<img class="h-8 w-full object-contain" src={src} />
</a>
Expand Down
43 changes: 25 additions & 18 deletions lib/ash_hq_web/views/home_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,31 @@ defmodule AshHqWeb.HomeView do

needed = count - Enum.count(first)

left = div(needed, 2)

right =
if rem(count, 2) == 1 do
left + 1
else
left
end

new_first =
Enum.concat([
Stream.duplicate({:placeholder, %{href: "", src: ""}}, left),
first,
Stream.duplicate({:placeholder, %{href: "", src: ""}}, right)
])

Enum.reverse([new_first | rest])
|> List.flatten()
if needed == 1 do
{l, r} = Enum.split(first, div(count, 2))

Enum.reverse([[l ++ [{:placeholder, %{href: "", src: ""}}] ++ r] | rest])
|> List.flatten()
else
left = div(needed, 2)

right =
if rem(count, 2) == 1 do
left + 1
else
left
end

new_first =
Enum.concat([
Stream.duplicate({:placeholder, %{href: "", src: ""}}, left),
first,
Stream.duplicate({:placeholder, %{href: "", src: ""}}, right)
])

Enum.reverse([new_first | rest])
|> List.flatten()
end
end

defp features do
Expand Down

0 comments on commit a5def43

Please sign in to comment.