Merge pull request 'devel' (#43) from devel into main

Reviewed-on: #43
This commit is contained in:
inhji 2023-04-03 22:31:47 +02:00
commit a41d4dae8e
5 changed files with 96 additions and 102 deletions

View file

@ -79,11 +79,11 @@ defmodule ChiyaWeb.AdminComponents do
def admin_bar(assigns) do
~H"""
<ul class="sticky top-0 backdrop-blur-sm z-10 flex items-center gap-4 py-1 px-4 sm:px-6 lg:px-8 bg-black/30">
<ul class="sticky top-0 backdrop-blur-sm z-10 flex items-center gap-4 py-1 px-4 sm:px-6 lg:px-8 bg-white/30 dark:bg-black/30">
<li>
<.link
href={~p"/"}
class="flex gap-3 text-sm leading-6 text-gray-100 font-semibold hover:text-gray-300"
class="flex gap-3 text-sm leading-6 font-semibold text-gray-900 dark:text-gray-100 dark:hover:text-gray-300 hover:text-gray-700"
>
<span>Chiya</span>
<p class="rounded-full bg-theme-primary/10 px-2 text-[0.8125rem] font-medium leading-6 text-theme-primary">
@ -97,7 +97,7 @@ defmodule ChiyaWeb.AdminComponents do
<.link
href="#"
id="dark-mode-toggle"
class="text-xs leading-6 text-gray-100 font-semibold hover:text-gray-300"
class="text-xs leading-6 text-gray-900 dark:text-gray-100 font-semibold dark:hover:text-gray-300 hover:text-gray-700"
>
<.icon name="hero-sun-mini" class="h-4 w-4" />
</.link>
@ -105,7 +105,7 @@ defmodule ChiyaWeb.AdminComponents do
<li>
<.link
href={~p"/admin"}
class="text-xs leading-6 text-gray-100 font-semibold hover:text-gray-300"
class="text-xs leading-6 text-gray-900 dark:text-gray-100 font-semibold dark:hover:text-gray-300 hover:text-gray-700"
>
Admin
</.link>
@ -114,7 +114,7 @@ defmodule ChiyaWeb.AdminComponents do
<.link
href={~p"/user/log_out"}
method="delete"
class="text-xs leading-6 text-gray-100 font-semibold hover:text-gray-300"
class="text-xs leading-6 text-gray-900 dark:text-gray-100 font-semibold dark:hover:text-gray-300 hover:text-gray-700"
>
Log out
</.link>
@ -124,7 +124,7 @@ defmodule ChiyaWeb.AdminComponents do
<.link
href="#"
id="dark-mode-toggle"
class="text-xs leading-6 text-gray-100 font-semibold hover:text-gray-300"
class="text-xs leading-6 text-gray-900 dark:text-gray-100 font-semibold dark:hover:text-gray-300 hover:text-gray-700"
>
<.icon name="hero-sun-mini" class="h-4 w-4" />
</.link>
@ -132,7 +132,7 @@ defmodule ChiyaWeb.AdminComponents do
<li>
<.link
href={~p"/user/log_in"}
class="text-xs leading-6 text-gray-100 font-semibold hover:text-gray-300"
class="text-xs leading-6 text-gray-100 font-semibold dark:hover:text-gray-300 hover:text-gray-700"
>
Log in
</.link>

View file

@ -13,7 +13,7 @@
</div>
</header>
<main class="px-4 py-20 sm:px-6 lg:px-8">
<main>
<div class="mx-auto max-w-2xl">
<.flash_group flash={@flash} />
<%= @inner_content %>

View file

@ -1,22 +1,20 @@
<div class="px-4 py-10 sm:py-28 sm:px-6 lg:px-8 xl:py-32 xl:px-28">
<div class="mx-auto max-w-xl lg:mx-0">
<h1 class="mt-4 text-[2rem] font-semibold font-serif leading-10 tracking-tighter text-theme-primary">
<%= @channel.name %>
</h1>
<p class="mt-4 text-base leading-7 text-theme-base">
<%= @channel.content %>
</p>
<div class="mx-auto max-w-xl mx-4 lg:mx-0">
<h1 class="mt-16 text-[2rem] font-semibold font-serif leading-10 tracking-tighter text-theme-primary">
<%= @channel.name %>
</h1>
<p class="mt-4 text-base leading-7 text-theme-base">
<%= @channel.content %>
</p>
<div class="w-full mt-6 sm:w-auto flex flex-col gap-1.5">
<%= for note <- @channel.notes do %>
<a
href={~p"/#{note.slug}"}
class="rounded -mx-2 -my-0.5 px-2 py-0.5 hover:bg-theme-primary/10 transition"
>
<span class="text-theme-heading text-lg font-semibold leading-8"><%= note.name %></span>
<span class="text-theme-base text-sm"><%= pretty_date(note.published_at) %></span>
</a>
<% end %>
</div>
<div class="w-full mt-6 sm:w-auto flex flex-col gap-1.5">
<%= for note <- @channel.notes do %>
<a
href={~p"/#{note.slug}"}
class="rounded -mx-2 -my-0.5 px-2 py-0.5 hover:bg-theme-primary/10 transition"
>
<span class="text-theme-heading text-lg font-semibold leading-8"><%= note.name %></span>
<span class="text-theme-base text-sm"><%= pretty_date(note.published_at) %></span>
</a>
<% end %>
</div>
</div>
</div>

View file

@ -1,42 +1,40 @@
<div class="px-4 py-10 sm:py-28 sm:px-6 lg:px-8 xl:py-32 xl:px-28">
<div class="mx-auto max-w-xl lg:mx-0">
<h1 class="mt-4 text-[2rem] font-semibold font-serif leading-10 tracking-tighter text-theme-primary">
<%= @settings.title %>
</h1>
<p class="mt-4 text-base leading-7 text-theme-base">
<%= @settings.subtitle %>
</p>
<div class="mx-auto max-w-xl mx-4 lg:mx-0">
<h1 class="mt-16 text-3xl font-semibold font-serif leading-10 tracking-tighter text-theme-primary">
<%= @settings.title %>
</h1>
<p class="mt-4 text-base leading-7 text-theme-base">
<%= @settings.subtitle %>
</p>
<div class="w-full mt-6 sm:w-auto">
<div class="flex gap-4 text-sm leading-6 text-theme-base">
<%= for identity <- @identities do %>
<div>
<a
rel={identity.rel}
href={identity.url}
class="group -mx-2 -my-0.5 inline-flex items-center gap-3 rounded-lg px-2 py-0.5 hover:bg-theme-primary/10 transition"
>
<%= raw(identity.icon) %>
<%= identity.name %>
</a>
</div>
<% end %>
</div>
</div>
<%= if @channel do %>
<div class="w-full mt-6 sm:w-auto flex flex-col gap-1.5">
<%= for note <- @channel.notes do %>
<div class="w-full mt-6 sm:w-auto">
<div class="flex gap-4 text-sm leading-6 text-theme-base">
<%= for identity <- @identities do %>
<div>
<a
href={~p"/#{note.slug}"}
class="rounded -mx-2 -my-0.5 px-2 py-0.5 hover:bg-theme-primary/10 transition"
rel={identity.rel}
href={identity.url}
class="group -mx-2 -my-0.5 inline-flex items-center gap-3 rounded-lg px-2 py-0.5 hover:bg-theme-primary/10 transition"
>
<span class="text-theme-heading text-lg font-semibold leading-8">
<%= note.name %>
</span>
<span class="text-theme-base text-sm"><%= pretty_date(note.published_at) %></span>
<%= raw(identity.icon) %>
<%= identity.name %>
</a>
<% end %>
</div>
<% end %>
</div>
<% end %>
</div>
</div>
<%= if @channel do %>
<div class="mt-6 sm:w-auto flex flex-col gap-1.5">
<%= for note <- @channel.notes do %>
<a
href={~p"/#{note.slug}"}
class="rounded-lg -mx-2 -my-0.5 px-2 py-0.5 hover:bg-theme-primary/30 transition"
>
<span class="text-theme-heading text-lg font-semibold leading-8">
<%= note.name %>
</span>
<span class="text-theme-base text-sm"><%= pretty_date(note.published_at) %></span>
</a>
<% end %>
</div>
<% end %>
</div>

View file

@ -1,43 +1,41 @@
<div class="px-4 py-10 sm:py-28 sm:px-6 lg:px-8 xl:py-32 xl:px-28">
<div class="mx-auto max-w-xl lg:mx-0">
<header>
<h1 class="text-3xl font-semibold leading-8 text-theme-heading font-serif underline underline-offset-2 decoration-theme-primary">
<%= @note.name %>
</h1>
<p class="mt-2 text-sm leading-6 text-theme-base font-semibold">
<%= pretty_date(@note.published_at) %>
</p>
</header>
<div class="mx-auto max-w-xl mx-4 lg:mx-0">
<header>
<h1 class="mt-16 text-3xl font-semibold leading-8 text-theme-heading font-serif underline underline-offset-2 decoration-theme-primary">
<%= @note.name %>
</h1>
<p class="mt-2 text-sm leading-6 text-theme-base font-semibold">
<%= pretty_date(@note.published_at) %>
</p>
</header>
<section class="prose mt-8">
<%= Markdown.render(@note.content) |> raw %>
</section>
<section class="prose mt-8">
<%= Markdown.render(@note.content) |> raw %>
</section>
<%= if !Enum.empty?(@note.images) do %>
<.line />
<%= if !Enum.empty?(@note.images) do %>
<.line />
<div class="flex flex-wrap gap-3" id="images">
<%= for image <- @note.images do %>
<article>
<a href={"#image-#{image.id}"}>
<div class="flex flex-wrap gap-3" id="images">
<%= for image <- @note.images do %>
<article>
<a href={"#image-#{image.id}"}>
<img
class="rounded-lg w-28 border"
src={ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :thumb_dithered)}
/>
</a>
<a href="#images" class="lightbox" id={"image-#{image.id}"}>
<span>
<img
class="rounded-lg w-28 border"
src={ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :thumb_dithered)}
class="md:max-w-screen-sm lg:max-w-screen-md xl:max-w-screen-lg max-h-screen mx-auto"
src={ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :full_dithered)}
loading="lazy"
/>
</a>
<a href="#images" class="lightbox" id={"image-#{image.id}"}>
<span>
<img
class="md:max-w-screen-sm lg:max-w-screen-md xl:max-w-screen-lg max-h-screen mx-auto"
src={ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :full_dithered)}
loading="lazy"
/>
<span class="text-theme-background text-center"><%= image.content %></span>
</span>
</a>
</article>
<% end %>
</div>
<% end %>
</div>
</div>
<span class="text-theme-background text-center"><%= image.content %></span>
</span>
</a>
</article>
<% end %>
</div>
<% end %>
</div>