This project demonstrates a reusable feedback widget library for Val Town projects.
feedbackWidget.ts into your projectimport { renderFeedbackWidget, handleFeedbackSubmission } from "./feedbackWidget.ts";
// Add to your HTML template
const html = `
<body>
<!-- Your content -->
${renderFeedbackWidget()}
</body>
`;
// Add feedback route
app.post("/feedback", async (c) => {
return await handleFeedbackSubmission(c.req.raw, import.meta.url);
});
feedback.md file in your project rootThat's it! Users can now submit feedback through the widget.
feedbackWidget.ts - The reusable widget libraryindex.ts - Demo implementationfeedback.md - Where feedback gets storedREADME.md - This fileVisit the live demo to see the widget in action: Demo Link
The widget can be easily customized by modifying the CSS in feedbackWidget.ts. Change colors, positioning, animations, and more to fit your project's design.