1 day ago · Tech · hide · 0 comments

I'm in the middle of a lot of experimenting and improving things with Astro, so I added a like button to my posts. My idea is to copy the like button policy from Bear Blog, which I really like. Basically: you can like, but you can't unlike. If you liked something by accident, sorry, there's nothing you can do. No refunds. I don't want to get into the technical details of how the logic was implemented, but I do want to show how the visual part works. I wanted some confetti to appear when someone clicked the like button, so I installed canvas-confetti, a very popular npm package. It works really well and is very configurable. At first, I made the animation appear only the first time you clicked the button (when you didn't have a like yet and then gave one). But that felt a little boring. I want people to be able to click it several times. One click = one reward. Then I thought confetti didn't really match the idea of a like. A heart felt much better. Luckily, the same package lets you…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.