mirror of
https://github.com/kou029w/quot.git
synced 2025-01-19 00:18:09 +00:00
add textarea
This commit is contained in:
parent
40bbb580db
commit
255724a2c1
4 changed files with 31 additions and 2 deletions
9
app/src/app.css
Normal file
9
app/src/app.css
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-evenly
|
||||||
|
}
|
||||||
|
|
||||||
|
a[href^="/"] {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
|
@ -1,3 +1,4 @@
|
||||||
|
import "./app.css";
|
||||||
import { createSignal } from "solid-js";
|
import { createSignal } from "solid-js";
|
||||||
import Index from "./pages/index";
|
import Index from "./pages/index";
|
||||||
import Page from "./pages/page";
|
import Page from "./pages/page";
|
||||||
|
@ -30,7 +31,10 @@ export default () => {
|
||||||
return () => (
|
return () => (
|
||||||
<>
|
<>
|
||||||
<header>
|
<header>
|
||||||
<h1>Quot</h1>
|
<h1>
|
||||||
|
<a href="/">Quot</a>
|
||||||
|
</h1>
|
||||||
|
<a href="/new">📄</a>
|
||||||
</header>
|
</header>
|
||||||
{routes[pathname()] ?? <Page id={Number(pathname().slice(1))} />}
|
{routes[pathname()] ?? <Page id={Number(pathname().slice(1))} />}
|
||||||
</>
|
</>
|
||||||
|
|
3
app/src/components/editor.css
Normal file
3
app/src/components/editor.css
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
.editor {
|
||||||
|
inline-size: 100%;
|
||||||
|
}
|
|
@ -1 +1,14 @@
|
||||||
export default () => <>Editor (WIP)</>;
|
import "./editor.css";
|
||||||
|
|
||||||
|
export default () => (
|
||||||
|
<textarea
|
||||||
|
class="editor"
|
||||||
|
autofocus
|
||||||
|
onInput={(e) => {
|
||||||
|
e.currentTarget.setAttribute(
|
||||||
|
"rows",
|
||||||
|
String(Math.max(2, e.currentTarget.value.split("\n").length))
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
></textarea>
|
||||||
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue