clustvirt/view/layouts/staticpage.templ

57 lines
1.3 KiB
Plaintext
Raw Normal View History

package layouts
type StaticPageConfig struct {
MainTitle string
SubTitle string
}
templ StaticPage(config StaticPageConfig, children ...templ.Component) {
<!DOCTYPE html>
<html class={ "text-slate-100" , "bg-slate-900" }>
<head>
<title>Clustvirt</title>
<link href="/static/css/style.css" type="text/css" rel="stylesheet" />
</head>
<body>
<header class={
"flex",
"sm:flex-col", "sm:h20", "sm:justify-start",
"lg:flex-row", "lg:h-8", "lg:items-end", "lg:justify-center",
"gap-x-2",
}>
@header(config.MainTitle, config.SubTitle)
</header>
<div id="content" name="content">
for _, child := range children {
@child
}
</div>
<footer>
@footer()
</footer>
</body>
</html>
}
templ header(title string, subtitle string) {
<h1 class={ "text-2xl", "font-bold", "h-8" }>{ title }</h1>
<h2 class={ "text-sm", "font-thin", "italic", "h-4", "align-bottom" }>{ subtitle }</h2>
<nav>
@nav()
</nav>
}
templ nav() {
}
templ footer() {
<div class="flex gap-4 md:gap-6 sm:gap-8 divide divide-solid">
<div id="footer_left" class="flex-auto basis-1/4 md:basis-1/3 p-2">Left</div>
<div id="footer_middle" class="flex-auto basis-1/2 md:basis-1/3 p-2">Middle</div>
<div id="footer_right" class="flex-auto basis-1/4 md:basis-1/3 p-2">Right</div>
</div>
}