Skip to content

Commit

Permalink
Add logo and fix print.css
Browse files Browse the repository at this point in the history
In this commit, a new file `logo.svg` is added, which contains the SVG
code for the logo of the project. Additionally, changes are made in the
`print.css` file to adjust the font size variable `--size` and fix
various styling issues related to the display of the logo and project
information.
  • Loading branch information
placek committed May 7, 2024
1 parent bce2170 commit a812474
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 32 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ screen:= /app/screen.css
print := /app/print.css
chapters := /app/chapters.sql
render := /app/render.sed
url := https://github.com/placek/pocket-nt

all: screen print

Expand All @@ -20,8 +21,11 @@ $(left)-$(right).xml: info-$(left).xml info-$(right).xml cross_references.SQLite
mv "$(left).SQLite3" left.db; mv "$(right).SQLite3" right.db; \
{ echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; \
echo "<nt>"; \
echo "<name>$(name)</name>"; \
echo "<logo></logo>"; \
echo "<info>"; \
echo "<name>$(name)</name>$$(cat 'info-$(left).xml' 'info-$(right).xml')"; \
echo "$$(cat 'info-$(left).xml' 'info-$(right).xml')"; \
echo "<description>$(url)</description>"; \
echo "</info>"; \
cat $(chapters) | sqlite3 | sed -rf $(render); \
echo "</nt>"; \
Expand Down
93 changes: 93 additions & 0 deletions logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 35 additions & 26 deletions print.css
Original file line number Diff line number Diff line change
@@ -1,45 +1,54 @@
:root { --size: 2vh; }
:root { --size: 2.1vh; }

@font-face { font-family: greek; src: url(fonts/newathu.ttf); }
@font-face { font-family: mono; src: url(fonts/mono.ttf); }
@font-face { font-family: f1; src: url(fonts/freeserif.ttf); }
@font-face { font-family: f2; src: url(fonts/freesans.ttf); }

@page { margin: 1.6em .8em .8em .8em; marks: crop cross; bleed: 5mm; -prince-trim: 5mm; }
@page { margin: 7vh 5vh 5vh 5vh; marks: crop cross; bleed: 5mm; -prince-trim: 5mm; }
@page title { @bottom-center { content: element(info); font-family: mono; font-weight: 600; font-size: var(--size); } }
@page book:left { @top-left { content: string(book); font-family: mono; font-weight: 600; font-size: var(--size); } }
@page book:right { @top-right { content: string(chapter); font-family: mono; font-weight: 600; font-size: var(--size); } }
@page book:blank { @top-left { content: ""; } @top-right { content: ""; } }
@page book:right { @top-right-corner { content: string(chapter); font-family: mono; font-weight: 600; font-size: var(--size); } }
@page book:blank { @top-left { content: ""; } @top-right-corner { content: ""; } }

* { margin: 0; padding: 0; }
body { font-size: var(--size); text-align: justify; font-family: greek, mono, f1, f2; line-height: 1.2; font-variant-ligatures: historical-ligatures; }
nt { font-size: var(--size); text-align: justify; font-family: greek, mono, f1, f2; line-height: 1.2; font-variant-ligatures: historical-ligatures; }

info { display: flex; width: 100%; justify-content: space-between; }
info name { font-family: mono; font-weight: 600; font-size: 6vh; margin: 46vh 0; padding: 0; text-align: center; display: block; }
name { font-family: mono; font-weight: 600; font-size: 6vh; margin: 32vh 0; padding: 0; text-align: center; display: block; }
logo { width: 35vh; height: 35vh; margin: 0 auto; display: block; background: url(logo.svg) no-repeat center center; background-size: contain; }
info { position: running(info); page: title; }
info description { font-family: mono; display: inline-block; }

book { string-set: book attr(data-book); display: block; break-before: left; page: book; -prince-bookmark-level: 1; -prince-bookmark-label: attr(data-book); }
book { string-set: book attr(name); display: block; break-before: left; page: book; -prince-bookmark-level: 1; -prince-bookmark-label: attr(name); }

column { display: block; padding: 0 .5em; hyphens: auto; }
column, left, right { display: block; padding: 0 .5em; hyphens: auto; min-width: 45%; }

chapter { string-set: chapter attr(data-chapter); display: flex; -prince-bookmark-level: 2; -prince-bookmark-label: attr(data-chapter); }
chapter:before { content: attr(data-chapter); font-family: mono; font-weight: 600; }
chapter[data-chapter="1"]:before { display: none; }
chapter[data-chapter="1"] verse[data-verse="1"] { padding-top: 1em; }
chapter[data-chapter="1"] verse[data-verse="1"]::first-letter { font-size: 2.2em; float: left; line-height: 0.5em; }
chapter { display: flex; }
chapter[number="1"] verse[number="1"] { padding-top: 1em; }

number { string-set: chapter content(); -prince-bookmark-level: 2; -prince-bookmark-label: string(chapter); font-family: mono; font-weight: 600; -prince-float: outside; -prince-margin-outside: -1em; break-after: avoid; }
chapter[number="1"] number { display: none; }

book chapter:first-of-type verse[number="1"] { display: block; }
book chapter:first-of-type verse[number="1"]::first-letter { font-size: 2.2em; float: left; line-height: 0.5em; }
book chapter:first-of-type verse[number="1"]:before { display: none; }
verse { display: inline; }
verse[data-verse="1"] { display: inline-block; }
verse[data-verse="1"]:before { display: none; }
verse:before { content: attr(data-verse); font-family: mono; font-weight: 600; font-size: .6em; margin: 0 .5em; vertical-align: super; }
verse:before { content: attr(number); font-family: mono; font-weight: 600; font-size: .6em; margin: 0 .5em; vertical-align: super; }

reference { font-family: mono; font-size: .6em; margin: 0 .5em; vertical-align: baseline; display: inline; }

reference[data-rate="1"],
reference[data-rate="2"],
reference[data-rate="3"],
reference[data-rate="4"],
reference[data-rate="5"],
reference[data-rate="6"],
reference[data-rate="7"],
reference[data-rate="8"],
reference[data-rate="9"]
reference[rate="1"],
reference[rate="2"],
reference[rate="3"],
reference[rate="4"],
reference[rate="5"],
reference[rate="6"],
reference[rate="7"],
reference[rate="8"],
reference[rate="9"],
reference[rate="10"],
reference[rate="11"],
reference[rate="12"],
reference[rate="13"],
reference[rate="14"]
{ display: none; }
13 changes: 8 additions & 5 deletions screen.css
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
:root { --size: 2.1vh; }
:root { --size: 2.3vh; }

@font-face { font-family: greek; src: url(fonts/newathu.ttf); }
@font-face { font-family: mono; src: url(fonts/mono.ttf); }
@font-face { font-family: f1; src: url(fonts/freeserif.ttf); }
@font-face { font-family: f2; src: url(fonts/freesans.ttf); }

@page { margin: 7vh 5vh 5vh 5vh; }
@page title { @bottom-center { content: element(info); font-family: mono; font-weight: 600; font-size: var(--size); } }
@page book:left { @top-left { content: string(book); font-family: mono; font-weight: 600; font-size: var(--size); } }
@page book:right { @top-right-corner { content: string(chapter); font-family: mono; font-weight: 600; font-size: var(--size); } }
@page book:blank { @top-left { content: ""; } @top-right { content: ""; } }
@page book:blank { @top-left { content: ""; } @top-right-corner { content: ""; } }

* { margin: 0; padding: 0; }
nt { font-size: var(--size); text-align: justify; font-family: greek, mono, f1, f2; line-height: 1.2; font-variant-ligatures: historical-ligatures; }

info { width: 100%; justify-content: space-between; }
info name { font-family: mono; font-weight: 600; font-size: 6vh; margin: 47vh 0; padding: 0; text-align: center; display: block; }
name { font-family: mono; font-weight: 600; font-size: 6vh; margin: 32vh 0; padding: 0; text-align: center; display: block; }
logo { width: 35vh; height: 35vh; margin: 0 auto; display: block; background: url(logo.svg) no-repeat center center; background-size: contain; }
info { position: running(info); page: title; }
info description { font-family: mono; display: inline-block; }

book { string-set: book attr(name); display: block; break-before: left; page: book; -prince-bookmark-level: 1; -prince-bookmark-label: attr(name); }

Expand All @@ -30,7 +33,7 @@ book chapter:first-of-type verse[number="1"] { display: block; }
book chapter:first-of-type verse[number="1"]::first-letter { font-size: 2.2em; float: left; line-height: 0.5em; }
book chapter:first-of-type verse[number="1"]:before { display: none; }
verse { display: inline; }
verse:before { content: attr(number); font-family: mono; font-weight: 600; font-size: .6em; margin: 0 .5em; vertical-align: super; }
verse:before { content: attr(number); font-family: mono; font-weight: 600; font-size: .5em; margin: 0 .5em; vertical-align: super; }

reference { font-family: mono; font-size: .6em; margin: 0 .5em; vertical-align: baseline; display: inline; }

Expand Down

0 comments on commit a812474

Please sign in to comment.