Profile picture frontend + backend

This commit is contained in:
2024-05-03 20:22:58 +02:00
parent 76cd92ee0e
commit 59818eb321
9 changed files with 234 additions and 135 deletions

View File

@@ -187,9 +187,11 @@ export default class API {
return res;
}
async uploadPicture(file, scale=1.0) {
async uploadPicture(file, size, x = 0, y = 0) {
const formData = new FormData();
formData.append("scale", scale);
formData.append("size", size);
formData.append("x", x);
formData.append("y", y);
formData.append("picture", file, file.name);
let res = await this.apiCall("user/uploadPicture", formData);
if (res.success) {

View File

@@ -13,6 +13,8 @@ const PicturePlaceholderBox = styled(Box)((props) => ({
alignItems: "center",
background: "radial-gradient(circle closest-side, gray 98%, transparent 100%);",
containerType: "inline-size",
width: "100%",
height: "100%",
"& > span": {
textAlign: "center",
fontSize: "30cqw",