preact.templ 1.0 KB

12345678910111213141516171819202122232425262728
  1. package preact
  2. import (
  3. "github.com/TecharoHQ/anubis"
  4. "github.com/TecharoHQ/anubis/lib/localization"
  5. )
  6. templ page(redir, challenge string, difficulty int, loc *localization.SimpleLocalizer) {
  7. <div class="centered-div">
  8. <div id="app">
  9. <img id="image" style="width:100%;max-width:256px;" src={ anubis.BasePrefix + "/.within.website/x/cmd/anubis/static/img/pensive.webp?cacheBuster=" + anubis.Version }/>
  10. <p id="status">{ loc.T("loading") }</p>
  11. <p>{ loc.T("connection_security") }</p>
  12. </div>
  13. @templ.JSONScript("preact_info", map[string]any{
  14. "redir": redir,
  15. "challenge": challenge,
  16. "difficulty": difficulty,
  17. "connection_security_message": loc.T("connection_security"),
  18. "loading_message": loc.T("loading"),
  19. "pensive_url": anubis.BasePrefix + "/.within.website/x/cmd/anubis/static/img/pensive.webp?cacheBuster=" + anubis.Version,
  20. })
  21. @templ.ComponentFunc(renderAppJS)
  22. <noscript>
  23. { loc.T("javascript_required") }
  24. </noscript>
  25. </div>
  26. }