File: script.py

package info (click to toggle)
python-trame-client 3.11.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,128 kB
  • sloc: python: 9,609; javascript: 3,897; sh: 9; makefile: 6
file content (16 lines) | stat: -rw-r--r-- 387 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from trame.app import get_server
from trame.widgets import html, client
from trame.ui.html import DivLayout

server = get_server()

JS_CONTENT = (
    "import confetti from 'https://esm.sh/canvas-confetti';"
    "trame.utils.confetti = confetti;"
)

with DivLayout(server):
    html.Button("Click Me", click="utils.confetti()")
    client.Script(JS_CONTENT, module=True)

server.start()