feat(14): initial static section change
paper control switches "controls" to "showdown" - the fragment of results page. yay
This commit is contained in:
parent
726cadec19
commit
91c53429e0
File diff suppressed because one or more lines are too long
|
@ -5,6 +5,7 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<!-- displays site properly based on user's device -->
|
<!-- displays site properly based on user's device -->
|
||||||
|
|
||||||
|
<script src="public/deps/htmx.min.js"></script>
|
||||||
<link
|
<link
|
||||||
href="../public/output.css"
|
href="../public/output.css"
|
||||||
th:href="'public/output.css'"
|
th:href="'public/output.css'"
|
||||||
|
@ -72,6 +73,9 @@
|
||||||
--translation: 50%;
|
--translation: 50%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
"
|
"
|
||||||
|
hx-get="/select/paper"
|
||||||
|
hx-target="#controls"
|
||||||
|
hx-swap="outerHTML"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="absolute top-1/2 left-1/2 w-3/4 h-3/4 bg-gradient-to-b from-gray-300 to-gray-100 rounded-full -translate-x-1/2 -translate-y-1/2"
|
class="absolute top-1/2 left-1/2 w-3/4 h-3/4 bg-gradient-to-b from-gray-300 to-gray-100 rounded-full -translate-x-1/2 -translate-y-1/2"
|
||||||
|
|
|
@ -56,7 +56,9 @@
|
||||||
</h2>
|
</h2>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="showdown" class="grid grid-cols-2 w-[375px] h-[375px]">
|
<section id="showdown-table" class="grid grid-cols-2 w-[375px] h-[375px]"
|
||||||
|
th:fragment="showdown-table"
|
||||||
|
>
|
||||||
<div id="players-choice"
|
<div id="players-choice"
|
||||||
class="flex relative flex-col items-center pt-10"
|
class="flex relative flex-col items-center pt-10"
|
||||||
>
|
>
|
||||||
|
|
|
@ -5,6 +5,9 @@ import cask.main.Routes
|
||||||
import org.thymeleaf.context.Context
|
import org.thymeleaf.context.Context
|
||||||
import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver
|
import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver
|
||||||
import org.thymeleaf.TemplateEngine
|
import org.thymeleaf.TemplateEngine
|
||||||
|
import org.thymeleaf.Thymeleaf
|
||||||
|
|
||||||
|
import scala.jdk.CollectionConverters._
|
||||||
|
|
||||||
object Main {
|
object Main {
|
||||||
@main def run(
|
@main def run(
|
||||||
|
@ -56,11 +59,22 @@ object Main {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@cask.get("/select/:choice")
|
||||||
|
def acceptPlayerVote(choice: String) = {
|
||||||
|
val context = new Context()
|
||||||
|
val result = templateEngine.process("showdown", Set("showdown-table").asJava, context)
|
||||||
|
cask.Response(
|
||||||
|
result,
|
||||||
|
headers = Seq("Content-Type" -> "text/html;charset=UTF-8")
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@cask.staticResources("/public")
|
@cask.staticResources("/public")
|
||||||
def publicFiles(req: cask.Request) = {
|
def publicFiles(req: cask.Request) = {
|
||||||
println(s"getting request for ${req.remainingPathSegments}")
|
println(s"getting request for ${req.remainingPathSegments}")
|
||||||
"public"
|
"public"
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize()
|
initialize()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue