From 1069d10f8e3d66a91531d711f39a3366e440d34d Mon Sep 17 00:00:00 2001 From: DutchEllie <personal@quenten.nl> Date: Mon, 14 Mar 2022 20:32:35 +0100 Subject: [PATCH] Pain --- components/header.go | 8 +++++- components/homepage.go | 63 +++++++++++++++++++++-------------------- components/homepanel.go | 55 +++++++++++++++++++---------------- components/navbar.go | 2 +- design-desktop.drawio | 1 + main.go | 7 ++++- test-website/base.html | 28 ++++++------------ web/static/custom.js | 11 +++++++ web/static/newstyle.css | 4 +++ web/static/style.css | 4 +-- 10 files changed, 103 insertions(+), 80 deletions(-) create mode 100644 design-desktop.drawio create mode 100644 web/static/custom.js create mode 100644 web/static/newstyle.css diff --git a/components/header.go b/components/header.go index c0d23c7..c6a098c 100644 --- a/components/header.go +++ b/components/header.go @@ -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"), + ) } diff --git a/components/homepage.go b/components/homepage.go index f6f6aea..48d5cb5 100644 --- a/components/homepage.go +++ b/components/homepage.go @@ -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 ") } diff --git a/components/homepanel.go b/components/homepanel.go index fef2c62..09d8541 100644 --- a/components/homepanel.go +++ b/components/homepanel.go @@ -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) { diff --git a/components/navbar.go b/components/navbar.go index 6bbea67..3eb9567 100644 --- a/components/navbar.go +++ b/components/navbar.go @@ -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") } diff --git a/design-desktop.drawio b/design-desktop.drawio new file mode 100644 index 0000000..8cd39b5 --- /dev/null +++ b/design-desktop.drawio @@ -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> \ No newline at end of file diff --git a/main.go b/main.go index 1c9cd99..52363ee 100644 --- a/main.go +++ b/main.go @@ -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{}, } diff --git a/test-website/base.html b/test-website/base.html index 484f3ee..562a482 100644 --- a/test-website/base.html +++ b/test-website/base.html @@ -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> diff --git a/web/static/custom.js b/web/static/custom.js new file mode 100644 index 0000000..1b6bbe5 --- /dev/null +++ b/web/static/custom.js @@ -0,0 +1,11 @@ +tailwind.config = { + theme: { + extend: { + colors: { + 'cool': '#362730', + 'borderpink': '#fce6ff', + 'aliceblue': '#f0f8ff', + } + } + } +} \ No newline at end of file diff --git a/web/static/newstyle.css b/web/static/newstyle.css new file mode 100644 index 0000000..e3c6c10 --- /dev/null +++ b/web/static/newstyle.css @@ -0,0 +1,4 @@ +html { + background-image: url(images/background_star.gif); + overflow-y: scroll; +} \ No newline at end of file diff --git a/web/static/style.css b/web/static/style.css index 316f115..460d237 100644 --- a/web/static/style.css +++ b/web/static/style.css @@ -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;