parent
e80c97e450
commit
00111efb27
@ -0,0 +1,56 @@
|
||||
package moe.kageru.kodeshare.pages
|
||||
|
||||
import kotlinx.css.*
|
||||
import kotlinx.css.properties.ms
|
||||
import kotlinx.css.properties.transition
|
||||
|
||||
object Css {
|
||||
private val accent1 = Color("#cd7400")
|
||||
private val accent2 = Color("#ed7a00")
|
||||
private val fontcolor = Color.lightGrey
|
||||
val default = CSSBuilder().apply {
|
||||
body {
|
||||
fontFamily = "Hack, Fira Code, Noto Mono, monospace"
|
||||
fontSize = 13.pt
|
||||
textAlign = TextAlign.center
|
||||
margin = "auto"
|
||||
backgroundColor = Color.black
|
||||
color = fontcolor
|
||||
}
|
||||
textarea {
|
||||
fontFamily = "Hack, Fira Code, Noto Mono, monospace"
|
||||
backgroundColor = Color.black
|
||||
color = Color.white
|
||||
fontSize = 13.pt
|
||||
borderColor = accent1
|
||||
borderWidth = 3.px
|
||||
borderRadius = 8.px
|
||||
borderStyle = BorderStyle.solid
|
||||
padding = "5px"
|
||||
minWidth = 70.pct
|
||||
maxWidth = 100.pct
|
||||
}
|
||||
rule("input[type=\"submit\"]") {
|
||||
backgroundColor = accent1
|
||||
borderColor = accent1
|
||||
borderWidth = 2.px
|
||||
borderRadius = 5.px
|
||||
borderStyle = BorderStyle.solid
|
||||
color = Color.black
|
||||
fontWeight = FontWeight.w600
|
||||
padding = "5px 15px"
|
||||
cursor = Cursor.pointer
|
||||
transition(duration = 500.ms)
|
||||
}
|
||||
rule("input[type=\"submit\"]:hover") {
|
||||
backgroundColor = Color.transparent
|
||||
color = accent1
|
||||
}
|
||||
rule("textarea:focus") {
|
||||
borderColor = accent2
|
||||
}
|
||||
rule("::selection") {
|
||||
color = accent1
|
||||
}
|
||||
}.toString()
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package moe.kageru.kodeshare.pages
|
||||
|
||||
import io.ktor.html.HtmlContent
|
||||
import io.ktor.http.HttpStatusCode
|
||||
import kotlinx.html.*
|
||||
|
||||
object Homepage {
|
||||
val content = HtmlContent(HttpStatusCode.OK) {
|
||||
head {
|
||||
link(rel = "stylesheet", href = "/style.css", type = "text/css")
|
||||
}
|
||||
body {
|
||||
h1 { +"kodeshare - yet another paste service" }
|
||||
form("/", encType = FormEncType.multipartFormData, method = FormMethod.post) {
|
||||
acceptCharset = "utf-8"
|
||||
p {
|
||||
label { +"Enter or paste your text here " }
|
||||
}
|
||||
textArea {
|
||||
name = "input"
|
||||
rows = "20"
|
||||
cols = "100"
|
||||
}
|
||||
p {
|
||||
submitInput { value = "Upload" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue