p5.js-web-editor
p5.js-web-editor copied to clipboard
Change text size based on if computer is desktop or laptop
Hi! I think that it there should be a feature where depending on if you have a laptop or pc change the text size, I've tested this code snippet: navigator.getBattery().then(function(battery) { if (battery.charging && battery.chargingTime === 0) { console.log("I'm a desktop") } else { console.log("I'm not a desktop") } }); and it works! Maybe someone can add this in!
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.
We can already change the font size in the settings, but in what situations do we need this feature?
Well sometimes I need to work on a laptop but I don't want to have to change the font setting because I have to change it back when I'm on desktop, so maybe there could be a setting for default laptop text size and default desktop font size. But I realized if the laptop is charged to 100% the code snippet will say it's a desktop and, I don't know how to fix that, so maybe someone else can fix it?
Oh, I almost forgot, the code snippet I gave you is from StackOverFlow here's the link to it,: https://stackoverflow.com/questions/42596664/detect-whether-client-system-is-laptop-or-desktop-using-javascript