2022-03-01 17:07:33 +01:00
|
|
|
package components
|
|
|
|
|
|
|
|
import "github.com/maxence-charriere/go-app/v9/pkg/app"
|
|
|
|
|
|
|
|
type homePanel struct {
|
|
|
|
app.Compo
|
2022-03-02 13:38:28 +01:00
|
|
|
|
2022-03-12 15:52:13 +01:00
|
|
|
onShowClick func()
|
|
|
|
updateAvailable bool
|
2022-03-01 17:07:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func newHomePanel() *homePanel {
|
|
|
|
return &homePanel{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *homePanel) Render() app.UI {
|
|
|
|
return app.Div().Body(
|
2022-03-01 19:45:23 +01:00
|
|
|
app.P().Text("Welcome, internet surfer!").Class("p-h1"),
|
2022-03-14 21:10:10 +01:00
|
|
|
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("top", "10px").Style("right", "5px").
|
|
|
|
OnClick(func(ctx app.Context, e app.Event) {
|
|
|
|
e.PreventDefault()
|
|
|
|
p.onShowClick()
|
|
|
|
}),
|
2022-03-14 21:04:30 +01:00
|
|
|
app.Img().
|
|
|
|
Style("float", "right").
|
2022-03-14 21:10:10 +01:00
|
|
|
Style("margin-bottom", "10px").
|
2022-03-14 21:04:30 +01:00
|
|
|
Height(230).
|
|
|
|
Src("/web/static/images/rin-len1.webp"),
|
|
|
|
app.Raw(
|
|
|
|
`
|
|
|
|
<p class="content-text">
|
|
|
|
Welcome to my webspace! Whether you stumbled across this page by accident
|
|
|
|
or were linked here, you're more than welcome! This is my personal project that I like
|
|
|
|
to work on! I was inspired by a couple friends of mine, please do check their webspaces
|
|
|
|
out as well under "Galaxies" on the left side there!
|
|
|
|
If you like this page, there is a lot more, so have a look around! You can also leave a
|
|
|
|
nice message for me in the guestbook! There is no registration (unlike the rest of the "modern"
|
|
|
|
internet) so nothing of that sort!
|
|
|
|
That said, this website is my creative outlet and a way to introduce myself, so be kind please!
|
|
|
|
Also its code is entirely open-source and can be found
|
|
|
|
<a href="https://dutchellie.nl/DutchEllie/proper-website-2">here</a> so if you like that sort
|
|
|
|
of stuff, be my guest it's cool!</p>
|
|
|
|
`),
|
2022-03-12 15:52:13 +01:00
|
|
|
app.If(p.updateAvailable,
|
|
|
|
app.Div().Body(
|
2022-03-13 21:34:54 +01:00
|
|
|
app.P().
|
|
|
|
Class("content-text").
|
|
|
|
Text("An update is available! Reload to update!"),
|
2022-03-12 15:52:13 +01:00
|
|
|
)),
|
2022-03-01 17:07:33 +01:00
|
|
|
).Class("content")
|
|
|
|
}
|
2022-03-12 15:52:13 +01:00
|
|
|
|
|
|
|
func (p *homePanel) OnAppUpdate(ctx app.Context) {
|
|
|
|
p.updateAvailable = true
|
|
|
|
}
|