feat: Minor updates to try and deploy to digital ocean

This commit is contained in:
2025-02-28 20:17:18 -05:00
parent 3be0f7a828
commit c1aa2a8ad1
5 changed files with 59 additions and 31 deletions

File diff suppressed because one or more lines are too long

View File

@@ -50,12 +50,18 @@ extension ViewController: DependencyKey {
switch request.route {
case .index:
return MainPage {
div {
div(.class("space-y-6")) {
div(.class("pb-8")) {
p(.class("dark:text-gray-200")) {
"Professional calculators for HVAC system design and troubleshooting."
}
}
WarningBox(
"This site is still under construction, not all it's functionality is working.",
"This page needs updated to display a grid of calculators.",
"Below are the SVG's used on the site, for making sure they work."
)
div {
p(.class("font-2xl dark:text-gray-200 pb-6")) {
"SVG's"

View File

@@ -39,6 +39,7 @@ struct MainPage<Inner: HTML>: SendableHTMLDocument where Inner: Sendable {
Header()
PageContent(body: inner)
}
Footer()
}
}
}
@@ -61,38 +62,48 @@ private struct Header: HTML {
nav(.class("flex flex-row gap-2 p-2 mt-2")) {
// TODO: Add class active, to button that is the active route.
ul(.class("flex flex-wrap gap-x-2 lg:gap-x-5 \(text: .yellow) font-bold")) {
navLink(label: "Mold-Risk", route: .moldRisk(.index))
navLink(label: "Dehumidifier-Sizing", route: .dehumidifierSize(.index))
navLink(label: "HVAC-System-Performance", route: .hvacSystemPerformance(.index))
navLink(label: "Room-Pressure", route: .roomPressure(.index))
}
}
}
}
func navLink(label: String, route: SiteRoute.View) -> some HTML<HTMLTag.li> {
li {
a(
.class("hover:border-b \(border: .yellow)"),
.hx.get(route: .moldRisk(.index)), .hx.target("#content"), .hx.pushURL(true)
) {
"Mold-Risk"
a(.class("hover:border-b border-yellow-300"), .hx.get(route: route), .hx.target("#content"), .hx.pushURL(true)) {
label
}
}
li {
a(
.class("[&:hover]:border-b \(border: .yellow)"),
.hx.get(route: .dehumidifierSize(.index)), .hx.target("#content"), .hx.pushURL(true)
) {
"Dehumidifier-Sizing"
}
}
li {
a(
.class("hover:border-b \(border: .yellow)"),
.hx.get(route: .hvacSystemPerformance(.index)), .hx.target("#content"), .hx.pushURL(true)
) {
"HVAC-System-Performance"
}
}
li {
a(
.class("hover:border-b \(border: .yellow)"),
.hx.get(route: .roomPressure(.index)), .hx.target("#content"), .hx.pushURL(true)
) {
"Room-Pressure"
}
}
private struct Footer: HTML {
var content: some HTML {
div(.class("bg-blue-500 text-yellow-300 text-sm font-semibold border-t border-yellow-300")) {
div(.class("sm:grid sm:grid-cols-1 lg:flex lg:justify-between")) {
div(.class("grid grid-cols-1 p-4")) {
div(.class("flex")) {
span { "Toolbox icon by" }
a(.class("mx-1"), .href("https://dribbble.com/Laridae?ref=svgrepo.com"), .target(.blank)) {
u { "Laridae" }
}
span { "in CC Attribution License via" }
a(.class("mx-1"), .href("https://www.svgrepo.com/"), .target(.blank)) { u { "SVG Repo" } }
}
div(.class("flex")) {
span { "Other SVG's by" }
a(.class("mx-1"), .href("https://lucide.dev"), .target(.blank)) { u { "Lucide" } }
span { "and licensed under" }
a(.class("mx-1"), .href("https://lucide.dev/license")) { u { "MIT." } }
}
}
div(.class("lg:p-8 sm:p-4")) {
p { "© Copyright 2025 Michael Housh and Dustin Cole" }
}
}
}

View File

@@ -16,6 +16,12 @@ struct RoomPressureForm: HTML, Sendable {
div(.class("relative")) {
FormHeader(label: "Room Pressure Calculator", svg: .leftRightArrow)
// FIX: Remove when done testing.
WarningBox(
"This calculator is currently under construction, so it does not do anything when the form is submitted."
)
.attributes(.class("mb-8"))
// Mode toggle / buttons.
div(.class("absolute top-0 right-0 flex items-center gap-x-0")) {
switch mode {

View File

@@ -1,5 +1,6 @@
docker_image := "hvac-toolbox"
docker_tag := "latest"
do_registery := "registry.digitalocean.com/swift-hvac-toolbox"
build-docker:
@docker build -t {{docker_image}}:{{docker_tag}} .
@@ -16,3 +17,7 @@ run-css:
clean:
@rm -rf .build
push-image tag="prod":
@docker tag {{docker_image}}:{{docker_tag}} {{do_registery}}/{{docker_image}}:{{tag}}
@docker push {{do_registery}}/{{docker_image}}:{{tag}}