about summary refs log tree commit diff stats
path: root/internal/examples/app/html/about.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/examples/app/html/about.go')
-rw-r--r--internal/examples/app/html/about.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/internal/examples/app/html/about.go b/internal/examples/app/html/about.go
new file mode 100644
index 0000000..37b797f
--- /dev/null
+++ b/internal/examples/app/html/about.go
@@ -0,0 +1,25 @@
+package html
+
+import (
+	"time"
+
+	. "github.com/maragudk/gomponents"
+	. "github.com/maragudk/gomponents/html"
+)
+
+func AboutPage() Node {
+	now := time.Now()
+
+	return page("About",
+		H1(Text("About")),
+
+		P(Textf("Built with gomponents and rendered at %v.", now.Format(time.TimeOnly))),
+
+		P(
+			If(now.Second()%2 == 0, Text("It's an even second!")),
+			If(now.Second()%2 != 0, Text("It's an odd second!")),
+		),
+
+		Img(Class("max-w-sm"), Src("https://www.gomponents.com/images/logo.png"), Alt("gomponents logo")),
+	)
+}