Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Update menu
Browse files Browse the repository at this point in the history
  • Loading branch information
cu1ch3n committed Mar 17, 2024
1 parent 93bb976 commit fff040e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 10 deletions.
1 change: 1 addition & 0 deletions main.typ
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
- #item[苹果脆片][Apple Chips]

#cuisine[甜点][Desserts]
- #item[香蕉派][Banana Pie]
- #item[戚风蛋糕][Chiffon Cake]
- #item[蓝莓山药][Blueberry Yam]

Expand Down
48 changes: 38 additions & 10 deletions menu.typ
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
#v(.2em)
]

#let item_counter = counter("item")

#let item(name_zh, name_en, emoji: none) = box[
#item_counter.step()
#zh_text(14pt)[#name_zh #h(1fr) #emoji] \
#v(-.7em)#h(.14em)#en_text(10pt)[#name_en]
]
Expand Down Expand Up @@ -51,6 +54,12 @@
stroke: 1pt + nord3
)
let frame_vert_line_dy = frame.dy + frame_font_size + .5em

let frame_horiz_line = line(
length: column_width - 2 * (frame.dx + frame_font_size) - .6em,
stroke: 1pt + nord3
)
let frame_horiz_line_dx = frame.dx + frame_font_size + .3em

let seperator_vert_line = line(
length: page_height,
Expand Down Expand Up @@ -86,13 +95,21 @@
dx: - (offset_xr + 2 * frame.dx) + 4pt,
dy: frame_vert_line_dy,
frame_vert_line)
place(top + left,
dx: offset_xl + frame_horiz_line_dx,
dy: frame.dy + 4pt,
frame_horiz_line)
place(bottom + left,
dx: offset_xl + frame_horiz_line_dx,
dy: - frame.dy + 4pt,
frame_horiz_line)
place(bottom + left,
dx: offset_xl + 0.5 * column_width,
dy: - frame.dy,
context([
#let num = (counter(page).get().at(0) - 1) * 3 + i
#if num != 0 { en_text(10pt, style: "normal")[#num] }
]))
dx: offset_xl + 0.5 * column_width,
dy: - frame.dy - 1em,
context([
#let num = (counter(page).get().at(0) - 1) * 3 + i
#if num != 0 { en_text(10pt, style: "normal")[#numbering("I", num)] }
]))
}
]
)
Expand All @@ -104,13 +121,24 @@
#v(30pt)
#image("title.png")
#v(60pt)
#if update_time != none [
#zh_text(10pt)[更新于:#update_time.display("[year]年[month padding:none]月[day padding:none]日") ] \
#en_text(8pt)[Updated on #update_time.display("[month repr:long] [day], [year]")]
#context [
#let num_items = item_counter.final().at(0)
#if update_time != none [
#zh_text(10pt)[
// 共 #num_items 道菜;
更新于:#update_time.display("[year]年[month padding:none]月[day padding:none]日") ] \
#en_text(8pt)[
// #num_items dishes in total;
Updated on #update_time.display("[month repr:long] [day], [year]")]
]
]
#colbreak()
]
let end_page = [
#colbreak(weak: true)
]
set list(marker: [#v(.8em)#en_text(16pt, fill: nord3)[☐]])
columns(num_columns, gutter: frame.dx * 2 + 4em)[#title_page #doc]
columns(num_columns, gutter: frame.dx * 2 + 4em)[#title_page #doc #end_page]
}

0 comments on commit fff040e

Please sign in to comment.