Css + fonts..

This commit is contained in:
2020-08-22 22:48:21 +02:00
parent f73a9d0b96
commit ea732325e5
14 changed files with 67 additions and 14 deletions
+2 -1
View File
@@ -27,8 +27,9 @@ class Router(
) {
operator fun invoke(): RoutingHttpHandler {
val resourceLoader = ResourceLoader.Classpath(("/static"))
val basicRoutes = routes(
ImmutableFilter().then(static(ResourceLoader.Classpath(("/static")))),
ImmutableFilter().then(static(resourceLoader, "woff2" to ContentType("font/woff2"))),
)
fun public(request: Request, handler: PublicHandler) = handler(request, request.jwtPayload(contexts))
+4 -1
View File
@@ -35,7 +35,10 @@ class BaseView(staticFileResolver: StaticFileResolver) : View(staticFileResolver
</div>
<form class="md:space-x-2" id="search">
<input aria-label="demo-search" name="search" disabled="" value="tag:&quot;demo&quot;">
<span id="buttons"><button disabled="" class="pointer-events-none">search</button><span>clear</span></span>
<span id="buttons">
<button disabled="" class="btn btn-green pointer-events-none">search</button>
<span class="btn btn-red pointer-events-none">clear</span>
</span>
</form>
<div class="overflow-x-auto">
<table id="notes">
+1 -1
View File
@@ -22,7 +22,7 @@ class NoteView(staticFileResolver: StaticFileResolver) : View(staticFileResolver
alert(Alert.Warning, it.dataPath.substringAfter('.') + ": " + it.message)
}
form(method = FormMethod.post) {
textArea(classes = "w-full bg-gray-800 p-5 outline-none font-mono") {
textArea {
attributes.also {
it["rows"] = "20"
it["id"] = "markdown"
+5
View File
@@ -25,6 +25,11 @@ abstract class View(staticFileResolver: StaticFileResolver) {
meta(name = "viewport", content = "width=device-width, initial-scale=1")
title("$title - SimpleNotes")
description?.let { meta(name = "description", content = it) }
link(rel = "preload", href = "/recursive-0.0.1.woff2"){
attributes["as"] = "font"
attributes["type"] = "font/woff2"
attributes["crossorigin"] = "anonymous"
}
link(rel = "stylesheet", href = styles)
link(rel = "shortcut icon", href = "/favicon.ico", type = "image/x-icon")
scripts.forEach { src ->
@@ -26,10 +26,10 @@ fun DIV.noteListHeader(numberOfDeletedNotes: Int, query: String = "") {
}
span {
id = "buttons"
button(type = submit) {
button(type = submit, classes = "btn btn-green") {
+"search"
}
a(href = "/notes") {
a(href = "/notes", classes = "btn btn-red") {
+"clear"
}
}
Binary file not shown.