1
0
mirror of https://github.com/JustKato/FreePad.git synced 2026-02-23 15:50:46 +02:00

Started working on V2 rework

This commit is contained in:
2022-05-18 22:54:07 +03:00
parent 2d7d6a2f8b
commit 89eaceddcc
57 changed files with 22 additions and 680 deletions

View File

@@ -0,0 +1,42 @@
{{ template "inc/header.html" .}}
<body>
<div class="container is-fullhd p-4 mb-6" style="min-height: 50rem; height: calc(100vh - 18rem)">
<h1 class="title">FreePad</h1>
<h2 class="subtitle">Free and Open source internet notepad</h2>
<hr class="mb-6">
<div class="content">
<form class="columns px-4 mt-6" onsubmit="goToPost(); return false;">
<span class="mt-2 is-size-4" style="font-family: monospace">{{.domain_base}}/</span>
<input class="mt-2 input mr-4" type="text" name="postName" id="postName" style="font-family: monospace" placeholder="Something memorable">
<button class="mt-2 button" type="submit">Open</button>
</form>
</div>
<div class="content my-4">
<h3>Why FreePad</h3>
<p>Why should you use FreePad and not some other provider?</p>
<ol>
<li style="list-style-type: none;">Keep it simple 😎</li>
<li style="list-style-type: none;">Don't worry about passwords 📔</li>
<li style="list-style-type: none;">You can be a mess, it's all temporary 🗑</li>
<li style="list-style-type: none;">Quick and Clean 🧼</li>
</ol>
</div>
<div class="content my-6">
<h3>Some Rules</h3>
<p>FreePad has an API and you can use it to interact with it, although there are some limitations.</p>
<ol>
<li>You are going to be rate-limited if you spam too much and put on a cooldown</li>
<li>There's only so many pages that can be stored before affecting performance</li>
<li>Automatic Shadowbanning</li>
</ol>
</div>
</div>
{{ template "inc/footer.html" .}}
</body>

55
templates/pages/page.html Normal file
View File

@@ -0,0 +1,55 @@
{{ template "inc/header.html" .}}
<style>
.qrImage[src=""] {
display: none;
}
</style>
<body>
<div class="container is-fullhd p-4 mb-6" style="min-height: 35rem; height: calc(100vh - 18rem)">
<h1 class="title">FreePad</h1>
<img class="qrImage" src="" alt="" style="position: fixed;top: 1rem;left: 1rem;max-width: 13vw;">
<h2 class="subtitle">Reading from <code>{{.domain_base}}/{{.title}}</code></h2>
<hr>
<div class="content">
<div class="block">
<a href="/" class="button is-light">Back Home</a>
<a href="javascript:fetchMyQr()" class="button is-primary">QR</a>
<a href="javascript:updateSelf()" class="button is-success">Save</a>
<p class="mt-3">Status: <code class="has-text-primary" id="status-indicator">Loaded</code></p>
</div>
<textarea class="input" name="post_content" id="post_content" onchange="updateSelf()">{{.post_content}}</textarea>
</div>
</div>
<script>
async function fetchMyQr() {
let qrCode = await getQr(window.location.href)
.catch( err => {
console.error(err);
})
console.log(qrCode);
if ( !!qrCode.qr ) {
document.querySelectorAll(`.qrImage`).forEach( img => {
console.log(img);
console.log(qrCode.qr);
img.src = qrCode.qr;
})
}
}
function updateSelf() {
updatePost({{.title}})
}
</script>
{{ template "inc/footer.html" .}}
</body>
<script src="https://raw.githubusercontent.com/scotch-io/javascript-modal/master/Modal.js"></script>