Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support embedding (web component, easier iframing, etc) #78

Open
ochafik opened this issue Dec 24, 2024 · 2 comments
Open

Support embedding (web component, easier iframing, etc) #78

ochafik opened this issue Dec 24, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ochafik
Copy link
Collaborator

ochafik commented Dec 24, 2024

Some potential use cases (suggestions highly welcome!):

<openscad-playground code="cube([10, 10, 10]);"></openscad-playground>

<openscad-playground>
  cube([10, 10, 10]);
</openscad-playground>

<script type="openscad">
  cube([10, 10, 10]);
</script>
@ochafik ochafik changed the title Support embedding (web component, etc) Support embedding (web component, easier iframing, etc) Dec 24, 2024
@ochafik ochafik added the enhancement New feature or request label Dec 24, 2024
@pks5
Copy link

pks5 commented Dec 24, 2024

I think it would be nice to integrate it as web component, like your 2nd

<openscad-playground export-format="stl" theme-color="#ff0000" visible-panes="edit view" customizer-values="myVar: 45; myOtherVar:'Hello, World!';">
myVar = 12;
myOtherVar = 'Hi!';
cube([myVar, 10, 10]);
</openscad-playground>

Here are some ideas:

  • Property to refer to an existing script inside a library which was integrated via Make
  • Property to set the primary color of the theme so it integrates seamlessly to the surrounding page
  • Property to set the preferred export format
  • Property to specify a list of customizer default values, that are used to prefill the customize pane
  • Property to set the visible panes (edit, view, customize)

@pks5
Copy link

pks5 commented Dec 25, 2024

It would be also nice to be able to read information from the playground in real time, such as currently open file, currently visible tabs, current set of customizer variables.

Even without implementing a web component, there could be a frame message api so we can communicate with the playground via frame messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants