Pain
This commit is contained in:
parent
00614b6346
commit
1069d10f8e
@ -7,5 +7,11 @@ type header struct {
|
||||
}
|
||||
|
||||
func (h *header) Render() app.UI {
|
||||
return app.Div().Text("Internetica Galactica").Class("header")
|
||||
return app.Div().
|
||||
Class("border-solid border-4 border-borderpink rounded").
|
||||
Body(
|
||||
app.H1().
|
||||
Class("font-[anisha] bg-cool text-aliceblue text-[80px] text-center").
|
||||
Text("Internetica Galactica"),
|
||||
)
|
||||
}
|
||||
|
@ -28,39 +28,40 @@ func NewHomepage() *Homepage {
|
||||
|
||||
func (p *Homepage) Render() app.UI {
|
||||
gbp := newGuestbookPanel()
|
||||
return app.Div().Body(
|
||||
&header{},
|
||||
&navbar{},
|
||||
&homePanel{
|
||||
onShowClick: func() {
|
||||
p.showGuestbook = !p.showGuestbook
|
||||
return app.Div().
|
||||
Body(
|
||||
&header{},
|
||||
&navbar{},
|
||||
&homePanel{
|
||||
onShowClick: func() {
|
||||
p.showGuestbook = !p.showGuestbook
|
||||
},
|
||||
},
|
||||
},
|
||||
&guestbookForm{
|
||||
OnSubmit: func(name, message string) {
|
||||
var comment entity.Comment
|
||||
comment.Name = name
|
||||
comment.Message = message
|
||||
&guestbookForm{
|
||||
OnSubmit: func(name, message string) {
|
||||
var comment entity.Comment
|
||||
comment.Name = name
|
||||
comment.Message = message
|
||||
|
||||
jsondata, err := json.Marshal(comment)
|
||||
if err != nil {
|
||||
fmt.Printf("err: %v\n", err)
|
||||
return
|
||||
}
|
||||
url := ApiURL
|
||||
jsondata, err := json.Marshal(comment)
|
||||
if err != nil {
|
||||
fmt.Printf("err: %v\n", err)
|
||||
return
|
||||
}
|
||||
url := ApiURL
|
||||
|
||||
req, err := http.Post(url, "application/json", bytes.NewBuffer(jsondata))
|
||||
if err != nil {
|
||||
fmt.Printf("err: %v\n", err)
|
||||
return
|
||||
}
|
||||
if req.StatusCode == 200 {
|
||||
p.Update()
|
||||
}
|
||||
defer req.Body.Close()
|
||||
req, err := http.Post(url, "application/json", bytes.NewBuffer(jsondata))
|
||||
if err != nil {
|
||||
fmt.Printf("err: %v\n", err)
|
||||
return
|
||||
}
|
||||
if req.StatusCode == 200 {
|
||||
p.Update()
|
||||
}
|
||||
defer req.Body.Close()
|
||||
},
|
||||
},
|
||||
},
|
||||
//app.If(p.showGuestbook, gbp),
|
||||
gbp.Render(),
|
||||
).Class("main")
|
||||
//app.If(p.showGuestbook, gbp),
|
||||
gbp.Render(),
|
||||
).Class("mt-1.5 w-[900px] mx-auto ")
|
||||
}
|
||||
|
@ -9,32 +9,39 @@ type homePanel struct {
|
||||
updateAvailable bool
|
||||
}
|
||||
|
||||
func newHomePanel() *homePanel {
|
||||
return &homePanel{}
|
||||
}
|
||||
|
||||
func (p *homePanel) Render() app.UI {
|
||||
return app.Div().Body(
|
||||
app.P().Text("Welcome, internet surfer!").Class("p-h1"),
|
||||
app.Raw(`<p class="content-text">This website is my creative outlet and a way of expressing myself.
|
||||
As of now, it's probably the most impressive thing I've ever coded.
|
||||
<br><br>
|
||||
Please enjoy yourself and do sign the guestbook!!</p>`),
|
||||
app.If(p.updateAvailable,
|
||||
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().
|
||||
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")
|
||||
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) {
|
||||
|
@ -21,5 +21,5 @@ func (n *navbar) Render() app.UI {
|
||||
app.A().Href("/galaxies").Text("Galaxies"),
|
||||
),
|
||||
),
|
||||
).Class("navbar")
|
||||
).Class("border-solid border-4 rounded border-borderpink text-aliceblue bg-cool float-left relative w-[180px] font-[havakana] text-center")
|
||||
}
|
||||
|
1
design-desktop.drawio
Normal file
1
design-desktop.drawio
Normal file
@ -0,0 +1 @@
|
||||
<mxfile host="app.diagrams.net" modified="2022-03-14T17:54:08.495Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36" etag="OBbzwV6CMD5jW8t-1HUz" version="17.1.2" type="browser"><diagram name="Page-1" id="03018318-947c-dd8e-b7a3-06fadd420f32">5VhRb5swEP41PLbCGEjy2CRdq6ntpnVSnx1wwIrB1Jgm7a/fGewQAlVTqUyLlofE/s6c8Xff+ew4eJHtbiQp0nsRU+54brxz8NL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54,11 +54,16 @@ func main() {
|
||||
"DutchEllie", "Quenten",
|
||||
},
|
||||
Styles: []string{
|
||||
"/web/static/style.css",
|
||||
//"/web/static/style.css",
|
||||
"/web/static/newstyle.css",
|
||||
"/web/static/adreena.css",
|
||||
"/web/static/anisha.css",
|
||||
"/web/static/havakana.css",
|
||||
},
|
||||
Scripts: []string{
|
||||
"https://cdn.tailwindcss.com",
|
||||
"/web/static/custom.js",
|
||||
},
|
||||
CacheableResources: []string{},
|
||||
}
|
||||
|
||||
|
@ -4,32 +4,20 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="static/style.css">
|
||||
<link rel="stylesheet" href="static/anisha.css?family=anisha">
|
||||
<link rel="stylesheet" href="static/adreena.css?family=adreena">
|
||||
<link rel="stylesheet" href="static/havakana.css?family=havakana">
|
||||
<link rel="stylesheet" href="static/adreena.css">
|
||||
<link rel="stylesheet" href="static/anisha.css">
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<title>Index</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="header">
|
||||
Internetica Galactica
|
||||
<div class="w-[900px] ">
|
||||
test
|
||||
</div>
|
||||
<div class="main">
|
||||
<div class="navbar">
|
||||
<ul>
|
||||
<li><a href="base.html">Home</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="content">
|
||||
Dit is eigenlijk 1 van die dingen die steeds kan veranderen
|
||||
Deze doet dat
|
||||
</div>
|
||||
<div class="">
|
||||
|
||||
|
||||
<div class="content">
|
||||
<p class="p-h1">My friends!</p>
|
||||
<p>These are some of the websites of my friends!</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
11
web/static/custom.js
Normal file
11
web/static/custom.js
Normal file
@ -0,0 +1,11 @@
|
||||
tailwind.config = {
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
'cool': '#362730',
|
||||
'borderpink': '#fce6ff',
|
||||
'aliceblue': '#f0f8ff',
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
4
web/static/newstyle.css
Normal file
4
web/static/newstyle.css
Normal file
@ -0,0 +1,4 @@
|
||||
html {
|
||||
background-image: url(images/background_star.gif);
|
||||
overflow-y: scroll;
|
||||
}
|
@ -16,8 +16,8 @@ body {
|
||||
.header {
|
||||
border: 3px solid;
|
||||
border-radius: 4px;
|
||||
border-color: rgb(252, 230, 255);
|
||||
background-color: rgb(54, 39, 48);
|
||||
border-color: #fce6ff;
|
||||
background-color: #362730;
|
||||
font-size: 5em;
|
||||
font-family: anisha;
|
||||
text-align: center;
|
||||
|
Loading…
Reference in New Issue
Block a user