Add actor/show.html.heex
This commit is contained in:
parent
894866ca03
commit
10756907dc
1 changed files with 23 additions and 23 deletions
126
lib/nulla_web/components/templates/actor/show.html.heex
Normal file
126
lib/nulla_web/components/templates/actor/show.html.heex
Normal file
|
@ -0,0 +1,126 @@
|
|||
<main class="grid grid-cols-[25%_50%_25%]">
|
||||
<div class="flex flex-col items-center mt-5 gap-5">
|
||||
<input
|
||||
placeholder="Search"
|
||||
class="border border-gray-300 px-4 py-3 rounded-xl outline-none w-[90%]"
|
||||
/>
|
||||
<div class="text-sm rounded-xl border border-gray-300 p-2 w-[90%]">
|
||||
<textarea
|
||||
placeholder="What's on your mind?"
|
||||
class="h-[150px] w-full resize-none border-none focus:ring-0"
|
||||
></textarea>
|
||||
<div>
|
||||
<button class="text-white bg-black px-3 py-1 rounded-xl">Post</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="relative border border-gray-300 shadow-md mt-5 rounded-t-xl overflow-hidden">
|
||||
<div class="relative w-full aspect-[3/1]">
|
||||
<img src={@actor.image["url"]} class="w-full h-full object-cover" />
|
||||
<div class="absolute inset-0 flex items-end justify-between px-4 pb-2 pointer-events-none">
|
||||
<img
|
||||
src={@actor.icon["url"]}}
|
||||
class="translate-y-1/2 rounded-full border-4 border-white w-[8.33vw] h-[8.33vw] min-w-[80px] min-h-[80px] max-w-[160px] max-h-[160px] pointer-events-auto"
|
||||
/>
|
||||
<button class="px-8 py-2 rounded-full text-sm font-semibold border transition bg-black text-white border-black hover:bg-gray-900 pointer-events-auto">
|
||||
Follow
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-[4.5vw] px-4 flex flex-col">
|
||||
<span class="text-xl font-bold">{@actor.name}</span>
|
||||
<span class="text-gray-500">@{@actor.preferredUsername}@{@actor.domain}</span>
|
||||
<div class="text-sm pt-2">
|
||||
<p>{@actor.summary}</p>
|
||||
</div>
|
||||
<dl class="mt-2 text-sm text-gray-700 grid grid-cols-[auto,1fr] gap-x-2 gap-y-1 items-center">
|
||||
<%= if @actor.vcard_Address do %>
|
||||
<dt class="flex items-center gap-2">
|
||||
<.icon name="hero-map-pin" class="mt-0.5 h-5 w-5 flex-none" />
|
||||
</dt>
|
||||
<dd>{@actor.vcard_Address}</dd>
|
||||
<% end %>
|
||||
<%= if @actor.vcard_bday do %>
|
||||
<dt class="flex items-center gap-2">
|
||||
<.icon name="hero-cake" class="mt-0.5 h-5 w-5 flex-none" />
|
||||
</dt>
|
||||
<dd>{format_birthdate(@actor.vcard_bday)}</dd>
|
||||
<% end %>
|
||||
<dt class="flex items-center gap-2">
|
||||
<.icon name="hero-calendar" class="mt-0.5 h-5 w-5 flex-none" />
|
||||
</dt>
|
||||
<dd>{format_registration_date(@actor.published)}</dd>
|
||||
</dl>
|
||||
<%= if @actor.attachment do %>
|
||||
<dl class="mt-5 grid grid-cols-[max-content,1fr] gap-x-5 gap-y-2 items-center">
|
||||
<%= for %{"type" => "PropertyValue", "name" => name, "value" => value} <- @actor.attachment do %>
|
||||
<dt>{name}</dt>
|
||||
<dd>
|
||||
<%= if Regex.match?(~r{://}, value) do %>
|
||||
<a href={value} class="text-[#1D9BF0]">{Regex.replace(~r{^\w+://}, value, "")}</a>
|
||||
<% else %>
|
||||
{value}
|
||||
<% end %>
|
||||
</dd>
|
||||
<% end %>
|
||||
</dl>
|
||||
<% end %>
|
||||
<div class="flex mt-5 gap-3">
|
||||
<a href={~p"/@#{@actor.preferredUsername}"}>{length(@notes)} Posts</a>
|
||||
<a href={~p"/@#{@actor.preferredUsername}/following"}>{@following} Following</a>
|
||||
<a href={~p"/@#{@actor.preferredUsername}/followers"}>{@followers} Followers</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-between px-20 py-2 mt-5 border-y border-gray-300">
|
||||
<a href={~p"/@#{@actor.preferredUsername}/featured"}>Featured</a>
|
||||
<a href={~p"/@#{@actor.preferredUsername}"}>Posts</a>
|
||||
<a href={~p"/@#{@actor.preferredUsername}/with_replies"}>Posts and replies</a>
|
||||
<a href={~p"/@#{@actor.preferredUsername}/media"}>Media</a>
|
||||
</div>
|
||||
<div>
|
||||
<%= for note <- @notes do %>
|
||||
<div class="p-4 border-b border-gray-300">
|
||||
<div class="flex items-start space-x-4">
|
||||
<img src={@actor.icon["url"]}} class="rounded-full w-[58px] h-[58px]" />
|
||||
<div class="flex-1">
|
||||
<div class="flex justify-between items-start">
|
||||
<div class="flex items-center space-x-2">
|
||||
<span class="font-semibold text-gray-900 text-sm">
|
||||
{@actor.name}
|
||||
</span>
|
||||
<span class="text-gray-500 text-sm">
|
||||
@{@actor.preferredUsername}@{@actor.domain}
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex items-center space-x-2 text-sm text-gray-500">
|
||||
<%= case note.visibility do %>
|
||||
<% :public -> %>
|
||||
<.icon name="hero-globe-americas" class="h-5 w-5" />
|
||||
<% :unlisted -> %>
|
||||
<.icon name="hero-moon" class="h-5 w-5" />
|
||||
<% :followers -> %>
|
||||
<.icon name="hero-lock-closed" class="h-5 w-5" />
|
||||
<% :private -> %>
|
||||
<.icon name="hero-at-symbol" class="h-5 w-5" />
|
||||
<% end %>
|
||||
<span>{format_note_datetime_diff(note.inserted_at)}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-gray-800">
|
||||
<p>{note.content}</p>
|
||||
</div>
|
||||
<div class="flex gap-10 mt-4">
|
||||
<button><.icon name="hero-chat-bubble-left" class="h-5 w-5" /></button>
|
||||
<button><.icon name="hero-arrow-path-rounded-square" class="h-5 w-5" /></button>
|
||||
<button><.icon name="hero-plus" class="h-5 w-5" /></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col items-center mt-5 gap-5">
|
||||
<div class="text-sm rounded-xl border border-gray-300 p-4 w-[90%] h-[300px]"></div>
|
||||
</div>
|
||||
</main>
|
Loading…
Add table
Add a link
Reference in a new issue