Skip to content

Commit

Permalink
Introduce Devanagri Typeset
Browse files Browse the repository at this point in the history
  • Loading branch information
ks0m1c_dharma committed Nov 27, 2023
1 parent 2287bb5 commit c6e5c66
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 7 deletions.
10 changes: 9 additions & 1 deletion assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@
@import "tailwindcss/components";
@import "tailwindcss/utilities";

/* This file is for your main application CSS */
/* fonts declared from priv/assets/fonts */

@font-face {
font-family: "Gotu";
src: url('/fonts/gotu/Gotu-Regular.woff2') format('woff2'),
url('/fonts/gotu/Gotu-Regular.woff') format('woff'),
url('/fonts/gotu/Gotu-Regular.ttf') format('ttf');
}
/* This file is for your main application CSS */
5 changes: 5 additions & 0 deletions assets/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ module.exports = {
],
theme: {
extend: {
fontFamily: {
'dn': ['"Gotu"', 'sans-serif'],
'tl': ['"Tamil Font"', 'sans-serif'],
},
colors: {
brand: "#FD4F00",
}
},
},
plugins: [
require("@tailwindcss/typography"),
require("@tailwindcss/forms"),
// Allows prefixing tailwind classes with LiveView classes to add rules
// only when LiveView classes are applied, for example:
Expand Down
2 changes: 1 addition & 1 deletion config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ config :vyasa, VyasaWeb.Endpoint,
debug_errors: true,
secret_key_base: "TSFFKfQoGKCAjI5yxwt9DmxwnJg1U7CnuCsxpWjr+DqXs8EavSxtO3l3wk2PquSW",
watchers: [
esbuild: {Esbuild, :install_and_run, [:default, ~w(--sourcemap=inline --watch)]},
esbuild: {Esbuild, :install_and_run, [:default, ~w(--sourcemap=inline --watch --loader:.ttf=file)]},
tailwind: {Tailwind, :install_and_run, [:default, ~w(--watch)]}
]

Expand Down
4 changes: 2 additions & 2 deletions lib/vyasa_web/components/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -530,15 +530,15 @@ defmodule VyasaWeb.CoreComponents do
</.list>
"""
slot :item, required: true do
attr :title, :string, required: true
attr :title, :string
end

def list(assigns) do
~H"""
<div class="mt-14">
<dl class="-my-4 divide-y divide-zinc-100">
<div :for={item <- @item} class="flex gap-4 py-4 text-sm leading-6 sm:gap-8">
<dt class="w-1/4 flex-none text-zinc-500"><%= item.title %></dt>
<dt :if={Map.has_key?(item, :title)} class="w-1/6 flex-none text-zinc-500"><%= item.title %></dt>
<dd class="text-zinc-700"><%= render_slot(item) %></dd>
</div>
</dl>
Expand Down
5 changes: 3 additions & 2 deletions lib/vyasa_web/live/gita_live/show.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ defmodule VyasaWeb.GitaLive.Show do
</.header>
<.list :for={{_dom_id, text} <- @streams.verses}>
<:item title={"#{text.chapter_number}.#{text.verse_number}"}><%= text.transliteration %></:item>
<:item title={""}><%= text.word_meanings %></:item>
<:item title={"#{text.chapter_number}.#{text.verse_number}"}><p class="font-dn text-2xl"><%= text.text |> String.split("।।") |> List.first() %></p></:item>
<:item><%= text.transliteration %></:item>
<:item><%= text.word_meanings %></:item>
</.list>
<.back navigate={~p"/gita"}>Back to Gita</.back>
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ defmodule Vyasa.MixProject do
test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"],
"assets.setup": ["tailwind.install --if-missing", "esbuild.install --if-missing"],
"assets.build": ["tailwind default", "esbuild default"],
"assets.deploy": ["tailwind default --minify", "esbuild default --minify", "phx.digest"]
"assets.deploy": ["tailwind default --minify", "esbuild default --minify --loader:.ttf=file", "phx.digest"]
]
end
end
Binary file added priv/static/fonts/gotu/Gotu-Regular.ttf
Binary file not shown.
Binary file added priv/static/fonts/gotu/Gotu-Regular.woff
Binary file not shown.
Binary file added priv/static/fonts/gotu/Gotu-Regular.woff2
Binary file not shown.

0 comments on commit c6e5c66

Please sign in to comment.