Skip to content

Commit 17d4361

Browse files
committed
[Feat] optimized for mobile
1 parent 1b9ef5b commit 17d4361

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

app/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
56
<title>zzhack</title>
67
<link data-trunk rel="tailwind-css" href="src/styles/global.css"/>
78
<link data-trunk rel="copy-dir" href="../data" />

app/src/components/header_bar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub struct HeaderBarProps {}
66
#[function_component(HeaderBar)]
77
pub fn header_bar(_props: &HeaderBarProps) -> Html {
88
html! {
9-
<div class="flex items-center justify-between px-4 py-3 bg-card backdrop-blur-xl">
9+
<div class="flex items-center justify-between px-4 py-2 sm:py-3 bg-card backdrop-blur-xl">
1010
<div class="flex items-center gap-3">
1111
<div class="flex items-center gap-2">
1212
<span class="inline-block h-3 w-3 rounded-full bg-rose-500 shadow-inner shadow-rose-500/30" />

app/src/components/output_log.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub struct OutputLogProps {
1010
#[function_component(OutputLog)]
1111
pub fn output_log(props: &OutputLogProps) -> Html {
1212
html! {
13-
<div class="space-y-1 font-mono text-sm text-slate-100">
13+
<div class="space-y-1 font-mono text-base sm:text-sm text-slate-100">
1414
{ for props.lines.iter().enumerate().map(|(idx, line)| render_line(idx, line)) }
1515
</div>
1616
}

app/src/components/prompt_line.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ pub fn prompt_line(props: &PromptLineProps) -> Html {
5252
};
5353

5454
html! {
55-
<form onsubmit={on_submit} class="flex items-center mt-3 gap-3 font-mono text-sm text-slate-100">
55+
<form onsubmit={on_submit} class="flex items-center mt-4 sm:mt-3 gap-2 sm:gap-3 font-mono text-base sm:text-sm text-slate-100">
5656
<span class="text-emerald-400">{ ConfigService::get().app.prompt_symbol.clone() }</span>
5757
<input
58-
class="flex-1 bg-transparent text-slate-100 outline-none placeholder:text-slate-600"
58+
class="flex-1 bg-transparent text-slate-100 outline-none placeholder:text-slate-600 text-base sm:text-sm"
5959
type="text"
6060
value={props.value.clone()}
6161
oninput={on_input}

app/src/components/terminal_window.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ pub fn terminal_window(props: &TerminalWindowProps) -> Html {
6060
};
6161

6262
html! {
63-
<div class="min-h-screen overflow-hidden bg-page text-text flex items-center justify-center p-6">
63+
<div class="min-h-[100svh] bg-page text-text flex items-start sm:items-center justify-center px-4 pt-16 pb-6 sm:p-6 overflow-y-auto">
6464
<button
6565
type="button"
66-
class="fixed top-6 right-6 h-10 w-10 flex items-center justify-center rounded-full text-border hover:bg-hover transition-colors"
66+
class="fixed top-4 right-4 sm:top-6 sm:right-6 h-9 w-9 sm:h-10 sm:w-10 flex items-center justify-center rounded-full text-border hover:bg-hover transition-colors"
6767
aria-label="Toggle theme"
6868
onclick={toggle_icon}
6969
>
@@ -73,15 +73,15 @@ pub fn terminal_window(props: &TerminalWindowProps) -> Html {
7373
{
7474
if !props.show_window {
7575
html! {
76-
<div class="w-full max-w-prose">
76+
<div class="w-full sm:max-w-prose">
7777
{body}
7878
</div>
7979
}
8080
} else {
8181
html! {
82-
<div class="w-full max-w-prose min-h-[400px] overflow-hidden rounded-2xl border border-[0.5px] border-border bg-card shadow-[0_20px_60px_-25px_rgba(0,0,0,0.85)] backdrop-blur-xl ring-[0.5px] ring-border">
82+
<div class="w-full sm:max-w-prose min-h-[70vh] sm:min-h-[400px] overflow-hidden rounded-none sm:rounded-2xl border-0 sm:border sm:border-[0.5px] border-border bg-card shadow-none sm:shadow-[0_20px_60px_-25px_rgba(0,0,0,0.85)] backdrop-blur-xl ring-0 sm:ring-[0.5px] ring-border">
8383
<HeaderBar />
84-
<div class="bg-card backdrop-blur-xl px-5 py-4 font-mono text-sm text-text space-y-3">
84+
<div class="bg-card backdrop-blur-xl px-4 sm:px-5 py-4 font-mono text-base sm:text-sm text-text space-y-3">
8585
{body}
8686
</div>
8787
</div>

0 commit comments

Comments
 (0)