Add back button on paste page

This commit is contained in:
kageru 2019-09-29 10:15:42 +02:00
parent 4919958d8f
commit 96c335c41a
3 changed files with 33 additions and 1 deletions

View File

@ -36,6 +36,9 @@ object Routes {
post("/") {
call.handlePost()
}
get("/favicon.ico") {
call.respond(HttpStatusCode.NotFound)
}
get<PasteRequest> { req ->
call.handleGet(req)
}

View File

@ -1,6 +1,8 @@
package moe.kageru.kodeshare.pages
import kotlinx.css.*
import kotlinx.css.properties.TextDecoration
import kotlinx.css.properties.border
import kotlinx.css.properties.ms
import kotlinx.css.properties.transition
@ -33,11 +35,13 @@ object Css {
}
// this doesn’t inherit the style from anything else for some reason
rule(".hljs, pre, code") {
width = 100.pct
width = 95.pct
height = 100.pct
textAlign = TextAlign.left
fontFamily = "Hack, Fira Code, Noto Mono, monospace"
fontSize = 13.pt
display = Display.inline
position = Position.relative
}
rule("input[type=\"submit\"]") {
backgroundColor = accent1
@ -51,6 +55,16 @@ object Css {
cursor = Cursor.pointer
transition(duration = 500.ms)
}
rule("div.back") {
position = Position.absolute
padding = "5px"
border(2.px, BorderStyle.solid, accent1)
borderRadius = 3.px
color = accent1
top = 1.em
right = 1.em
zIndex = 1
}
rule("input[type=\"submit\"]:hover") {
backgroundColor = Color.transparent
borderColor = accent2
@ -62,5 +76,15 @@ object Css {
rule("::selection") {
color = accent1
}
a {
color = accent1
textDecoration = TextDecoration.none
}
rule("a:visited") {
color = accent1
}
rule("a:focus") {
color = accent2
}
}.toString()
}

View File

@ -22,6 +22,11 @@ object PastePage {
+content
}
}
div("back") {
a("/") {
+"New paste"
}
}
}
}
}