50 lines
1.6 KiB
Go
50 lines
1.6 KiB
Go
package components
|
|
|
|
import "github.com/maxence-charriere/go-app/v9/pkg/app"
|
|
|
|
type homePanel struct {
|
|
app.Compo
|
|
|
|
onShowClick func()
|
|
updateAvailable bool
|
|
}
|
|
|
|
func (p *homePanel) Render() app.UI {
|
|
return app.Div().
|
|
Class("flex flex-nowrap text-aliceblue").
|
|
Body(
|
|
app.Div().
|
|
Class("flex-auto").
|
|
Body(
|
|
app.P().Text("Welcome, internet surfer!").Class("p-h1"),
|
|
app.P().
|
|
Class("").
|
|
Text(`Welcome to my website! Whether you came here by accident or were linked to it, I welcome you!
|
|
Have a look around my page to see all the stuff I put on it!
|
|
I put in a lot of effort, probably the most out of any project I have attempted, so it would be nice
|
|
if you left a nice comment down in the guestbook.
|
|
There is no signup required (unlike the stupid modern web where that's "essential").
|
|
Go crazy, write whatever you want! Just be nice!
|
|
Above all, enjoy yourself in my little online webspace!!!`),
|
|
app.If(p.updateAvailable,
|
|
app.Div().Body(
|
|
app.P().
|
|
Class("content-text").
|
|
Text("An update is available! Reload to update!"),
|
|
)),
|
|
),
|
|
app.Div().Body(
|
|
app.P().Text("Please sign my guestbook!").Class("small"),
|
|
app.Img().Src("/web/static/images/email3.gif").Style("width", "40px").Style("position", "absolute").Style("bottom", "0px").Style("right", "0px"),
|
|
).Style("position", "absolute").Style("bottom", "5px").Style("right", "5px").
|
|
OnClick(func(ctx app.Context, e app.Event) {
|
|
e.PreventDefault()
|
|
p.onShowClick()
|
|
}),
|
|
).Class("content")
|
|
}
|
|
|
|
func (p *homePanel) OnAppUpdate(ctx app.Context) {
|
|
p.updateAvailable = true
|
|
}
|