是否有任何 HTML5 UI 框架可以渲染到画布而不是使用 HTML 元素?

发布于 2024-12-10 20:10:16 字数 164 浏览 0 评论 0原文

我意识到有些人认为在基于画布的框架中重新实现 HTML 的所有 UI 功能是疯狂的(并且有一些 stackoverflow 问题表明了这一点),但是真的有人在开发这样的库吗?

澄清一下,该库将直接在画布上渲染所有 UI 元素,如编辑框、标签、按钮、组合框、列表视图等。不会有 HTML 或 CSS。

I realize that some people think it is crazy to re-implement all the UI functionality of HTML in a canvas-based framework (and there are some stackoverflow questions that suggest this), but is anyone actually working on a library like this?

To clarify, the library would render all UI elements like edit boxes, labels, buttons, combo boxes, list views, etc. on the canvas directly. There would be no HTML or CSS.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

仲春光 2024-12-17 20:10:16

我今天偶然发现了这个想法。找到了 Zebra 图书馆。还没试过。

https://zebkit.org/

对于网络应用程序,我认为这非常有意义。 HTML/CSS 还不足以轻松创建稳定的应用程序。 DOM 和布局太古怪,而且性能太低。

我们需要的是类似 Silverlight 的东西,但没有插件。稳定的组件和出色的框架。

Canvas 应用程序可以像 html Web 应用程序一样易于访问。或许更是如此。

也许WebGL更好,如果做得好的话,它的性能肯定比Canvas更好。

I stumbled upon this idea today. Found the library Zebra. Haven't tried it out yet.

https://zebkit.org/

For web apps I think this makes perfect sense. HTML/CSS is just not good enough to create stable apps easily. The DOM and layouts are just too quirky and the performance too low.

What we need is something like Silverlight but without the plugin. Stable components and a great framework.

Canvas apps could be made just as accessible as html web apps. Probably more so even.

Perhaps WebGL is even better, its performance is definitely better than Canvas if done properly.

九八野马 2024-12-17 20:10:16

Thunderhead 是与 bespin(现为 Skywriter)一起构建的 Mozilla 实验。

从项目描述来看:

Thunderhead 是 Mozilla Labs 的一项实验,旨在探索基于 JavaScript 的
GUI 工具包,可使用 DOM 元素和画布进行渲染
组件。

问题在于可访问性,而画布则不然。

Thunderhead was a mozilla experiment built along with bespin (now skywriter).

From the project description:

Thunderhead is a Mozilla Labs experiment to explore a JavaScript-based
GUI toolkit that works with DOM elements and canvas to render
components.

The problem is accessibility, canvas just isn't.

那小子欠揍 2024-12-17 20:10:16

我今天刚刚查看了 zebkit.com。令人惊奇而且绝对不是疯狂的,而是必不可少的。尝试在移动设备上运行大多数 DOM 节点树,您很快就会知道这是真的。相比之下,运行 Zebkit 厨房水槽演示就会感到震惊。您可能必须重新考虑您的项目方法。

从 Java 到 HTML5,我确实在 Zebkit API 中看到了一些很好的 OOP,它需要为简单的画布提供一些强大的结构。另外,我真的很喜欢 JSON 支持,它的作用很像画布的 CSS 格式。以这种方式使用 JSON 非常适合 Web 组件思维方式和 HTML 部分的实用性。这个 API 有很多好处。

最终,所有为 Web 生成图形的方法都会渲染像素。也许我们刚刚在要生成的逻辑和最终屏幕之间添加了许多抽象来实现这一事实。使用 Zebkit 感觉就像您几乎在本机级别工作,而且它添加了 Javascript 和 JSON 的所有优点,确实很不错。另外,您还可以根据需要在 DOM 中自由混合和匹配。

I've just reviewed zebkit.com today. Amazing and absolutely not crazy, rather essential. Try running most DOM node trees on a mobile device and you will soon know this is true. Then in contrast run the Zebkit kitchen sink demo and be shocked. You might have to reconsider your projects approach.

Coming from Java to HTML5 I definitely see some nice OOP at play in the Zebkit API, it is needed to provide the simple canvas some powerful structure. Also I really like the JSON support, it acts much like a CSS format for the canvas. Using JSON this way fits well into the Web Component mindset and the practicality of HTML partials. There are a lot of goodies in this API.

In the end all ways of producing graphics for the Web render pixels anyways. Maybe we have just added to many abstractions between the logic we what to produce and the end screen to realize this fact. With Zebkit it feels like your almost working at the native level, plus it adds in all the graces of Javascript and JSON, sweet indeed. Plus your free to mix and match in DOM as desired.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文