Make Posts id autoincrement, make working posts page on home which shows the pumpkins and comment, reduce bloat by making a lightbtn setup function, fix XSS

This commit is contained in:
csd4ni3l
2025-10-24 18:01:50 +02:00
parent ed274a24e4
commit ab44901dc0
4 changed files with 78 additions and 42 deletions

View File

@@ -90,18 +90,7 @@ img.addEventListener('load', function() {
setInterval(update, 1500);
});
let lit = false;
document.getElementById("lightBtn").addEventListener('click', function(event) {
if (lit) {
lit = false;
unlight_pumpkin(ctx, CELL_SIZE, pattern.slice(0, pattern.length - last_days));
}
else {
lit = true;
light_pumpkin(ctx, CELL_SIZE, pattern.slice(0, pattern.length - last_days));
}
});
setup_lightbtn(ctx, CELL_SIZE, "lightBtn", pattern.slice(0, pattern.length - last_days));
</script>
{% endblock body %}