aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbun.lockbbin14466 -> 14454 bytes
-rw-r--r--dist/styles.css131
-rw-r--r--example.json8
-rw-r--r--main.go12
-rw-r--r--package.json6
-rw-r--r--scss/main.scss74
-rw-r--r--templates/base/base.gohtml2
-rw-r--r--templates/page/index.gohtml11
8 files changed, 235 insertions, 9 deletions
diff --git a/bun.lockb b/bun.lockb
index 86d0650..85132a7 100755
--- a/bun.lockb
+++ b/bun.lockb
Binary files differ
diff --git a/dist/styles.css b/dist/styles.css
index e69de29..323caaf 100644
--- a/dist/styles.css
+++ b/dist/styles.css
@@ -0,0 +1,131 @@
+/* http://meyerweb.com/eric/tools/css/reset/
+ v5.0.1 | 20191019
+ License: none (public domain)
+*/
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed,
+figure, figcaption, footer, header, hgroup,
+main, menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ vertical-align: baseline;
+}
+
+/* HTML5 display-role reset for older browsers */
+article, aside, details, figcaption, figure,
+footer, header, hgroup, main, menu, nav, section {
+ display: block;
+}
+
+/* HTML5 hidden-attribute fix for newer browsers */
+*[hidden] {
+ display: none;
+}
+
+body {
+ line-height: 1;
+}
+
+menu, ol, ul {
+ list-style: none;
+}
+
+blockquote, q {
+ quotes: none;
+}
+
+blockquote:before, blockquote:after,
+q:before, q:after {
+ content: "";
+ content: none;
+}
+
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+body {
+ height: 100vh;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 18px;
+}
+
+main {
+ width: 50%;
+ background: mediumpurple;
+ padding: 2rem;
+ border-radius: 32px;
+ box-shadow: 0px 0px 70px 2px rgba(0, 0, 0, 0.75);
+}
+
+h1 {
+ font-size: 3rem;
+}
+
+h2 {
+ font-size: 2rem;
+}
+
+.presentation {
+ position: relative;
+ display: flex;
+ align-items: center;
+ gap: 2rem;
+ margin-bottom: 2rem;
+}
+.presentation__information {
+ display: flex;
+ margin-right: 1rem;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ gap: 0.5rem;
+}
+.presentation figure {
+ display: inline;
+}
+.presentation figure img {
+ height: 128px;
+ border-radius: 32px;
+ box-shadow: 0px 0px 50px -20px rgba(0, 0, 0, 0.75);
+}
+.presentation h2, .presentation p {
+ display: inline;
+}
+
+.links {
+ display: flex;
+ margin-top: 2rem;
+ width: 100%;
+ gap: 1rem;
+}
+.links .link {
+ display: block;
+ background: purple;
+ width: 33%;
+ padding: 1em;
+ border-radius: 16px;
+}
+.links a {
+ display: block;
+ color: black;
+ text-decoration: none;
+ text-align: center;
+}
+
+/*# sourceMappingURL=styles.css.map */
diff --git a/example.json b/example.json
index 75e887e..640356a 100644
--- a/example.json
+++ b/example.json
@@ -1,9 +1,9 @@
{
"image": "",
- "description": "",
+ "description": "Sem magna a dui labore et cursus nibh ipsum nulla. Sem magna a dui labore et cursus nibh ipsum nulla. Blandit adipiscing nulla diam dolore ultricies ornare sed risus faucibus. Lobortis mi sed dui risus nulla ultrices vulputate at enim.",
"person": {
- "name": "",
- "pronouns": "",
- "image": ""
+ "name": "Anhgelus Morhtuuzh",
+ "pronouns": "he/his - some basic things though",
+ "image": "pfp.webp"
}
} \ No newline at end of file
diff --git a/main.go b/main.go
index 50bc462..e05c422 100644
--- a/main.go
+++ b/main.go
@@ -55,5 +55,15 @@ func main() {
}
g.Templates = append(g.Templates, "templates/base/*.gohtml")
- //g.StartServer(":80")
+ t := golatt.Template{
+ Golatt: g,
+ Name: "index",
+ Title: data.Person.Name,
+ Data: &data,
+ URL: "/",
+ }
+
+ g.HandleFunc("/", t.Handle())
+
+ g.StartServer(":8000")
}
diff --git a/package.json b/package.json
index 20a2d20..7b199d3 100644
--- a/package.json
+++ b/package.json
@@ -2,6 +2,10 @@
"name": "now",
"module": "index.ts",
"type": "module",
+ "scripts": {
+ "build-sass": "sass --no-source-map --style=compressed scss/main.scss dist/styles.css",
+ "watch-sass": "sass --watch scss/main.scss dist/styles.css"
+ },
"devDependencies": {
"@types/bun": "latest"
},
@@ -9,7 +13,7 @@
"typescript": "^5.0.0"
},
"dependencies": {
- "normalize.css": "^8.0.1",
+ "reset-css": "^5.0.2",
"sass": "^1.80.6"
}
} \ No newline at end of file
diff --git a/scss/main.scss b/scss/main.scss
new file mode 100644
index 0000000..60a3a90
--- /dev/null
+++ b/scss/main.scss
@@ -0,0 +1,74 @@
+@use "../node_modules/reset-css/reset.css";
+
+body {
+ height: 100vh;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 18px;
+}
+
+main {
+ width: 50%;
+ background: mediumpurple;
+ padding: 2rem;
+ border-radius: 32px;
+ box-shadow: 0px 0px 70px 2px rgba(0,0,0,0.75);
+}
+
+h1 {
+ font-size: 3rem;
+}
+
+h2 {
+ font-size: 2rem;
+}
+
+.presentation {
+ position: relative;
+ display: flex;
+ align-items: center;
+ gap: 2rem;
+ margin-bottom: 2rem;
+
+ &__information {
+ display: flex;
+ //width: 100%;
+ margin-right: 1rem;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ gap: 0.5rem;
+ }
+ & figure {
+ display: inline;
+ & img {
+ height: 128px;
+ border-radius: 32px;
+ box-shadow: 0px 0px 50px -20px rgba(0,0,0,0.75);
+ }
+ }
+ & h2, p {
+ display: inline;
+ }
+}
+
+.links {
+ display: flex;
+ margin-top: 2rem;
+ width: 100%;
+ gap: 1rem;
+ & .link {
+ display: block;
+ background: purple;
+ width: 33%;
+ padding: 1em;
+ border-radius: 16px;
+ }
+ & a {
+ display: block;
+ color: black;
+ text-decoration: none;
+ text-align: center;
+ }
+}
diff --git a/templates/base/base.gohtml b/templates/base/base.gohtml
index 5859805..f8c6678 100644
--- a/templates/base/base.gohtml
+++ b/templates/base/base.gohtml
@@ -10,7 +10,7 @@
{{template "opengraph-base" .SEO}}
</head>
<body>
- {{template "body" .}}
+ {{template "body" .Data}}
<script type="module" src="{{getAssetPath "index.js"}}" defer></script>
</body>
</html>
diff --git a/templates/page/index.gohtml b/templates/page/index.gohtml
index dbc228a..390ca7b 100644
--- a/templates/page/index.gohtml
+++ b/templates/page/index.gohtml
@@ -4,9 +4,16 @@
<figure>
<img src="{{ getStaticPath .Person.Image }}" alt="{{ .Person.Name }}'s image">
</figure>
- <h2>{{ .Person.Name }}</h2>
- <p>{{ .Person.Pronouns }}</p>
+ <div class="presentation__information">
+ <h2>{{ .Person.Name }}</h2>
+ <p>{{ .Person.Pronouns }}</p>
+ </div>
</div>
<p class="description">{{ .Description }}</p>
+ <div class="links">
+ <div class="link"><a href="">Link 1</a></div>
+ <div class="link"><a href="">Link 2</a></div>
+ <div class="link"><a href="">Link 3</a></div>
+ </div>
</main>
{{end}} \ No newline at end of file