rawpython / remi

Python REMote Interface library. Platform independent. In about 100 Kbytes, perfect for your diet.
Apache License 2.0
3.48k stars 401 forks source link

how to support js scripts in remi framework #463

Closed yaochx closed 2 years ago

yaochx commented 2 years ago

I haw few dev experience on web ui, here's a probing question. Is it possible to insert the following code in remi gui, or how to support js scripts in remi framework?

    <div class="wrapper">
      <section class="main-controls">
        <canvas class="visualizer" height="60px"></canvas>
        <div id="buttons">
          <button class="record">Record</button>
          <button class="stop">Stop</button>
        </div>
      </section>

      <section class="sound-clips">
      </section>

    </div>

    <script src="scripts/app.js"></script>

scripts/app.js

I'm finding solutions to use js code to record audio in remi demo

Thanks in advanced

dddomodossola commented 2 years ago

Hello @yaochx ,

In the example script "template_advanced_app.py" https://github.com/dddomodossola/remi/blob/master/examples/template_advanced_app.py you can find a section to append custom css and js:

    def main(self):
        #custom additional html head tags
        my_html_head = """
            """

        #custom css
        my_css_head = """
            <link rel="stylesheet" href="" type="text/css">
            """

        #custom js
        my_js_head = """
            <script></script>
            """

Here you can add custom js code or a link to js files. ;-)

Kind Regards.

yaochx commented 2 years ago

Many thanks to @dddomodossola I will have a try