46 lines
1.2 KiB
Swift
46 lines
1.2 KiB
Swift
import Elementary
|
|
|
|
struct MainPage<Inner: HTML>: SendableHTMLDocument where Inner: Sendable {
|
|
let title = "HVAC Toolbox"
|
|
let lang = "en-US"
|
|
let inner: @Sendable () -> Inner
|
|
|
|
var head: some HTML {
|
|
meta(.charset(.utf8))
|
|
meta(.name("viewport"), .content("width=device-width, initial-scale=1.0"))
|
|
link(.rel(.stylesheet), .href("/output.css"))
|
|
link(
|
|
.rel(.icon),
|
|
.href("/favicon-32x32.png"),
|
|
.init(name: "type", value: "image/png"),
|
|
.init(name: "sizes", value: "32x32")
|
|
)
|
|
link(
|
|
.rel(.icon),
|
|
.href("/favicon-16x16.png"),
|
|
.init(name: "type", value: "image/png"),
|
|
.init(name: "sizes", value: "16x16")
|
|
)
|
|
link(
|
|
.rel(.init(rawValue: "apple-touch-icon")),
|
|
.href("/apple-touch-icon.png"),
|
|
.init(name: "sizes", value: "180x180")
|
|
)
|
|
link(.rel(.init(rawValue: "mainifest")), .href("/site.webmanifest"))
|
|
}
|
|
|
|
var body: some HTML {
|
|
main {
|
|
div(.class("min-h-screen bg-linear-to-br from-green-50 to-blue-50")) {
|
|
header(.class("header")) {
|
|
h1(.class("text-red-600")) { title }
|
|
}
|
|
inner()
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
protocol SendableHTMLDocument: HTMLDocument, Sendable {}
|