-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjpdb-config.lua
More file actions
172 lines (149 loc) · 6.89 KB
/
jpdb-config.lua
File metadata and controls
172 lines (149 loc) · 6.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
-- jpdb-config.lua
-- User Configurations for JPDB MPV Plugin
local DS = {
-- ======== POPUP SETTINGS ========
-- Master dimensions for the popup
width = 540, -- Slightly narrower for better focus (reduced from 560)
lbar_w = 3, -- Thinner accent bar (reduced from 4)
pad_h = 14, -- Tighter horizontal padding (reduced from 16)
pad_v = 10, -- Tighter vertical padding (reduced from 12)
unit = 5, -- Smaller spacing unit (reduced from 6)
btn_gap = 3, -- Minimal button gaps (reduced from 4)
-- Surfaces (dark warm paper)
bg_popup = '&H0F0E0A&', -- deepest background
bg_surface = '&H1A1914&', -- card body
bg_header = '&H1C1A15&', -- header zone (slightly darker for less contrast)
bg_divider = '&H2A2620&', -- horizontal rule (lighter for subtlety)
-- Shadows (stacked for depth) - Reduced for cleaner look
shadow_ambient = '&H000000&',
shadow_key = '&H000000&',
shadow_fill = '&H000000&',
-- State badge background tint (very translucent)
badge_alpha = '&HE0&', -- Slightly more transparent (was D8)
-- Text hierarchy - Enhanced contrast
col_primary = '&HFFFFFF&', -- Pure white for kanji (was FAF8F2)
col_secondary = '&HC8C4BC&', -- Brighter readings (was BCB8AE)
col_tertiary = '&H8A8680&', -- muted / meta
col_gloss_odd = '&HF5F2EA&', -- Brighter glosses (was F0EDE6)
col_gloss_even = '&HE0DCD6&', -- Better contrast (was D4D0CA)
col_pos = '&HA8B8CC&', -- Brighter POS tags (was 9BAAC0)
col_freq = '&H88A0B8&', -- Brighter frequency (was 7A92A8)
col_shortcut = '&H888882&', -- Slightly brighter shortcuts (was 70706A)
col_divider = '&H504A40&',
col_toast_ok = '&H60C880&', -- inline success
col_toast_err = '&H5050EE&', -- inline error
-- Buttons: { bg, hover, active }
btn_add = { bg='&H243428&', hov='&H384E38&', act='&H4A6448&' },
btn_blacklist = { bg='&H281E28&', hov='&H402E40&', act='&H583A58&' },
btn_nf = { bg='&H1E2E28&', hov='&H2E4A3C&', act='&H3C6050&' },
btn_nothing = { bg='&H18186A&', hov='&H282890&', act='&H3838A8&' },
btn_something = { bg='&H143878&', hov='&H205098&', act='&H2C62B0&' },
btn_hard = { bg='&H246888&', hov='&H3488A8&', act='&H44A0C0&' },
btn_good = { bg='&H1A6028&', hov='&H288040&', act='&H369C52&' },
btn_easy = { bg='&H603E10&', hov='&H805822&', act='&H9C7030&' },
btn_neutral = { bg='&H282218&', hov='&H3C3428&', act='&H504438&' },
-- Typography sizes - Optimized hierarchy
fs_kanji = 54, -- Slightly larger kanji for prominence (was 52)
fs_reading = 26, -- Balanced reading size (was 28)
fs_pos = 13, -- Smaller POS for less visual weight (was 14)
fs_gloss = 23, -- Optimal gloss size (was 24)
fs_meta = 14, -- Smaller meta (was 15)
fs_badge = 12, -- Smaller badges (was 13)
fs_btn_act = 15, -- Balanced button text (was 16)
fs_btn_rev = 16, -- Balanced review buttons (was 17)
fs_shortcut = 10, -- Minimal shortcuts (was 11)
fs_toast = 14, -- Smaller toast (was 15)
-- Line heights - Optimized for readability and compactness
lh_kanji = 60, -- Breathing room for kanji (was 58)
lh_reading = 30, -- Tighter reading (was 32)
lh_pos = 17, -- Compact POS (was 18)
lh_gloss = 27, -- Optimal gloss spacing (was 28)
lh_meta = 17, -- Compact meta (was 18)
lh_badge = 18, -- Tighter badges (was 20)
lh_toast = 22, -- Compact toast (was 24)
divider_h = 1, -- Horizontal divider line thickness
-- Button heights - Compact but clickable
bh_action = 28, -- More compact action buttons (was 30)
bh_review = 34, -- More compact review buttons (was 36)
}
-- ======== SUBTITLE OVERLAY SETTINGS ========
local SUBTITLE_OVERLAY = {
-- Distance from the bottom of the screen (in pixels)
-- Increase this if your subtitles overlap with the system UI or standard bottom subtitles
pos_y_offset = 90,
-- Subtitle font size rendering
font_size = 60,
-- Glyph width tracking for hit detection. If you change font_size,
-- ideally you should change these proportionally.
-- e.g. if font_size goes from 48 -> 60 (+25%), PX_FULL from 48 -> 60, PX_HALF from 26 -> ~32
px_full = 60,
px_half = 32,
line_h = 72,
}
return {
-- Set to true to write a debug log file (jpdb-debug.log) and verbose messages.
-- Leave false in production — no file is created, dlog() is a no-op.
DEBUG_LOG = false,
SERVER_URL = 'http://127.0.0.1:9726',
-- Change the font family used for both subtitles and popup UI
FONT_FAMILY = 'Yu Gothic UI',
DS = DS,
SUBTITLE_OVERLAY = SUBTITLE_OVERLAY,
-- ======== CARD STATES & COLOURS ========
STATE_COLORS = {
['known'] = '&H50C878&',
['never-forget'] = '&H50C878&',
['learning'] = '&H70C8A0&',
['new'] = '&HE09040&',
['not-in-deck'] = '&HE09040&',
['due'] = '&H4878FF&',
['failed'] = '&H3030EE&',
['locked'] = '&H909098&',
['suspended'] = '&H909098&',
['blacklisted'] = '&H808088&',
['redundant'] = '&HAAAABC&',
},
-- Dimmer palette for non-hovered tokens (subtle — just slightly muted)
STATE_COLORS_DIM = {
['known'] = '&H46B86E&',
['never-forget'] = '&H46B86E&',
['learning'] = '&H64BC94&',
['new'] = '&HCC8838&',
['not-in-deck'] = '&HCC8838&',
['due'] = '&H3C6EEE&',
['failed'] = '&H2828D8&',
['locked'] = '&H80808A&',
['suspended'] = '&H80808A&',
['blacklisted'] = '&H727278&',
['redundant'] = '&H9898AA&',
},
STATE_ALPHA = { ['not-in-deck'] = '&H66&' },
STATE_ALPHA_DIM = { ['not-in-deck'] = '&H44&' },
STATE_LABELS = {
['known'] = 'Known',
['never-forget'] = 'Never Forget',
['learning'] = 'Learning',
['new'] = 'New',
['not-in-deck'] = 'Not in Deck',
['due'] = 'Due',
['failed'] = 'Failed',
['locked'] = 'Locked',
['suspended'] = 'Suspended',
['blacklisted'] = 'Blacklisted',
['redundant'] = 'Redundant',
},
BTN_MAP = {
add = DS.btn_add,
blacklist = DS.btn_blacklist,
['never-forget'] = DS.btn_nf,
nothing = DS.btn_nothing,
something = DS.btn_something,
hard = DS.btn_hard,
good = DS.btn_good,
easy = DS.btn_easy,
},
BTN_SHORTCUTS = {
nothing='1', something='2', hard='3', good='4', easy='5',
add='A', blacklist='B', ['never-forget']='N',
}
}