Script Preview Mode

When script preview is useful?

Script preview links allow you and the users of your scripts to see the script in action without the need to open the editor. Preview mode will run your code in full-screen. There will be no logo or menu visible from bitbybit.dev. We do not want to interfere with the experience you are trying to achieve. This is useful when you want to share your script with someone who is not familiar with our platform or when you want to embed the script in your website. You can also use this feature to test your script before you export it to a file.

Be aware that preview links run your code immediately and if computations take a long time to complete, the user might be waiting and thinking that something is wrong. That is why it is a good practice to construct some kind of 3D loading indicator or 2D GUI (currently only available to TypeScript users) that will show the user that the script is running and that he or she should wait.

Also be aware that some scripts might consume a lot of memory and mobile browsers might crash when running them. If you are targeting mobile devices, make sure to test your script on them before sharing it with others.

Preview links for general public

If you just browse our website and you open our public projects gallery you can click on a project that you find interesing. This opens project details page. If you want to preview one of the scripts you can do that by clicking the "Preview" button marked with an eye icon. This will redirect you to the url with a chosen script running in full-screen mode. Url bar will contain your preview link. Check the image below where to find it:

Image showing the button  to preview the script in publically shared project

Button to preview the script in publically shared project

Preview links for authors of the projects

Any public project url can be used in a preview mode by adding "/preview" to the end of the url. For example, if your project url with an editor is:

https://bitbybit.dev/app/matas/5ZiDeL9V4tKAL7WADhXJ/QeNwwFOcSZd8ivftxYFu?editor=rete

Transform it into this:

https://bitbybit.dev/app/matas/5ZiDeL9V4tKAL7WADhXJ/QeNwwFOcSZd8ivftxYFu/preview

Copy and paste this url in the browser tab and you will see the script running in full-screen mode. You can also use the "Preview" button in the project management menu to get the same result. This button will open an new tab in your browser. Url bar will contain your preview link. Keep in mind that in order to share this link with others your project MUST be published. Otherwise preview link will only work for you. Check the image below where to find it:

Image showing the menu button to open the script in preview mode

Menu button to open the script in preview mode

Scripts embedded below demonstrate you the difference between the editor and preview mode.

Rete

Editor mode example

Rete

Preview mode example