stupid scroll

master
Bel LaPointe 2021-02-25 16:22:40 -06:00
parent 1eb8fa7223
commit 47d6c37819
3 changed files with 31 additions and 15 deletions

View File

@ -102,9 +102,22 @@ const defaultWrapper = `
font-size: 125%; font-size: 125%;
background: #3b242b; background: #3b242b;
margin-top: 0; margin-top: 0;
margin-bottom: 0;
height: calc(100vh - 1em);
overflow: auto;
display: flex;
flex-direction: column;
} }
body > form > textarea { body > .form {
margin-top: 2.5em; flex-grow: 2;
}
body > .form > form {
height: 100%;
display: flex;
flex-direction: column;
}
body > .form > form > textarea {
flex-grow: 2;
} }
rendered > h2:nth-child(2) { rendered > h2:nth-child(2) {
margin: 0; margin: 0;
@ -135,10 +148,11 @@ const defaultWrapper = `
margin: 0; margin: 0;
margin-bottom: .5em; margin-bottom: .5em;
padding: .3em 0 .3em 0; padding: .3em 0 .3em 0;
position: sticky;
top: 0;
background-color: #3b242b; background-color: #3b242b;
z-index: 999; z-index: 999;
position: -webkit-sticky;
position: sticky;
top: 0;
} }
h1:hover > .comment, h1:hover > .comment,
h2:hover > .comment, h2:hover > .comment,
@ -154,7 +168,7 @@ const defaultWrapper = `
} }
</style> </style>
</header> </header>
<body height="100%"> <body>
{{{}}} {{{}}}
</body> </body>
<footer> <footer>

View File

@ -26,11 +26,13 @@ func editFile(p filetree.Path) string {
} }
b, _ := ioutil.ReadFile(p.Local) b, _ := ioutil.ReadFile(p.Local)
return fmt.Sprintf(` return fmt.Sprintf(`
<form action="/submit/%s" method="post" style="width:100%%; height: 90%%"> <div class="form">
<table style="width:100%%; height: 90%%"> <form action="/submit/%s" method="post">
<textarea name="content" style="width:100%%; min-height:90%%; cursor:crosshair;">%s</textarea> <table>
</table> <textarea name="content" style="cursor:crosshair;">%s</textarea>
<button type="submit">Submit</button> </table>
</form> <button type="submit">Submit</button>
</form>
</div>
`, href, b) `, href, b)
} }

View File

@ -81,10 +81,10 @@ func htmlCreate(w http.ResponseWriter, baseHREF string) {
return return
} }
fmt.Fprintf(w, ` fmt.Fprintf(w, `
<form action=%q method="get"> <form action=%q method="get">
<input type="text" name="base"></input> <input type="text" name="base"></input>
<button type="submit">Create</button> <button type="submit">Create</button>
</form> </form>
`, path.Join("/create/", baseHREF)) `, path.Join("/create/", baseHREF))
} }