Skip to content

Commit cdeebd9

Browse files
Merge pull request #22 from freddiefujiwara/match-tv-ze-gs-look-and-feel-868382404318427464
2 parents 4c46f03 + 2c4d9ac commit cdeebd9

File tree

4 files changed

+86
-50
lines changed

4 files changed

+86
-50
lines changed

index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
}
2929
})();
3030
</script>
31+
<link rel="preconnect" href="https://fonts.googleapis.com">
32+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
33+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" rel="stylesheet">
3134
<title>Markdown to Image</title>
3235
<meta property="og:type" content="website" />
3336
<meta property="og:title" content="Markdown to Image" />

src/components/MarkdownToolbar.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ defineExpose(
132132
133133
<template>
134134
<div
135-
class="lg:hidden fixed inset-x-0 z-30 border-t border-slate-200 bg-white/95 backdrop-blur"
135+
class="lg:hidden fixed inset-x-0 z-30 border-t border-[var(--border)] bg-[var(--bg)]/95 backdrop-blur"
136136
:style="{
137137
bottom: `calc(${toolbarOffset}px + env(safe-area-inset-bottom, 0px))`,
138138
paddingBottom: '0.5rem',
@@ -142,7 +142,7 @@ defineExpose(
142142
<div class="flex gap-2 min-w-max" role="toolbar" aria-label="Markdown toolbar">
143143
<button
144144
type="button"
145-
class="px-3 py-2 rounded-lg border border-slate-200 bg-white text-sm font-semibold shadow-sm"
145+
class="px-4 py-2 rounded-lg border border-[var(--border)] bg-[var(--surface-elevated)] text-[var(--link)] font-bold shadow-sm active:scale-95 transition-all"
146146
data-action="heading"
147147
@mousedown.prevent
148148
@touchstart.prevent.stop="handleLineAction('heading')"
@@ -152,7 +152,7 @@ defineExpose(
152152
</button>
153153
<button
154154
type="button"
155-
class="px-3 py-2 rounded-lg border border-slate-200 bg-white text-sm font-semibold shadow-sm"
155+
class="px-4 py-2 rounded-lg border border-[var(--border)] bg-[var(--surface-elevated)] text-[var(--link)] font-bold shadow-sm active:scale-95 transition-all"
156156
data-action="list"
157157
@mousedown.prevent
158158
@touchstart.prevent.stop="handleLineAction('list')"
@@ -162,7 +162,7 @@ defineExpose(
162162
</button>
163163
<button
164164
type="button"
165-
class="px-3 py-2 rounded-lg border border-slate-200 bg-white text-sm font-semibold shadow-sm"
165+
class="px-4 py-2 rounded-lg border border-[var(--border)] bg-[var(--surface-elevated)] text-[var(--link)] font-bold shadow-sm active:scale-95 transition-all"
166166
data-action="quote"
167167
@mousedown.prevent
168168
@touchstart.prevent.stop="handleLineAction('quote')"
@@ -172,7 +172,7 @@ defineExpose(
172172
</button>
173173
<button
174174
type="button"
175-
class="px-3 py-2 rounded-lg border border-slate-200 bg-white text-sm font-semibold shadow-sm"
175+
class="px-4 py-2 rounded-lg border border-[var(--border)] bg-[var(--surface-elevated)] text-[var(--link)] font-bold shadow-sm active:scale-95 transition-all"
176176
data-action="bold"
177177
@mousedown.prevent
178178
@touchstart.prevent.stop="handleSnippetAction('**', 1)"
@@ -182,7 +182,7 @@ defineExpose(
182182
</button>
183183
<button
184184
type="button"
185-
class="px-3 py-2 rounded-lg border border-slate-200 bg-white text-sm font-semibold shadow-sm"
185+
class="px-4 py-2 rounded-lg border border-[var(--border)] bg-[var(--surface-elevated)] text-[var(--link)] font-bold shadow-sm active:scale-95 transition-all"
186186
data-action="strike"
187187
@mousedown.prevent
188188
@touchstart.prevent.stop="handleSnippetAction('~~~~', 2)"
@@ -192,7 +192,7 @@ defineExpose(
192192
</button>
193193
<button
194194
type="button"
195-
class="px-3 py-2 rounded-lg border border-slate-200 bg-white text-sm font-semibold shadow-sm"
195+
class="px-4 py-2 rounded-lg border border-[var(--border)] bg-[var(--surface-elevated)] text-[var(--link)] font-bold shadow-sm active:scale-95 transition-all"
196196
data-action="code"
197197
@mousedown.prevent
198198
@touchstart.prevent.stop="handleSnippetAction('``', 1)"
@@ -202,7 +202,7 @@ defineExpose(
202202
</button>
203203
<button
204204
type="button"
205-
class="px-3 py-2 rounded-lg border border-slate-200 bg-white text-sm font-semibold shadow-sm"
205+
class="px-4 py-2 rounded-lg border border-[var(--border)] bg-[var(--surface-elevated)] text-[var(--link)] font-bold shadow-sm active:scale-95 transition-all"
206206
data-action="table"
207207
@mousedown.prevent
208208
@touchstart.prevent.stop="handleSnippetAction('|', 1)"
@@ -212,7 +212,7 @@ defineExpose(
212212
</button>
213213
<button
214214
type="button"
215-
class="px-3 py-2 rounded-lg border border-slate-200 bg-white text-sm font-semibold shadow-sm"
215+
class="px-4 py-2 rounded-lg border border-[var(--border)] bg-[var(--surface-elevated)] text-[var(--link)] font-bold shadow-sm active:scale-95 transition-all"
216216
data-action="table-divider"
217217
@mousedown.prevent
218218
@touchstart.prevent.stop="handleSnippetAction('|-', 2)"
@@ -222,7 +222,7 @@ defineExpose(
222222
</button>
223223
<button
224224
type="button"
225-
class="px-3 py-2 rounded-lg border border-slate-200 bg-white text-sm font-semibold shadow-sm"
225+
class="px-4 py-2 rounded-lg border border-[var(--border)] bg-[var(--surface-elevated)] text-[var(--link)] font-bold shadow-sm active:scale-95 transition-all"
226226
data-action="rule"
227227
@mousedown.prevent
228228
@touchstart.prevent.stop="handleLineAction('rule')"

src/style.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,33 @@
11
@import "tailwindcss";
22

3+
:root {
4+
font-family: Inter, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
5+
line-height: 1.5;
6+
7+
--bg: #0b1120;
8+
--text: #e5e7eb;
9+
--muted: #94a3b8;
10+
--surface: #111827;
11+
--surface-elevated: #1f2937;
12+
--border: #334155;
13+
--link: #93c5fd;
14+
--link-active: #ffffff;
15+
--error: #fca5a5;
16+
--primary: #3b82f6;
17+
}
18+
319
html,
420
body,
521
#app {
622
width: 100%;
723
overflow-x: hidden;
24+
min-height: 100%;
25+
}
26+
27+
body {
28+
margin: 0;
29+
background: var(--bg);
30+
color: var(--text);
831
}
932

1033
/* Markdown styles (lightweight, for social posts) */

src/views/EditorView.vue

Lines changed: 50 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -231,56 +231,66 @@ defineExpose(
231231
</script>
232232

233233
<template>
234-
<div class="min-h-dvh bg-slate-50 text-slate-900">
234+
<div class="min-h-dvh bg-[var(--bg)] text-[var(--text)]">
235235
<header
236-
class="z-10 bg-white/90 backdrop-blur border-b border-slate-200 transition-all lg:sticky lg:top-0"
236+
class="z-10 bg-[var(--bg)]/90 backdrop-blur border-b border-[var(--border)] transition-all lg:sticky lg:top-0"
237237
:class="isFocused ? 'hidden lg:block' : 'sticky top-0'"
238238
>
239-
<div class="max-w-6xl mx-auto px-3 py-2 flex flex-wrap gap-2 items-center">
239+
<div class="max-w-6xl mx-auto px-3 py-4 flex flex-wrap gap-4 items-center">
240+
<h1 class="text-xl font-bold tracking-tight">md2img</h1>
241+
240242
<div class="flex gap-2 flex-wrap">
241243
<button
242244
v-for="(preset, key) in imagePresets"
243245
:key="key"
244-
class="px-3 py-2 rounded-lg text-sm border transition-colors"
245-
:class="presetKey === key ? 'bg-slate-900 text-white border-slate-900' : 'bg-white border-slate-200 hover:bg-slate-50'"
246+
class="px-3 py-1.5 rounded-lg text-sm font-semibold border transition-all"
247+
:class="presetKey === key ? 'bg-[var(--primary)] text-white border-[var(--primary)] shadow-sm' : 'bg-[var(--surface-elevated)] border-[var(--border)] text-[var(--link)] hover:border-[var(--link)] hover:text-[var(--link-active)]'"
246248
@click="presetKey = key"
247249
>
248250
{{ preset.label }}
249251
</button>
250252
</div>
251253

252-
<div class="flex items-center gap-2 ml-auto flex-wrap">
253-
<label class="text-xs text-slate-600">{{ uiText.backgroundLabel }}</label>
254-
<input
255-
type="color"
256-
v-model="backgroundColor"
257-
class="h-9 w-10 rounded border border-slate-200 cursor-pointer"
258-
/>
259-
260-
<label class="text-xs text-slate-600 ml-2">{{ uiText.textColorLabel }}</label>
261-
<div class="flex gap-1">
262-
<button
263-
v-for="option in textColorPresets"
264-
:key="option.value"
265-
class="h-9 px-2 rounded-lg text-xs border flex items-center gap-2 transition-colors"
266-
:class="textColor === option.value ? 'border-slate-900 bg-slate-50' : 'border-slate-200 bg-white hover:bg-slate-50'"
267-
@click="textColor = option.value"
268-
>
269-
<span class="inline-block h-4 w-4 rounded-full border border-slate-200" :style="{ background: option.value }"></span>
270-
{{ option.label }}
271-
</button>
254+
<div class="flex items-center gap-3 ml-auto flex-wrap">
255+
<div class="flex items-center gap-2">
256+
<label class="text-xs text-[var(--muted)]">{{ uiText.backgroundLabel }}</label>
257+
<input
258+
type="color"
259+
v-model="backgroundColor"
260+
class="h-8 w-8 rounded border border-[var(--border)] cursor-pointer bg-transparent"
261+
/>
272262
</div>
273263

274-
<label class="text-xs text-slate-600 ml-2">{{ uiText.textSizeLabel }}</label>
275-
<input type="range" min="16" max="30" step="1" v-model.number="fontSize" class="cursor-pointer" />
276-
<span class="text-xs w-8 text-right font-mono">{{ fontSize }}px</span>
264+
<div class="flex items-center gap-2">
265+
<label class="text-xs text-[var(--muted)]">{{ uiText.textColorLabel }}</label>
266+
<div class="flex gap-1">
267+
<button
268+
v-for="option in textColorPresets"
269+
:key="option.value"
270+
class="h-8 px-2 rounded-lg text-xs font-semibold border flex items-center gap-2 transition-all"
271+
:class="textColor === option.value ? 'bg-[var(--primary)] text-white border-[var(--primary)]' : 'bg-[var(--surface-elevated)] border-[var(--border)] text-[var(--link)] hover:border-[var(--link)] hover:text-[var(--link-active)]'"
272+
@click="textColor = option.value"
273+
>
274+
<span class="inline-block h-3 w-3 rounded-full border border-white/20" :style="{ background: option.value }"></span>
275+
<span class="hidden sm:inline">{{ option.label }}</span>
276+
</button>
277+
</div>
278+
</div>
277279

278-
<label class="text-xs text-slate-600 ml-2">{{ uiText.lineHeightLabel }}</label>
279-
<input type="range" min="1.2" max="1.9" step="0.05" v-model.number="lineHeight" class="cursor-pointer" />
280-
<span class="text-xs w-10 text-right font-mono">{{ lineHeight.toFixed(2) }}</span>
280+
<div class="flex items-center gap-2">
281+
<label class="text-xs text-[var(--muted)]">{{ uiText.textSizeLabel }}</label>
282+
<input type="range" min="16" max="30" step="1" v-model.number="fontSize" class="cursor-pointer accent-[var(--primary)]" />
283+
<span class="text-xs w-8 text-right font-mono text-[var(--muted)]">{{ fontSize }}px</span>
284+
</div>
285+
286+
<div class="flex items-center gap-2">
287+
<label class="text-xs text-[var(--muted)]">{{ uiText.lineHeightLabel }}</label>
288+
<input type="range" min="1.2" max="1.9" step="0.05" v-model.number="lineHeight" class="cursor-pointer accent-[var(--primary)]" />
289+
<span class="text-xs w-10 text-right font-mono text-[var(--muted)]">{{ lineHeight.toFixed(2) }}</span>
290+
</div>
281291

282292
<button
283-
class="ml-2 px-4 py-2 rounded-xl bg-emerald-600 text-white font-semibold shadow-sm hover:bg-emerald-700 disabled:opacity-60 disabled:cursor-not-allowed transition-all"
293+
class="ml-2 px-4 py-2 rounded-lg bg-[var(--primary)] text-white font-bold shadow-lg hover:brightness-110 active:scale-95 disabled:opacity-50 disabled:scale-100 disabled:cursor-not-allowed transition-all"
284294
:disabled="exporting"
285295
@click="exportAllPng"
286296
>
@@ -292,11 +302,11 @@ defineExpose(
292302

293303
<main class="max-w-6xl mx-auto p-3 grid grid-cols-1 lg:grid-cols-2 gap-4 min-w-0">
294304
<!-- Editor -->
295-
<section class="bg-white rounded-2xl border border-slate-200 overflow-hidden min-w-0 shadow-sm">
296-
<div class="px-4 py-2 border-b border-slate-200 bg-slate-50/50 text-sm font-semibold flex items-center justify-between">
305+
<section class="bg-[var(--surface)] rounded-xl border border-[var(--border)] overflow-hidden min-w-0 shadow-sm">
306+
<div class="px-4 py-2 border-b border-[var(--border)] bg-[var(--surface-elevated)] text-sm font-semibold flex items-center justify-between">
297307
<span>{{ uiText.markdownLabel }}</span>
298308
<button
299-
class="text-xs px-2 py-1 rounded border border-slate-200 bg-white hover:bg-slate-50 transition-colors"
309+
class="text-xs px-2 py-1 rounded border border-[var(--border)] bg-[var(--surface)] text-[var(--link)] hover:text-[var(--link-active)] hover:border-[var(--link)] transition-colors"
300310
@click="markdownInput = ''"
301311
>
302312
{{ uiText.clearMarkdownLabel }}
@@ -307,14 +317,14 @@ defineExpose(
307317
v-model="markdownInput"
308318
@focus="isFocused = true"
309319
@blur="isFocused = false"
310-
class="w-full h-[45dvh] lg:h-[75dvh] p-4 font-mono text-sm outline-none resize-none bg-transparent transition-all"
320+
class="w-full h-[45dvh] lg:h-[75dvh] p-4 font-mono text-sm outline-none resize-none bg-transparent transition-all caret-[var(--primary)]"
311321
:class="isFocused ? 'h-[80dvh] lg:h-[75dvh] pb-[40dvh] lg:pb-4' : ''"
312322
/>
313323
</section>
314324

315325
<!-- Preview -->
316-
<section class="bg-white rounded-2xl border border-slate-200 overflow-hidden min-w-0 shadow-sm">
317-
<div class="px-4 py-2 border-b border-slate-200 bg-slate-50/50 text-sm font-semibold">
326+
<section class="bg-[var(--surface)] rounded-xl border border-[var(--border)] overflow-hidden min-w-0 shadow-sm">
327+
<div class="px-4 py-2 border-b border-[var(--border)] bg-[var(--surface-elevated)] text-sm font-semibold">
318328
{{ uiText.previewLabel }} / {{ uiText.pageCountLabel(pagesHtml.length) }}
319329
</div>
320330

@@ -329,7 +339,7 @@ defineExpose(
329339
</div>
330340
</div>
331341

332-
<p class="mt-4 text-xs text-slate-500 text-center">
342+
<p class="mt-4 text-xs text-[var(--muted)] text-center">
333343
{{ uiText.splitHint }}
334344
</p>
335345
</div>
@@ -348,7 +358,7 @@ defineExpose(
348358
<!-- Mobile save button at the bottom. -->
349359
<div class="lg:hidden fixed bottom-24 left-4 right-4 z-20" v-if="!isFocused">
350360
<button
351-
class="w-full py-4 rounded-2xl bg-emerald-600 text-white font-bold shadow-xl hover:bg-emerald-700 disabled:opacity-60 transition-all"
361+
class="w-full py-4 rounded-xl bg-[var(--primary)] text-white font-bold shadow-2xl hover:brightness-110 active:scale-95 disabled:opacity-50 transition-all"
352362
:disabled="exporting"
353363
@click="exportAllPng"
354364
>

0 commit comments

Comments
 (0)