hmans / three-elements

Web Components-powered custom HTML elements for building Three.js-powered games and interactive experiences. 🎉
https://three-elements.hmans.co
MIT License
398 stars 14 forks source link

Suggestion: add demo with lit-element #7

Closed daKmoR closed 3 years ago

daKmoR commented 3 years ago

I assume it will be a "just works" 👍

hmans commented 3 years ago

I've seen lit-element, but haven't tried it yet. I think it should just work, yes, just like any other component abstraction on top of custom elements. If I find some time, I will prepare a demo; until then, I'd be happy if someone who is more familiar with lit-element finds the time to experiment with it in a codesandbox.

hmans commented 3 years ago

I've prepared a (simple) example that combines three-elements with lit-element. I did indeed have to make some more changes in order to make things nice, but they're all very sane and actually helped me make my code simpler. Please note that these changes are part of version 0.2.0, which I have not yet published to NPM.

Live demo: https://three-elements-examples.netlify.app/lit-element

Source code: https://github.com/hmans/three-elements/blob/main/examples/lit-element.html

I'm closing this issue for now. Thank you!