Add printable guest sign studio and refine event imagery

This commit is contained in:
2026-09-10 09:26:49 -04:00
parent 176b5fa95c
commit 3a115f1161
48 changed files with 1294 additions and 102 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ export const bannersRouter = createTRPCRouter({
if (!limit.allowed) throw new TRPCError({ code: "TOO_MANY_REQUESTS", message: "Too many banner uploads. Try again shortly." });
const id = randomUUID();
const originalKey = `events/${input.eventId}/banners/${id}/original`;
await getDb().insert(eventBanners).values({ id, eventId: input.eventId, originalKey, contentType: input.contentType, byteSize: input.byteSize });
await getDb().insert(eventBanners).values({ id, eventId: input.eventId, originalKey, contentType: input.contentType, byteSize: input.byteSize, crop: input.crop });
return { bannerId: id, uploadUrl: await createPresignedPutUrl({ key: originalKey, contentType: input.contentType }) };
}),
complete: protectedProcedure.input(bannerInputSchema).mutation(async ({ ctx, input }) => {
+14
View File
@@ -0,0 +1,14 @@
import QRCode from "qrcode";
export function signQr(url: string) {
const parsed = new URL(url);
if (!["http:", "https:"].includes(parsed.protocol)) throw new Error("Guest link must be HTTP or HTTPS");
const { modules } = QRCode.create(url, { errorCorrectionLevel: "M" });
let path = "";
for (let y = 0; y < modules.size; y++) {
for (let x = 0; x < modules.size; x++) {
if (modules.get(y, x)) path += `M${x} ${y}h1v1h-1z`;
}
}
return { path, size: modules.size };
}