4 ms·
I think there is a very easy fix to most HTML/CSS problems when building GUI on the web - use HTML5 canvas. HTML is not a good match for GUI and CSS is not a g
by dmz73 5y ago
I think there is a very easy fix to most HTML/CSS problems when building GUI on the web - use HTML5 canvas.
HTML is not a good match for GUI and CSS is not a good match for...anything.
HTML5 canvas brings you to where Windows/X was 25 years ago so instead of trying to build GUI using TUI, just use the damn GUI already.
Sure, the whole lot of tooling is missing but some copy/paste/fix from either Windows or X should produce better result than S*T ton of HTML/CSS/JS that is currently there attempting (and failing) to emulate Windows/X GUI.
- KronisLV 5y agoThat's not really a fix, though. Flutter is trying to use this approach and if you go to their demo sites you will notice things feeling slightly off: https://gallery.flutter.dev https://gallery.flutter.dev Some of the notable drawbacks: - you can no longer select text on the page, anywhere - right click doesn't work like you'd expect it to, either, since you're looking at a canvas - currently the download sizes are absurdly large, since you need to pack a large amount of functionality in .js/.wasm (over 10 MB, actually) - for simpler pages, the performance overhead will be very noticeable, just try zooming in or out in those pages (i got <2 fps while zooming on a decent desktop computer) - essentially all of the former accessibility benefits of DOM are now gone and screen reader support needs to be developed anew, assuming that they'll even support your canvas based solution - furthermore, learning about websites by inspecting source to see how they did it is no longer possible; and you can no longer crawl these sites in any sort of an automated manner, which may be a good/bad thing depending on how you look at it I'd say that most GUIs should be simple enough to work well with DOM, instead of throwing away decades of progress while chasing niche goals. HTML and CSS are great for displaying all sorts of documents and personally i think that the web should not stray too far from that - utilitarian interfaces that are simple and easy to understand, rather than sci-fi ones like portrayed here: https://www.saji8k.com/kit-fui/movie/ https://www.saji8k.com/kit-fui/movie/
- adwn 5y ago> Some of the notable drawbacks: [...] Wow, that's really, really bad. Thanks for calling attention to that. > currently the download sizes are absurdly large, since you need to pack a large amount of functionality in .js/.wasm (over 10 MB, actually) Just wait till someone uses this to build their desktop-only Electron app.
- michaelcampbell 5y ago> - you can no longer select text on the page, anywhere That's a deal breaker for me.
- robin_reala 5y agoIf you don’t use the DOM you need to reimplement your own accessibility tree and bind that into the access APIs. Or choose to be specifically illegal in a bunch of important markets, and potentially illegal in the US. I’ll just stick with the easy paths.
- blacktriangle 5y agoCanvas doesn't bring you do Windows/X11, Canvas brings you to a basic VESA driver where you're plotting pixels manually. You think the JS framework churn is bad now when all of those frameworks are just layers over HTML, just imagine the world we're looking at if everybody is writing their own full GUI framework to work with canvas. At least with JS framework hell everything is guarenteed to have the same output format that we can then interact with with our common set of HTML tools, with Canvas all bets are off. I get where you're coming from, I really do. HTML5 and CSS are just bad tools for doing GUIs. But there is so much infrastructure built up around them that just overrules any advanage we would get hand rolling a GUI directly rendered to canvas.
- adwn 5y ago> HTML5 and CSS are just bad tools for doing GUIs Is there something better? With Qt Widgets, the poster child for cross-platform GUI toolkits, I also frequently have problems with getting the layout to behave the way I want.
- blacktriangle 5y agoAndroid dev is better, iOS dev is better, heck even Tk layouts are better.
- adwn 5y ago> Android Not cross-platform. > iOS Not cross-platform. > Tk Decreasing mind-share for 2 decades+, not something I'd start a new project with.
- blacktriangle 5y agoCross-platform and being a good tool are orthogonal concepts. We use HTML/CSS for GUIs IN SPITE OF their general unsuitableness because the value of easy distribution wins over developer sanity.
- 5y ago