start o stuff

This commit is contained in:
conzer 2024-12-07 19:46:49 -05:00
parent 08f8693e8d
commit 28db0fa9c3
5 changed files with 96 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/frontend/node_modules

32
frontend/index.html Normal file
View file

@ -0,0 +1,32 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>gobin</title>
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.css">
</head>
<body>
<div class="container mt-5">
<h1 class="text-center">gobin</h1>
<p class="text-center">A minimal and speedy markdown pastebin software, written in Go.</p>
<p class="text-center glowy"><a href="about.html">about</a></p>
<div id="posts" class="my-5"></div>
<h2>add a new post</h2>
<form id="postform">
<div class="mb-3">
<label for="title" class="form-label">post title</label>
<input type="text" class="form-control" id="title" placeholder="sunshine, lollypops, and rainbows everything" required>
</div>
<div class="mb-3">
<label for="content" class="form-label">post content</label>
<textarea class="form-control" id="content" rows="5" placeholder="my cat fluffy just had his best day ever. we took him to get a pup cup.." required></textarea>
</div>
<button type="submit" class="btn btn-primary">submit post</button>
</form>
</div>
<script src="node_modules/bootstrap/dist/js/bootstrap.bundle.js"></script>
<script src="js/main.js"></script>
</body>
</html>

5
frontend/js/main.js Normal file
View file

@ -0,0 +1,5 @@
function fetchPosts() {
fetch('/posts', {
headers: { 'Content-Type': 'application/json' }
})
}

44
frontend/package-lock.json generated Normal file
View file

@ -0,0 +1,44 @@
{
"name": "frontend",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "frontend",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"bootstrap": "^5.3.3"
}
},
"node_modules/@popperjs/core": {
"version": "2.11.8",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
"integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==",
"peer": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/popperjs"
}
},
"node_modules/bootstrap": {
"version": "5.3.3",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.3.tgz",
"integrity": "sha512-8HLCdWgyoMguSO9o+aH+iuZ+aht+mzW0u3HIMzVu7Srrpv7EBBxTnrFlSCskwdY1+EOFQSm7uMJhNQHkdPcmjg==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/twbs"
},
{
"type": "opencollective",
"url": "https://opencollective.com/bootstrap"
}
],
"peerDependencies": {
"@popperjs/core": "^2.11.8"
}
}
}
}

14
frontend/package.json Normal file
View file

@ -0,0 +1,14 @@
{
"name": "frontend",
"version": "1.0.0",
"description": "Frontend for goblog",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"bootstrap": "^5.3.3"
}
}