Exemplo n.º 1
0
from epyk.core.Page import Report
from epyk.core.css.themes import ThemeBlue


# Create a basic report object
page = Report()
page.headers.dev()
page.verbose = True # Display the system logs
page.theme = ThemeBlue.BlueGrey()
page.body.add_template(defined_style="doc")

# Create an input text field.
input = page.ui.input(placeholder="Write your text and press show")
number = page.ui.input(placeholder="Write a number and press show (Xs)")

# Define the popup object.
danger = page.ui.network.warning()
danger.options.time = None
danger.options.close = False

# Button to display the popup.
button1 = page.ui.button("Show")
button1.click([
  danger.build(input.dom.content)
])

# Button to display the popup with a timer.
button2 = page.ui.button("Show (Xs)")
danger.options.config_js({"time": number.dom.content})
print("ok")
Exemplo n.º 2
0
from epyk.core.Page import Report

page = Report()
page.headers.dev()

page.verbose = True

path = page.ui.input(placeholder="Set your path here")

qrcode = page.ui.qrcode()

# Change the qrcode options
qrcode.options.colorDark = "orange"
qrcode.options.size = 50

path.enter([qrcode.build(path.dom.content)])

button = page.ui.button("Google QRCode")
button.click([qrcode.js.makeCode("https://www.google.com/")])

button = page.ui.button("Clear")
button.click([qrcode.js.clear()])