from nicegui import ui
from . import (
audio_documentation,
avatar_documentation,
doc,
icon_documentation,
image_documentation,
interactive_image_documentation,
video_documentation,
)
doc.title('*Audiovisual* Elements')
doc.intro(image_documentation)
@doc.demo('Captions and Overlays', '''
By nesting elements inside a `ui.image` you can create augmentations.
Use [Quasar classes](https://quasar.dev/vue-components/img) for positioning and styling captions.
To overlay an SVG, make the `viewBox` exactly the size of the image and provide `100%` width/height to match the actual rendered size.
''')
def captions_and_overlays_demo():
with ui.image('https://picsum.photos/id/29/640/360'):
ui.label('Nice!').classes('absolute-bottom text-subtitle2 text-center')
with ui.image('https://cdn.stocksnap.io/img-thumbs/960w/airplane-sky_DYPWDEEILG.jpg'):
ui.html('''
''').classes('w-full bg-transparent')
doc.intro(interactive_image_documentation)
doc.intro(audio_documentation)
doc.intro(video_documentation)
doc.intro(icon_documentation)
doc.intro(avatar_documentation)
@doc.demo('SVG', '''
You can add Scalable Vector Graphics using the `ui.html` element.
''')
def svg_demo():
content = '''
'''
ui.html(content)