Website/Demo: 🎆 https://xemantic.github.io/openrndr-js 🎇
ℹ️ Here is the code behind the Demo with lots of comments which might be useful for someone coming from from the JavaScript ecosystem.
TL;RD this is a template GitHub project, so you can just start a new repository from this one.
Not absolutely necessary, but highly recommended as the IDE is tailored to the whole toolchain. Open source IntelliJ IDEA Community Edition should be good enough.
Just click the green "Use this template" button above and then clone your fresh repository.
$ cd your-repository-name
$ ./gradlew run --continous
It will open your web app's index.html in the browser and any changes to the Kotlin code will refresh the page automatically.
ℹ️ You can also run it from IntelliJ IDEA.
Just do some edits in src/main/kotlin/client.kt and check the outcome.
If you used this repository as a template, you might consider:
- Changing
rootProject.name
in settings.gradle.kts to the name of your repository.⚠️ the change of generated JS script name in src/main/resources/index.html should follow.
- Changing
group
in build.gradle.ks to something reflecting your organization - You can uncomment additional futures you want to use in build.gradle.ks
Go through the source code. I tried to document it a lot for providing all the necessary context. For the overview of Kotlin JS check:
https://kotlinlang.org/docs/js-overview.html
If you are not familiar with OPENRNDR thant look at the Guide:
Check: https://pages.github.com/
If you used this project as a template for your own GitHub repository, then go to the Settings
and enable GitHub pages with docs
folder as root. Then every time you successfully run:
$ ./gradlew build
It will also populate the docs
folder with all the compiled web resources.