Refactoring and style fixes
authorLanius Trolling <lanius@laniustrolling.dev>
Sun, 10 Jul 2022 18:01:03 +0000 (14:01 -0400)
committerLanius Trolling <lanius@laniustrolling.dev>
Sun, 10 Jul 2022 18:01:03 +0000 (14:01 -0400)
src/main/kotlin/info/mechyrdia/lore/parser_tags.kt
src/main/kotlin/info/mechyrdia/lore/view_tpl.kt
src/main/resources/static/style.css

index 86aa4a5dddc1fdc60f7ecae1d03d4f8ce7643e7c..3b98e99961187432a06f3d8f981ec1b59cbc957f 100644 (file)
@@ -12,7 +12,7 @@ sealed class TextParserTagType<TContext> {
 }
 
 @JvmInline
-value class TextParserTags<TContext> private constructor(val tags: Map<String, TextParserTagType<TContext>>) {
+value class TextParserTags<TContext> private constructor(private val tags: Map<String, TextParserTagType<TContext>>) {
        operator fun get(name: String) = tags[name.lowercase()]
        
        companion object {
@@ -289,7 +289,7 @@ enum class TextParserFormattingTag(val type: TextParserTagType<Unit>) {
                val asTags: TextParserTags<Unit>
                        get() = TextParserTags(values().associate { it.name to it.type })
                
-               fun sanitizeLink(html: String) = html.replace(Regex("[^#a-zA-Z0-9._\\-]"), "").replace("..", ".")
+               fun sanitizeLink(html: String) = html.replace(Regex("[^#a-zA-Z\\d\\-._]"), "").replace("..", ".")
                
                fun getSizeParam(tagParam: String?): Pair<Int?, Int?> = tagParam?.let { resolution ->
                        val parts = resolution.split('x')
index 1572b8b80e5f8a009c4a25478b9592cafcdba305..5c152290513bc1a365e0a008f03ed6fd0d88ee6a 100644 (file)
@@ -18,9 +18,9 @@ fun ApplicationCall.page(pageTitle: String? = null, navBar: List<NavItem>? = nul
                        meta(name = "viewport", content = "width=device-width, initial-scale=1.0")
                        
                        script(src = "/static/gltf-viewer/bower_components/webcomponentsjs/webcomponents-lite.js") {}
+                       link(rel = "import", href = "/static/gltf-viewer/gltf-viewer.html")
                        
                        link(rel = "icon", type = "image/svg+xml", href = "/static/images/icon.svg")
-                       link(rel = "import", href = "/static/gltf-viewer/gltf-viewer.html")
                        
                        link(rel = "preconnect", href = "https://fonts.googleapis.com")
                        link(rel = "preconnect", href = "https://fonts.gstatic.com") { attributes["crossorigin"] = "anonymous" }
index ac916934369c58cc039bae2a8bdfd1e5d88e4933..1986f534d62a222a73238d2416565fae5eafe94e 100644 (file)
@@ -554,7 +554,7 @@ textarea {
        box-sizing: border-box;
        background-color: var(--input-bg);
        border: none;
-       border-bottom: 0.1em solid var(--input-ul);
+       border-bottom: 0.15rem solid var(--input-ul);
 
        color: var(--input-fg);
        font-size: 1.5em;
@@ -644,13 +644,13 @@ iframe {
 
 .lang-tylan {
        font-family: Tulasra, monospace;
-       font-size: 1.5em;
+       font-size: 1.25em;
        line-height: 1.0;
        font-variant: normal !important;
 }
 
 textarea.lang-tylan {
        font-family: Tulasra, monospace;
-       font-size: 2.25em;
+       font-size: 2.5em;
        line-height: 1.0;
 }