This repository has been archived on 2026-02-12. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Michael Housh 980d99e40b
All checks were successful
CI / Linux Tests (push) Successful in 5m46s
feat: Adds ductulator button to logged in views.
2026-02-09 16:58:28 -05:00

86 lines
1.9 KiB
Swift

import Dependencies
import Elementary
import Foundation
import ManualDClient
import ManualDCore
import Styleguide
struct TestPage: HTML, Sendable {
// let ductSizes: DuctSizes
var body: some HTML {
div {
Navbar(showSidebarToggle: false, isLoggedIn: false)
div(.class("flex justify-center items-center px-10")) {
div(
.class(
"""
bg-base-300 rounded-3xl shadow-3xl
p-6 w-full
"""
)
) {
div(.class("flex space-x-6 items-center text-4xl")) {
SVG(.calculator)
h1(.class("text-4xl font-bold me-10")) {
"Duct Size"
}
}
p(.class("text-primary font-bold italic")) {
"Calculate duct size for the given parameters"
}
form(
.class("space-y-4 mt-6"),
.action("#")
) {
LabeledInput(
"CFM",
.required,
.type(.number),
.placeholder("1000"),
.name("cfm")
)
LabeledInput(
"Friction Rate",
.value("0.06"),
.required,
.type(.number),
.name("frictionRate")
)
LabeledInput(
"Height",
.required,
.type(.number),
.placeholder("Height (Optional)"),
.name("frictionRate")
)
SubmitButton()
.attributes(.class("btn-block mt-6"))
}
}
// Populate when submitted
div(.id(Result.id)) {}
}
}
}
struct Result: HTML, Sendable {
static let id = "resultView"
let ductSize: ManualDClient.DuctSize
let rectangularSize: ManualDClient.RectangularSize?
var body: some HTML<HTMLTag.div> {
div(.id(Self.id)) {
}
}
}
}