Hacker News new | ask | show | jobs
Show HN: I made an open source desktop magnifier for demo and presentations (github.com)
6 points by Herobrine2084 1148 days ago
I wanted a cool magnifier for my presentations, but couldn't find one (the default windows one was not really usable for my case)

So I built one using Vue and Tauri (weird stack for such a tool, huh?). It was a pretty fun little project, hope you guys can have some use.

Here's how it works:

- When you press the shortcut, it takes a screenshot and store it in a temp folder

- It then displays an HTML window and passes the screenshot URL to it

- The HTML window has no "decorations" (top bar) and only contains an empty div

- This div uses the screenshot as a background and updates the background position based on the cursor location

- The window location is also updated according to the cursor location using a requestAnimationFrame (so that it does not get triggered too often)

- The wheel event impacts the size of the window, as well as a transform:scale on the background.

1 comments

That's very inefficient, on top of questionable tech stack

Why would you store the screenshot to disk, just grab what ever the compositor gives you and render it on a texture, skipping the whole disk write usage

https://blogs.windows.com/windowsdeveloper/2019/09/16/new-wa...

It's similar for both macOS and X11 (haven't looked at wayland yet)

I thought it will be fun to do this with this tech stack, and I didn't want to spend an entire week for a magnifier. It's also cool to see what you can build with a web stack!

I'm not sure why this would be so inefficient, as the screenshot is only taken once when the magnifier is activated. In fact, I don't think we care about efficiency at all for this kind of little tool.

But thanks a lot for the link, that's super interesting, and they included a "ExcludeFromCapture" which would have been very convenient! I'll have a look how if I can integrate this into a Tauri backend!

Oh right, I thought you were taking a screenshot every frames, I was wrong sry