Compare commits

...

2 Commits

Author SHA1 Message Date
eb920c80fc
Wait don't deploy 2022-03-14 20:33:19 +01:00
1069d10f8e
Pain 2022-03-14 20:32:35 +01:00
11 changed files with 107 additions and 80 deletions

View File

@ -5,6 +5,8 @@ name: default
trigger: trigger:
event: event:
- push - push
branch:
- main
# STAGING!!!!!!!!!!!!! # STAGING!!!!!!!!!!!!!
steps: steps:
@ -54,6 +56,8 @@ trigger:
- promote - promote
target: target:
- production - production
branch:
- main
steps: steps:
- name: docker - name: docker

View File

@ -7,5 +7,11 @@ type header struct {
} }
func (h *header) Render() app.UI { 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"),
)
} }

View File

@ -28,39 +28,40 @@ func NewHomepage() *Homepage {
func (p *Homepage) Render() app.UI { func (p *Homepage) Render() app.UI {
gbp := newGuestbookPanel() gbp := newGuestbookPanel()
return app.Div().Body( return app.Div().
&header{}, Body(
&navbar{}, &header{},
&homePanel{ &navbar{},
onShowClick: func() { &homePanel{
p.showGuestbook = !p.showGuestbook onShowClick: func() {
p.showGuestbook = !p.showGuestbook
},
}, },
}, &guestbookForm{
&guestbookForm{ OnSubmit: func(name, message string) {
OnSubmit: func(name, message string) { var comment entity.Comment
var comment entity.Comment comment.Name = name
comment.Name = name comment.Message = message
comment.Message = message
jsondata, err := json.Marshal(comment) jsondata, err := json.Marshal(comment)
if err != nil { if err != nil {
fmt.Printf("err: %v\n", err) fmt.Printf("err: %v\n", err)
return return
} }
url := ApiURL url := ApiURL
req, err := http.Post(url, "application/json", bytes.NewBuffer(jsondata)) req, err := http.Post(url, "application/json", bytes.NewBuffer(jsondata))
if err != nil { if err != nil {
fmt.Printf("err: %v\n", err) fmt.Printf("err: %v\n", err)
return return
} }
if req.StatusCode == 200 { if req.StatusCode == 200 {
p.Update() p.Update()
} }
defer req.Body.Close() defer req.Body.Close()
},
}, },
}, //app.If(p.showGuestbook, gbp),
//app.If(p.showGuestbook, gbp), gbp.Render(),
gbp.Render(), ).Class("mt-1.5 w-[900px] mx-auto ")
).Class("main")
} }

View File

@ -9,32 +9,39 @@ type homePanel struct {
updateAvailable bool updateAvailable bool
} }
func newHomePanel() *homePanel {
return &homePanel{}
}
func (p *homePanel) Render() app.UI { func (p *homePanel) Render() app.UI {
return app.Div().Body( return app.Div().
app.P().Text("Welcome, internet surfer!").Class("p-h1"), Class("flex flex-nowrap text-aliceblue").
app.Raw(`<p class="content-text">This website is my creative outlet and a way of expressing myself. Body(
As of now, it's probably the most impressive thing I've ever coded. app.Div().
<br><br> Class("flex-auto").
Please enjoy yourself and do sign the guestbook!!</p>`), Body(
app.If(p.updateAvailable, 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.Div().Body(
app.P(). app.P().Text("Please sign my guestbook!").Class("small"),
Class("content-text"). app.Img().Src("/web/static/images/email3.gif").Style("width", "40px").Style("position", "absolute").Style("bottom", "0px").Style("right", "0px"),
Text("An update is available! Reload to update!"), ).Style("position", "absolute").Style("bottom", "5px").Style("right", "5px").
)), OnClick(func(ctx app.Context, e app.Event) {
app.Div().Body( e.PreventDefault()
app.P().Text("Please sign my guestbook!").Class("small"), p.onShowClick()
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"). ).Class("content")
OnClick(func(ctx app.Context, e app.Event) {
e.PreventDefault()
p.onShowClick()
}),
).Class("content")
} }
func (p *homePanel) OnAppUpdate(ctx app.Context) { func (p *homePanel) OnAppUpdate(ctx app.Context) {

View File

@ -21,5 +21,5 @@ func (n *navbar) Render() app.UI {
app.A().Href("/galaxies").Text("Galaxies"), 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
View 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+54brxz8NLxPIRDF3408togkwlugESy2AxqgUf2Rg1onksqFtOyM1AJwRUrumAk8pxGqoMRKcW2O2wteHfWgiS0BzxGhPfRJxar1KDIdVvDLWVJaqaeBsawItEmkaLKzXyOh9f1pzFnxPoy48uUxGJ7AOFrBy+kEKppZbsF5ZpbS1vz3Ld3rPv3ljRXpzwQXSf323T2nbBw++NhdvdTTMmFidUL4ZXh45aSmErzyurV0lQvlGpXroPn25Qp+liQSFu3IAzAUpVx6CFolhuqotR2lBSbPbca6b+5WcwLlYruDiCzkhsqMqrkKwwxVs+qzKjOqnDbhjAIggZLD6KHrOyIkU2yd91SBw3D3ieY9HtMnhuHaNonEeEBEj1/LBKDHokP5IUlRDGR9+iEZaouZ4SzJId2BKSAhvFck8Eg16+MIWNxrB+fS1qyN7KqXelgFILlql5NMHeCpfZVKVE2u1UbgYXgAvwuc5FrL2vG+RH0BXHBbnAZdCLjuf3ITNyBwIwVl/Dsxe3jE8WN/WAkEic9EucEapos9WRQRbyQZJqnfFUWNQkh1/pewWYcJrolYZTIdIHUyv9f0sGbHaeD7/djORtIBzxWOszOLh18NP1wr/fRAIdoNhaJCA2w2Eg+RVbyT5RHMJ81wEStzYKFBe6EpDo94OhY6d+41iKEhSm9AHhtx1s0R8kSjpJUVdpKYlawkkUsT6BHOTOjSoie9qFBVpWZiOvMy4raJ8sjFrO4yrXrSn9xsoL59Whl56b1OTDJiZ6Gs+eKXB6spGgX8mEqn5pvJWhMLwQvg7b3W4Delhfee0oUoKM1r8+mKewINNc7Qke/HYF+hRxtar4eqexAjoMVDk1Gk6PXk+NNRUu1EmJT3ytkdm5JjgeS3HO9AVZH2ylR/4Lxy1axla1+x3WuLobDRe4fYzw80vEQ42g2/auMn99F5Fi3gXdicfJHO/Ci/k3E6nQt6j2/pTN8roQ1XDRnpCsYgKbFrjVabR/sKftC0Hj88lpw+vFvSAHjFoAAdRMnHLjh7K8zhyEPPx9x6Lb/stS2g7+y8PUf</diagram></mxfile>

View File

@ -54,11 +54,16 @@ func main() {
"DutchEllie", "Quenten", "DutchEllie", "Quenten",
}, },
Styles: []string{ Styles: []string{
"/web/static/style.css", //"/web/static/style.css",
"/web/static/newstyle.css",
"/web/static/adreena.css", "/web/static/adreena.css",
"/web/static/anisha.css", "/web/static/anisha.css",
"/web/static/havakana.css", "/web/static/havakana.css",
}, },
Scripts: []string{
"https://cdn.tailwindcss.com",
"/web/static/custom.js",
},
CacheableResources: []string{}, CacheableResources: []string{},
} }

View File

@ -4,32 +4,20 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="static/style.css"> <link rel="stylesheet" href="static/adreena.css">
<link rel="stylesheet" href="static/anisha.css?family=anisha"> <link rel="stylesheet" href="static/anisha.css">
<link rel="stylesheet" href="static/adreena.css?family=adreena"> <script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="static/havakana.css?family=havakana">
<title>Index</title> <title>Index</title>
</head> </head>
<body> <body>
<div class="header"> <div class="w-[900px] ">
Internetica Galactica test
</div> </div>
<div class="main"> <div class="">
<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="content">
<p class="p-h1">My friends!</p>
<p>These are some of the websites of my friends!</p>
</div>
</div> </div>
</body> </body>
</html> </html>

11
web/static/custom.js Normal file
View File

@ -0,0 +1,11 @@
tailwind.config = {
theme: {
extend: {
colors: {
'cool': '#362730',
'borderpink': '#fce6ff',
'aliceblue': '#f0f8ff',
}
}
}
}

4
web/static/newstyle.css Normal file
View File

@ -0,0 +1,4 @@
html {
background-image: url(images/background_star.gif);
overflow-y: scroll;
}

View File

@ -16,8 +16,8 @@ body {
.header { .header {
border: 3px solid; border: 3px solid;
border-radius: 4px; border-radius: 4px;
border-color: rgb(252, 230, 255); border-color: #fce6ff;
background-color: rgb(54, 39, 48); background-color: #362730;
font-size: 5em; font-size: 5em;
font-family: anisha; font-family: anisha;
text-align: center; text-align: center;