feat(style): simple card

This commit is contained in:
Anhgelus Morhtuuzh 2024-11-09 22:49:17 +01:00
parent f616d8f24e
commit 892858567f
No known key found for this signature in database
GPG key ID: CAD341EFA92DDDE5
8 changed files with 235 additions and 9 deletions

BIN
bun.lockb

Binary file not shown.

131
dist/styles.css vendored
View file

@ -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 */

View file

@ -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"
}
}

12
main.go
View file

@ -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")
}

View file

@ -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"
}
}

74
scss/main.scss Normal file
View file

@ -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;
}
}

View file

@ -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>

View file

@ -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}}