Make it look spooky and halloween themed, delete all posts from user when deleting account and change post usernames when changing username

This commit is contained in:
csd4ni3l
2025-10-25 15:29:08 +02:00
parent 1280d805d6
commit 5942061b16
4 changed files with 50 additions and 4 deletions

2
app.py
View File

@@ -192,6 +192,7 @@ def change_username():
cur = get_db().cursor()
cur.execute("UPDATE Users SET username = ? WHERE username = ?", (new_username, username))
cur.execute("UPDATE Posts SET username = ? WHERE username = ?", (new_username, username))
get_db().commit()
cur.close()
@@ -234,6 +235,7 @@ def delete_account():
cur = get_db().cursor()
cur.execute("DELETE FROM Users WHERE username = ?", (username,))
cur.execute("DELETE FROM Posts WHERE username = ?", (username,))
get_db().commit()
cur.close()

View File

@@ -8,12 +8,42 @@
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
<script src="/static/pumpkin.js"></script>
<title>{% block title %} {% endblock %}</title>
<style>
.spider-web-1 {
position: fixed;
top: 0;
right: 0;
width: 100px;
height: 100px;
opacity: 0.3;
pointer-events: none;
z-index: 1;
}
.spider-web-2 {
position: fixed;
left: 0;
bottom: 0;
width: 100px;
height: 100px;
opacity: 0.3;
pointer-events: none;
z-index: 1;
}
* {
font-family: 'Creepster', cursive !important;
}
body {
background: linear-gradient(135deg, #0d0618 0%, #1a0b2e 50%, #2d1b4e 100%);
}
</style>
<link href="https://fonts.googleapis.com/css2?family=Creepster&display=swap" rel="stylesheet">
{% block head %} {% endblock %}
</head>
<body>
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<a class="navbar-brand" href="/">LoginWeen</a>
<a class="navbar-brand" href="/" style="font-size: 2rem; font-family: 'Creepster', cursive; color: orange;">🎃 LoginWeen</a>
<button class="navbar-toggler" type="button", data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
@@ -27,6 +57,20 @@
</div>
</div>
</nav>
<svg class="spider-web-1" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<path d="M100,10 L100,190 M10,100 L190,100 M30,30 L170,170 M170,30 L30,170" stroke="white" stroke-width="2" fill="none"/>
<circle cx="100" cy="100" r="20" stroke="white" stroke-width="2" fill="none"/>
<circle cx="100" cy="100" r="40" stroke="white" stroke-width="2" fill="none"/>
<circle cx="100" cy="100" r="60" stroke="white" stroke-width="2" fill="none"/>
<circle cx="100" cy="100" r="80" stroke="white" stroke-width="2" fill="none"/>
</svg>
<svg class="spider-web-2" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<path d="M100,10 L100,190 M10,100 L190,100 M30,30 L170,170 M170,30 L30,170" stroke="white" stroke-width="2" fill="none"/>
<circle cx="100" cy="100" r="20" stroke="white" stroke-width="2" fill="none"/>
<circle cx="100" cy="100" r="40" stroke="white" stroke-width="2" fill="none"/>
<circle cx="100" cy="100" r="60" stroke="white" stroke-width="2" fill="none"/>
<circle cx="100" cy="100" r="80" stroke="white" stroke-width="2" fill="none"/>
</svg>
{% block body %}
{% endblock %}
</body>

View File

@@ -35,7 +35,7 @@
{% block body %}
<div class="position-absolute top-50 start-50 translate-middle text-center">
<h1 id="halloween_countdown">Time to next Halloween: Loading...</h1>
<h1 id="halloween_countdown" style="color: orange;">Time to next Halloween: Loading...</h1>
<div class="mt-3"></div>
<h3 id="visualization_info">Carved Pumpkin Countdown Visualization (last ? days to Halloween):</h3>
<canvas id="pumpkin_canvas" width="600" height="600"></canvas>

View File

@@ -19,7 +19,7 @@
{% block body %}
<div class="text-center mt-3">
<h1>Posts</h1>
<h1 style="color: orange;">Posts</h1>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#createPostModal">Create a post</button>
</div>
<div class="container mt-4">
@@ -43,7 +43,7 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="createPostModalLabel">Create a post</h1>
<h1 class="modal-title fs-5" id="createPostModalLabel" style="color: orange;">Create a post</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<form id="modal-form" method="POST">