|
@@ -190,7 +190,7 @@ You can add Scalable Vector Graphics using the `ui.html` element.
|
|
|
|
|
|
@example(ui.image)
|
|
@example(ui.image)
|
|
def image_example():
|
|
def image_example():
|
|
- ui.image('http://placeimg.com/640/360/tech')
|
|
|
|
|
|
+ ui.image('https://picsum.photos/id/377/640/360')
|
|
|
|
|
|
@example('''#### Captions and Overlays
|
|
@example('''#### Captions and Overlays
|
|
|
|
|
|
@@ -200,7 +200,7 @@ Use [Quasar classes](https://quasar.dev/vue-components/img) for positioning and
|
|
To overlay an SVG, make the `viewBox` exactly the size of the image and provide `100%` width/height to match the actual rendered size.
|
|
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_example():
|
|
def captions_and_overlays_example():
|
|
- with ui.image('http://placeimg.com/640/360/nature'):
|
|
|
|
|
|
+ with ui.image('https://picsum.photos/id/29/640/360'):
|
|
ui.label('Nice!').classes('absolute-bottom text-subtitle2 text-center')
|
|
ui.label('Nice!').classes('absolute-bottom text-subtitle2 text-center')
|
|
|
|
|
|
with ui.image('https://cdn.stocksnap.io/img-thumbs/960w/airplane-sky_DYPWDEEILG.jpg'):
|
|
with ui.image('https://cdn.stocksnap.io/img-thumbs/960w/airplane-sky_DYPWDEEILG.jpg'):
|
|
@@ -216,10 +216,10 @@ To overlay an SVG, make the `viewBox` exactly the size of the image and provide
|
|
|
|
|
|
def mouse_handler(e: MouseEventArguments):
|
|
def mouse_handler(e: MouseEventArguments):
|
|
color = 'SkyBlue' if e.type == 'mousedown' else 'SteelBlue'
|
|
color = 'SkyBlue' if e.type == 'mousedown' else 'SteelBlue'
|
|
- ii.content += f'<circle cx="{e.image_x}" cy="{e.image_y}" r="20" fill="{color}"/>'
|
|
|
|
|
|
+ ii.content += f'<circle cx="{e.image_x}" cy="{e.image_y}" r="15" fill="none" stroke="{color}" stroke-width="4" />'
|
|
ui.notify(f'{e.type} at ({e.image_x:.1f}, {e.image_y:.1f})')
|
|
ui.notify(f'{e.type} at ({e.image_x:.1f}, {e.image_y:.1f})')
|
|
|
|
|
|
- src = 'https://cdn.stocksnap.io/img-thumbs/960w/corn-cob_YSZZZEC59W.jpg'
|
|
|
|
|
|
+ src = 'https://picsum.photos/id/565/640/360'
|
|
ii = ui.interactive_image(src, on_mouse=mouse_handler, events=['mousedown', 'mouseup'], cross=True)
|
|
ii = ui.interactive_image(src, on_mouse=mouse_handler, events=['mousedown', 'mouseup'], cross=True)
|
|
|
|
|
|
@example(ui.audio)
|
|
@example(ui.audio)
|
|
@@ -370,7 +370,7 @@ To overlay an SVG, make the `viewBox` exactly the size of the image and provide
|
|
@example(ui.card)
|
|
@example(ui.card)
|
|
def card_example():
|
|
def card_example():
|
|
with ui.card().tight() as card:
|
|
with ui.card().tight() as card:
|
|
- ui.image('http://placeimg.com/640/360/nature')
|
|
|
|
|
|
+ ui.image('https://picsum.photos/id/684/640/360')
|
|
with ui.card_section():
|
|
with ui.card_section():
|
|
ui.label('Lorem ipsum dolor sit amet, consectetur adipiscing elit, ...')
|
|
ui.label('Lorem ipsum dolor sit amet, consectetur adipiscing elit, ...')
|
|
|
|
|