keep working on the like button

This commit is contained in:
2026-07-20 19:02:04 +10:00
parent 7d0727a7aa
commit 6241824960
9 changed files with 67 additions and 4 deletions

View File

@@ -4,6 +4,7 @@
<title>posts</title>
<link rel="stylesheet" type="text/css" href="/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/script.js"></script>
</head>
<body>
<div class="postbox">

15
client/script.js Normal file
View File

@@ -0,0 +1,15 @@
function like(id) {
const usernameBox = document.getElementById('username');
const passwordBox = document.getElementById('password');
const formData = new FormData();
formData.append('username', usernameBox.value);
formData.append('password', passwordBox.value);
formData.append('post', id);
fetch('/like', {
method: 'POST',
body: formData
});
}

View File

@@ -55,6 +55,11 @@ img {
box-sizing: border-box;
}
.post-buttons {
display: flex;
gap: 5px;
}
@media (max-width: 600px) {
input, textarea, button {
font-size: 16px;