feat: Minor updates to try and deploy to digital ocean
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -50,12 +50,18 @@ extension ViewController: DependencyKey {
|
|||||||
switch request.route {
|
switch request.route {
|
||||||
case .index:
|
case .index:
|
||||||
return MainPage {
|
return MainPage {
|
||||||
div {
|
div(.class("space-y-6")) {
|
||||||
div(.class("pb-8")) {
|
div(.class("pb-8")) {
|
||||||
p(.class("dark:text-gray-200")) {
|
p(.class("dark:text-gray-200")) {
|
||||||
"Professional calculators for HVAC system design and troubleshooting."
|
"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 {
|
div {
|
||||||
p(.class("font-2xl dark:text-gray-200 pb-6")) {
|
p(.class("font-2xl dark:text-gray-200 pb-6")) {
|
||||||
"SVG's"
|
"SVG's"
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ struct MainPage<Inner: HTML>: SendableHTMLDocument where Inner: Sendable {
|
|||||||
Header()
|
Header()
|
||||||
PageContent(body: inner)
|
PageContent(body: inner)
|
||||||
}
|
}
|
||||||
|
Footer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,38 +62,48 @@ private struct Header: HTML {
|
|||||||
nav(.class("flex flex-row gap-2 p-2 mt-2")) {
|
nav(.class("flex flex-row gap-2 p-2 mt-2")) {
|
||||||
// TODO: Add class active, to button that is the active route.
|
// 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")) {
|
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 {
|
li {
|
||||||
a(
|
a(.class("hover:border-b border-yellow-300"), .hx.get(route: route), .hx.target("#content"), .hx.pushURL(true)) {
|
||||||
.class("hover:border-b \(border: .yellow)"),
|
label
|
||||||
.hx.get(route: .moldRisk(.index)), .hx.target("#content"), .hx.pushURL(true)
|
|
||||||
) {
|
|
||||||
"Mold-Risk"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
li {
|
|
||||||
a(
|
|
||||||
.class("[&:hover]:border-b \(border: .yellow)"),
|
|
||||||
.hx.get(route: .dehumidifierSize(.index)), .hx.target("#content"), .hx.pushURL(true)
|
|
||||||
) {
|
|
||||||
"Dehumidifier-Sizing"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
li {
|
|
||||||
a(
|
private struct Footer: HTML {
|
||||||
.class("hover:border-b \(border: .yellow)"),
|
var content: some HTML {
|
||||||
.hx.get(route: .hvacSystemPerformance(.index)), .hx.target("#content"), .hx.pushURL(true)
|
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")) {
|
||||||
"HVAC-System-Performance"
|
div(.class("grid grid-cols-1 p-4")) {
|
||||||
}
|
div(.class("flex")) {
|
||||||
}
|
span { "Toolbox icon by" }
|
||||||
li {
|
a(.class("mx-1"), .href("https://dribbble.com/Laridae?ref=svgrepo.com"), .target(.blank)) {
|
||||||
a(
|
u { "Laridae" }
|
||||||
.class("hover:border-b \(border: .yellow)"),
|
}
|
||||||
.hx.get(route: .roomPressure(.index)), .hx.target("#content"), .hx.pushURL(true)
|
span { "in CC Attribution License via" }
|
||||||
) {
|
a(.class("mx-1"), .href("https://www.svgrepo.com/"), .target(.blank)) { u { "SVG Repo" } }
|
||||||
"Room-Pressure"
|
}
|
||||||
|
|
||||||
|
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" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,12 @@ struct RoomPressureForm: HTML, Sendable {
|
|||||||
div(.class("relative")) {
|
div(.class("relative")) {
|
||||||
FormHeader(label: "Room Pressure Calculator", svg: .leftRightArrow)
|
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.
|
// Mode toggle / buttons.
|
||||||
div(.class("absolute top-0 right-0 flex items-center gap-x-0")) {
|
div(.class("absolute top-0 right-0 flex items-center gap-x-0")) {
|
||||||
switch mode {
|
switch mode {
|
||||||
|
|||||||
5
justfile
5
justfile
@@ -1,5 +1,6 @@
|
|||||||
docker_image := "hvac-toolbox"
|
docker_image := "hvac-toolbox"
|
||||||
docker_tag := "latest"
|
docker_tag := "latest"
|
||||||
|
do_registery := "registry.digitalocean.com/swift-hvac-toolbox"
|
||||||
|
|
||||||
build-docker:
|
build-docker:
|
||||||
@docker build -t {{docker_image}}:{{docker_tag}} .
|
@docker build -t {{docker_image}}:{{docker_tag}} .
|
||||||
@@ -16,3 +17,7 @@ run-css:
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -rf .build
|
@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}}
|
||||||
|
|||||||
Reference in New Issue
Block a user