From 9c2014815962be9041f9c240138cb42c24cf94b7 Mon Sep 17 00:00:00 2001 From: jc <46619361+juancwu@users.noreply.github.com> Date: Tue, 26 Mar 2024 01:14:51 -0400 Subject: [PATCH] flatten folder structure --- go.mod | 10 +- go.sum | 20 +- main.go | 6 +- package.json | 4 +- pkg/pages/index.go => page.go | 9 +- public/views/index.html | 357 ---------------------------------- styles.css | 75 ------- tailwind.config.js | 2 +- views/index.html | 214 ++++++++++++++++++++ views/styles.css | 64 ++++++ 10 files changed, 302 insertions(+), 459 deletions(-) rename pkg/pages/index.go => page.go (90%) delete mode 100644 public/views/index.html delete mode 100644 styles.css create mode 100644 views/index.html create mode 100644 views/styles.css diff --git a/go.mod b/go.mod index fb7ce6d..56a46e2 100644 --- a/go.mod +++ b/go.mod @@ -11,12 +11,12 @@ require ( github.com/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/labstack/gommon v0.4.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect - golang.org/x/crypto v0.14.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect + golang.org/x/crypto v0.16.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect ) diff --git a/go.sum b/go.sum index f9a73b5..e106918 100644 --- a/go.sum +++ b/go.sum @@ -14,8 +14,8 @@ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxec github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -27,19 +27,19 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/main.go b/main.go index cf9abf0..c32ae67 100644 --- a/main.go +++ b/main.go @@ -11,8 +11,6 @@ import ( "github.com/joho/godotenv" "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" - - "github.com/juancwu/potoforio/pkg/pages" ) type TemplateRenderer struct { @@ -29,7 +27,7 @@ func main() { } } - templates, err := template.New("").ParseGlob("public/views/*.html") + templates, err := template.New("").ParseGlob("views/*.html") if err != nil { log.Fatalf("Error initializing templates: %v", err) os.Exit(1) @@ -43,7 +41,7 @@ func main() { e.Use(middleware.Logger()) e.Static("/static", "static") - e.GET("/", pages.Index) + e.GET("/", renderPage) e.GET("/service/health-check", func(c echo.Context) error { return c.NoContent(http.StatusOK) diff --git a/package.json b/package.json index ce84a51..05f525b 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "main": "index.js", "scripts": { "dev": "concurrently \"pnpm run tw:dev\" \"air\"", - "tw:dev": "tailwindcss -i ./styles.css -o ./static/styles.css --watch", - "tw:prod": "tailwindcss -i ./styles.css -o ./static/styles.css --minify", + "tw:dev": "tailwindcss -i ./views/styles.css -o ./static/styles.css --watch", + "tw:prod": "tailwindcss -i ./views/styles.css -o ./static/styles.css --minify", "prettier": "prettier ./public --write", "prettier:check": "prettier ./public --check" }, diff --git a/pkg/pages/index.go b/page.go similarity index 90% rename from pkg/pages/index.go rename to page.go index 851105e..8c50e74 100644 --- a/pkg/pages/index.go +++ b/page.go @@ -1,4 +1,4 @@ -package pages +package main import ( "github.com/labstack/echo/v4" @@ -23,8 +23,7 @@ type Page struct { Projects []Project } -func Index(c echo.Context) error { - +func renderPage(c echo.Context) error { data := Page{} data.Projects = []Project{ { @@ -42,12 +41,12 @@ func Index(c echo.Context) error { { TechName: "Drizzle ORM", TechURL: "https://orm.drizzle.team/", - TechClasses: "transition bg-zinc-950 text-zinc-100 hover:bg-green-600", + TechClasses: "transition bg-zinc-950 text-zinc-100 hover:bg-green-600", }, { TechName: "Turso", TechURL: "https://turso.tech/", - TechClasses: "transition bg-zinc-950 text-zinc-100 hover:bg-teal-600", + TechClasses: "transition bg-zinc-950 text-zinc-100 hover:bg-teal-600", }, }, }, diff --git a/public/views/index.html b/public/views/index.html deleted file mode 100644 index d59ac55..0000000 --- a/public/views/index.html +++ /dev/null @@ -1,357 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Juan Wu | Portfolio - - - - -
-
-
- JUAN WU -
- SOFTWARE DEVELOPER - -
-
- - -
-
-
- - -
-
-
-

- Hello there , -

-

- I am Juan -

-

- I am a Software Developer during the day -

-

- & - work at - LCS - and - Hawk Hacks - at night -

-

(send help, I have been enslaved)

- -

- Check out my -

- - PROJECTS - -
- -
-
-
- -
-
-
-

- Welcome to - - Project Graveyard - -

- - Juan's dumb projects archive - -
-
- -
- {{ range .Projects }} -
-
-
- {{ if gt (len .URL) 1 }} - -

- {{ .Name }} - - - -

-
- {{ else }} -

{{ .Name }}

- {{ end }} - -
- -
- -

{{ .Description }}

-
-

- Checkout the code in - GitHub -

-
- {{ end }} -
-
- - - diff --git a/styles.css b/styles.css deleted file mode 100644 index ac5db76..0000000 --- a/styles.css +++ /dev/null @@ -1,75 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - -@layer components { - .colourful-card { - @apply relative bg-white p-2 text-zinc-950 transition-all after:absolute after:-right-2 - after:top-2 after:-z-10 - after:h-full - after:w-full after:bg-gradient-to-r after:from-purple-500 after:to-pink-500 - after:transition-all hover:bg-transparent - hover:text-white hover:after:right-0 hover:after:top-0 - focus:bg-transparent focus:text-white - focus:after:right-0 focus:after:top-0; - } - - .clip-me-from-grass { - clip-path: polygon( - 58.36% 5.19%, - 52.34% 3.68%, - 45.85% 3.05%, - 37.74% 7.64%, - 35.66% 12.39%, - 34.82% 19.98%, - 32.57% 27.81%, - 29.87% 32.92%, - 22.01% 37.14%, - 17.02% 42.9%, - 10.6% 53.43%, - 8.22% 70.71%, - 6.32% 80.67%, - 10.69% 91.75%, - 9.18% 99.36%, - 47.27% 99.44%, - 92.39% 99.2%, - 91.85% 86.29%, - 94.77% 74.28%, - 88.08% 54.82%, - 83.74% 45.14%, - 78.61% 37.63%, - 71.62% 34.03%, - 64.62% 23.61%, - 63.88% 18.13%, - 62.23% 10.25% - ); - } - - .grid-pattern { - width: 100%; - height: 100%; - background-size: cover; - background-position: center center; - background-repeat: repeat; - background-image: url("/static/grid.svg"); - } - - .radial-overlay { - background: radial-gradient( - circle, - rgba(24, 24, 27, 0) 0%, - rgba(24, 24, 27, 1) 50% - ); - } - - .polka-pattern { - background-color: #18181b; - opacity: 1; - background-image: radial-gradient(#27272a 1.3px, transparent 1.3px), - radial-gradient(#27272a 1.3px, #18181b 1.3px); - background-size: 52px 52px; - background-position: - 0 0, - 26px 26px; - } -} diff --git a/tailwind.config.js b/tailwind.config.js index caf8a17..86b4eba 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,6 +1,6 @@ /** @type {import('tailwindcss').Config} */ module.exports = { - content: ["./pkg/pages/**/*.go", "./public/views/**/*.html"], + content: ["./page.go", "./views/**/*.html"], theme: { extend: { fontFamily: { diff --git a/views/index.html b/views/index.html new file mode 100644 index 0000000..3136209 --- /dev/null +++ b/views/index.html @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + Juan Wu | Portfolio + + + + +
+
+
+ JUAN WU +
+ SOFTWARE DEVELOPER + +
+
+ + +
+
+
+ + +
+
+
+

+ Hello there , +

+

+ I am Juan +

+

+ I am a Software Developer during the day +

+

+ & + work at + LCS + and + Hawk + Hacks + at night +

+

(send help, I have been enslaved)

+ +

+ Check out my +

+ + PROJECTS + +
+ +
+
+
+ +
+
+
+

+ Welcome to + + Project Graveyard + +

+ + Juan's dumb projects archive + +
+
+ +
+ {{ range .Projects }} +
+
+
+ {{ if gt (len .URL) 1 }} + +

+ {{ .Name }} + + + +

+
+ {{ else }} +

{{ .Name }}

+ {{ end }} + +
+ +
+ +

{{ .Description }}

+
+

+ Checkout the code in + GitHub +

+
+ {{ end }} +
+
+ + + + diff --git a/views/styles.css b/views/styles.css new file mode 100644 index 0000000..0255ee0 --- /dev/null +++ b/views/styles.css @@ -0,0 +1,64 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +@layer components { + .colourful-card { + @apply relative bg-white p-2 text-zinc-950 transition-all after:absolute after:-right-2 after:top-2 after:-z-10 after:h-full after:w-full after:bg-gradient-to-r after:from-purple-500 after:to-pink-500 after:transition-all hover:bg-transparent hover:text-white hover:after:right-0 hover:after:top-0 focus:bg-transparent focus:text-white focus:after:right-0 focus:after:top-0; + } + + .clip-me-from-grass { + clip-path: polygon(58.36% 5.19%, + 52.34% 3.68%, + 45.85% 3.05%, + 37.74% 7.64%, + 35.66% 12.39%, + 34.82% 19.98%, + 32.57% 27.81%, + 29.87% 32.92%, + 22.01% 37.14%, + 17.02% 42.9%, + 10.6% 53.43%, + 8.22% 70.71%, + 6.32% 80.67%, + 10.69% 91.75%, + 9.18% 99.36%, + 47.27% 99.44%, + 92.39% 99.2%, + 91.85% 86.29%, + 94.77% 74.28%, + 88.08% 54.82%, + 83.74% 45.14%, + 78.61% 37.63%, + 71.62% 34.03%, + 64.62% 23.61%, + 63.88% 18.13%, + 62.23% 10.25%); + } + + .grid-pattern { + width: 100%; + height: 100%; + background-size: cover; + background-position: center center; + background-repeat: repeat; + background-image: url("/static/grid.svg"); + } + + .radial-overlay { + background: radial-gradient(circle, + rgba(24, 24, 27, 0) 0%, + rgba(24, 24, 27, 1) 50%); + } + + .polka-pattern { + background-color: #18181b; + opacity: 1; + background-image: radial-gradient(#27272a 1.3px, transparent 1.3px), + radial-gradient(#27272a 1.3px, #18181b 1.3px); + background-size: 52px 52px; + background-position: + 0 0, + 26px 26px; + } +}