2024-09-11 00:52:18 +00:00
|
|
|
package pages
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/gofiber/fiber/v2"
|
2024-09-14 00:05:55 +00:00
|
|
|
"github.com/maddalax/htmgo/framework/h"
|
2024-09-14 02:52:41 +00:00
|
|
|
"starter-template/partials"
|
2024-09-11 00:52:18 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func IndexPage(c *fiber.Ctx) *h.Page {
|
2024-09-13 01:31:18 +00:00
|
|
|
return h.NewPage(h.Html(
|
2024-09-16 22:41:46 +00:00
|
|
|
h.Class("bg-blue-400 flex flex-col items-center h-full w-full"),
|
2024-09-13 01:31:18 +00:00
|
|
|
h.Head(
|
2024-09-13 15:47:18 +00:00
|
|
|
h.Link("/public/main.css", "stylesheet"),
|
2024-09-14 00:05:55 +00:00
|
|
|
h.Script("/public/htmgo.js"),
|
2024-09-13 15:47:18 +00:00
|
|
|
),
|
|
|
|
|
h.Body(
|
2024-09-16 22:41:46 +00:00
|
|
|
h.Class("flex flex-col gap-4"),
|
2024-09-13 15:47:18 +00:00
|
|
|
h.Div(
|
2024-09-14 02:52:41 +00:00
|
|
|
h.Class("flex flex-col items-center justify-center gap-6 p-12 text-center"),
|
2024-09-13 15:47:18 +00:00
|
|
|
h.H1(
|
2024-09-14 02:52:41 +00:00
|
|
|
h.Class("text-4xl sm:text-5xl font-bold max-w-3xl"),
|
2024-09-16 22:41:46 +00:00
|
|
|
h.Text("Welcome to my fast!!"),
|
2024-09-13 15:47:18 +00:00
|
|
|
),
|
|
|
|
|
h.P(
|
2024-09-16 22:41:46 +00:00
|
|
|
h.Class("text-lg sm:text-xl max-w-1xl"),
|
2024-09-13 15:47:18 +00:00
|
|
|
),
|
2024-09-14 02:52:41 +00:00
|
|
|
h.Div(
|
2024-09-16 22:41:46 +00:00
|
|
|
Button(),
|
2024-09-13 15:47:18 +00:00
|
|
|
),
|
|
|
|
|
),
|
2024-09-13 01:31:18 +00:00
|
|
|
),
|
|
|
|
|
))
|
2024-09-11 00:52:18 +00:00
|
|
|
}
|
2024-09-16 22:41:46 +00:00
|
|
|
|
|
|
|
|
func Button() h.Renderable {
|
|
|
|
|
return h.Button(h.Class("btn bg-slate-500 p-4 rounded text-white"),
|
|
|
|
|
h.Text("Click here use my ytes"),
|
|
|
|
|
h.AfterRequest(
|
|
|
|
|
h.SetDisabled(true),
|
|
|
|
|
h.RemoveClass("bg-red-600"),
|
|
|
|
|
h.AddClass("bg-gray-500"),
|
|
|
|
|
),
|
|
|
|
|
h.GetPartial(partials.SamplePartial),
|
|
|
|
|
)
|
|
|
|
|
}
|