change reload link, make so you can't submit when empty
This commit is contained in:
parent
d9987124c7
commit
d50372b246
1 changed files with 13 additions and 7 deletions
20
index.php
20
index.php
|
@ -38,7 +38,7 @@
|
||||||
width: calc(100% - 140px);
|
width: calc(100% - 140px);
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type=submit] {
|
#submit-input {
|
||||||
width: 100%; /* so that it's not so close to clear, might think of a better solution later */
|
width: 100%; /* so that it's not so close to clear, might think of a better solution later */
|
||||||
float: right;
|
float: right;
|
||||||
background: var(--accent);
|
background: var(--accent);
|
||||||
|
@ -150,7 +150,7 @@
|
||||||
<input id="image-bits" type="text" name="image-bits">
|
<input id="image-bits" type="text" name="image-bits">
|
||||||
|
|
||||||
Signature (optional): <input id="signature-input" onchange="logSignature();" type="text" name="signature">
|
Signature (optional): <input id="signature-input" onchange="logSignature();" type="text" name="signature">
|
||||||
<input type="submit" value="Farp it">
|
<input id="submit-input" type="submit" value="Farp it">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<span style="font-size: 12px; color: grey;">Privacy Policy: The only data collected by furpsocial server-side is the contents of your posts (drawing and signature). This information is stored in our secure databases which are wiped of all post data every week. This data is only used to accomodate furpsocial as an oekaki-sharing platform. Client-side, furpsocial stores your most recently used signature as a cookie, which persists for one day before expiring.</span>
|
<span style="font-size: 12px; color: grey;">Privacy Policy: The only data collected by furpsocial server-side is the contents of your posts (drawing and signature). This information is stored in our secure databases which are wiped of all post data every week. This data is only used to accomodate furpsocial as an oekaki-sharing platform. Client-side, furpsocial stores your most recently used signature as a cookie, which persists for one day before expiring.</span>
|
||||||
|
@ -161,6 +161,8 @@
|
||||||
const bits = document.getElementById("image-bits");
|
const bits = document.getElementById("image-bits");
|
||||||
const ctx = canvas.getContext("2d");
|
const ctx = canvas.getContext("2d");
|
||||||
|
|
||||||
|
const submit = document.getElementById("submit-input");
|
||||||
|
|
||||||
// tools
|
// tools
|
||||||
var currentTool;
|
var currentTool;
|
||||||
|
|
||||||
|
@ -176,10 +178,13 @@
|
||||||
}
|
}
|
||||||
const eraserButton = document.getElementById("eraser-button");
|
const eraserButton = document.getElementById("eraser-button");
|
||||||
|
|
||||||
var drawing = false;
|
var isDrawing = false;
|
||||||
canvas.onmousedown = function() { drawing = true; }
|
canvas.onmousedown = function() {
|
||||||
|
submit.disabled = false;
|
||||||
|
isDrawing = true;
|
||||||
|
}
|
||||||
document.onmouseup = function() {
|
document.onmouseup = function() {
|
||||||
drawing = false;
|
isDrawing = false;
|
||||||
// write image-bits for posting
|
// write image-bits for posting
|
||||||
let canvasData = ctx.getImageData(0, 0, 128, 64);
|
let canvasData = ctx.getImageData(0, 0, 128, 64);
|
||||||
bits.value = "";
|
bits.value = "";
|
||||||
|
@ -195,7 +200,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
canvas.onmousemove = function() {
|
canvas.onmousemove = function() {
|
||||||
if (drawing) {
|
if (isDrawing) {
|
||||||
draw(window.event);
|
draw(window.event);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -223,6 +228,7 @@
|
||||||
|
|
||||||
function clearCanvas() {
|
function clearCanvas() {
|
||||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||||
|
submit.disabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
setPen();
|
setPen();
|
||||||
|
@ -257,7 +263,7 @@
|
||||||
|
|
||||||
<!-- feed display -->
|
<!-- feed display -->
|
||||||
<h1 class="feed-header">Global Feed</h1>
|
<h1 class="feed-header">Global Feed</h1>
|
||||||
<span class="post" id="refresh" onclick="window.location.href = 'index.php'">refresh feed</span>
|
<span class="post" id="refresh" onclick="window.location.href = 'https://furp.colean.cc'">refresh feed</span>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// ensure the file exists before attempting to read from it
|
// ensure the file exists before attempting to read from it
|
||||||
|
|
Reference in a new issue