mirror of
https://github.com/divkit/divkit.git
synced 2026-05-07 20:02:32 +00:00
6164a97c2c
commit_hash:df2050d489f6b90603dc31cb26f40787f0ca916b
326 lines
10 KiB
JSON
326 lines
10 KiB
JSON
{
|
|
"templates": {
|
|
"button": {
|
|
"type": "text",
|
|
"paddings": {
|
|
"left": 16,
|
|
"top": 16,
|
|
"right": 16,
|
|
"bottom": 16
|
|
},
|
|
"margins": {
|
|
"top": 16,
|
|
"left": 12,
|
|
"right": 12
|
|
},
|
|
"border": {
|
|
"corner_radius": 8
|
|
},
|
|
"background": [
|
|
{
|
|
"type": "solid",
|
|
"color": "#0E000000"
|
|
}
|
|
],
|
|
"font_size": 16,
|
|
"font_weight": "medium",
|
|
"text_alignment_vertical": "center",
|
|
"text_alignment_horizontal": "center",
|
|
"text_color": "#000000",
|
|
"alpha": 1,
|
|
"alignment_horizontal": "center",
|
|
"alignment_vertical": "center"
|
|
}
|
|
},
|
|
"card": {
|
|
"log_id": "visibility",
|
|
"variables": [
|
|
{
|
|
"type": "string",
|
|
"name": "visibility_called",
|
|
"value": "false"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "disappear_called",
|
|
"value": "false"
|
|
}
|
|
],
|
|
"states": [
|
|
{
|
|
"state_id": 0,
|
|
"div": {
|
|
"type": "container",
|
|
"items": [
|
|
{
|
|
"type": "button",
|
|
"text": "tooltip with close button",
|
|
"tooltips": [
|
|
{
|
|
"id": "tooltip",
|
|
"position": "bottom",
|
|
"duration": 0,
|
|
"offset": {
|
|
"x": {
|
|
"value": 0
|
|
},
|
|
"y": {
|
|
"value": 4
|
|
}
|
|
},
|
|
"div": {
|
|
"type": "container",
|
|
"orientation": "overlap",
|
|
"width": {
|
|
"type": "wrap_content"
|
|
},
|
|
"items": [
|
|
{
|
|
"type": "container",
|
|
"width": {
|
|
"type": "wrap_content"
|
|
},
|
|
"paddings": {
|
|
"left": 20,
|
|
"top": 20,
|
|
"right": 20,
|
|
"bottom": 20
|
|
},
|
|
"items": [
|
|
{
|
|
"type": "text",
|
|
"width": {
|
|
"type": "wrap_content"
|
|
},
|
|
"paddings": {
|
|
"left": 16,
|
|
"top": 16,
|
|
"right": 16,
|
|
"bottom": 16
|
|
},
|
|
"background": [
|
|
{
|
|
"type": "solid",
|
|
"color": "#799eb7"
|
|
}
|
|
],
|
|
"border": {
|
|
"corner_radius": 6
|
|
},
|
|
"text_color": "#2C3E50",
|
|
"text": "Title tooltip"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "image",
|
|
"width": {
|
|
"type": "fixed",
|
|
"value": 44
|
|
},
|
|
"height": {
|
|
"type": "fixed",
|
|
"value": 44
|
|
},
|
|
"paddings": {
|
|
"left": 12,
|
|
"right": 12,
|
|
"top": 12,
|
|
"bottom": 12
|
|
},
|
|
"action": {
|
|
"log_id": "hide_tooltip",
|
|
"url": "div-action://hide_tooltip?id=tooltip"
|
|
},
|
|
"image_url": "https://yastatic.net/s3/home/div/div_fullscreens/cross2.3.png",
|
|
"tint_color": "#000000",
|
|
"alignment_horizontal": "left",
|
|
"alignment_vertical": "top"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"actions": [
|
|
{
|
|
"log_id": "show_tooltip",
|
|
"url": "div-action://show_tooltip?id=tooltip&multiple=true"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "button",
|
|
"text": "animated tooltip with visibility and disappear action",
|
|
"tooltips": [
|
|
{
|
|
"id": "tooltip_with_visibility",
|
|
"position": "bottom",
|
|
"duration": 0,
|
|
"offset": {
|
|
"x": {
|
|
"value": 0
|
|
},
|
|
"y": {
|
|
"value": 4
|
|
}
|
|
},
|
|
"div": {
|
|
"type": "container",
|
|
"width": {
|
|
"type": "wrap_content"
|
|
},
|
|
"items": [
|
|
{
|
|
"type": "text",
|
|
"width": {
|
|
"type": "wrap_content"
|
|
},
|
|
"paddings": {
|
|
"left": 16,
|
|
"top": 16,
|
|
"right": 16,
|
|
"bottom": 16
|
|
},
|
|
"background": [
|
|
{
|
|
"type": "solid",
|
|
"color": "#799eb7"
|
|
}
|
|
],
|
|
"border": {
|
|
"corner_radius": 6
|
|
},
|
|
"text_color": "#2C3E50",
|
|
"text": "Title tooltip"
|
|
}
|
|
],
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "hide_id",
|
|
"url": "div-action://hide_tooltip?id=tooltip_with_visibility",
|
|
"log_limit": 0,
|
|
"visibility_duration": 3000,
|
|
"visibility_percentage": 100
|
|
},
|
|
{
|
|
"log_id": "set_variable_id",
|
|
"url": "div-action://set_variable?name=visibility_called&value=true",
|
|
"log_limit": 0,
|
|
"visibility_duration": 0,
|
|
"visibility_percentage": 100
|
|
}
|
|
],
|
|
"disappear_actions": [
|
|
{
|
|
"log_id": "item_log_id",
|
|
"log_limit": 0,
|
|
"disappear_duration": 0,
|
|
"visibility_percentage": 20,
|
|
"url": "div-action://set_variable?name=disappear_called&value=true"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"actions": [
|
|
{
|
|
"log_id": "show_tooltip_2",
|
|
"url": "div-action://show_tooltip?id=tooltip_with_visibility&multiple=true"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "button",
|
|
"text": "non-animated tooltip with visibility and disappear action",
|
|
"tooltips": [
|
|
{
|
|
"id": "non_animated_tooltip_with_visibility",
|
|
"position": "bottom",
|
|
"duration": 3000,
|
|
"offset": {
|
|
"x": {
|
|
"value": 0
|
|
},
|
|
"y": {
|
|
"value": 4
|
|
}
|
|
},
|
|
"animation_in": {
|
|
"name": "no_animation"
|
|
},
|
|
"animation_out": {
|
|
"name": "no_animation"
|
|
},
|
|
"div": {
|
|
"type": "container",
|
|
"width": {
|
|
"type": "wrap_content"
|
|
},
|
|
"items": [
|
|
{
|
|
"type": "text",
|
|
"width": {
|
|
"type": "wrap_content"
|
|
},
|
|
"paddings": {
|
|
"left": 16,
|
|
"top": 16,
|
|
"right": 16,
|
|
"bottom": 16
|
|
},
|
|
"background": [
|
|
{
|
|
"type": "solid",
|
|
"color": "#799eb7"
|
|
}
|
|
],
|
|
"border": {
|
|
"corner_radius": 6
|
|
},
|
|
"text_color": "#2C3E50",
|
|
"text": "Title tooltip"
|
|
}
|
|
],
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "set_variable_appeared",
|
|
"url": "div-action://set_variable?name=visibility_called&value=true",
|
|
"log_limit": 0,
|
|
"visibility_duration": 0,
|
|
"visibility_percentage": 100
|
|
}
|
|
],
|
|
"disappear_actions": [
|
|
{
|
|
"log_id": "set_variable_disappeared",
|
|
"log_limit": 0,
|
|
"disappear_duration": 0,
|
|
"visibility_percentage": 20,
|
|
"url": "div-action://set_variable?name=disappear_called&value=true"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"actions": [
|
|
{
|
|
"log_id": "show_tooltip_3",
|
|
"url": "div-action://show_tooltip?id=non_animated_tooltip_with_visibility&multiple=true"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "text",
|
|
"text": "Visibility action called: @{visibility_called}"
|
|
},
|
|
{
|
|
"type": "text",
|
|
"text": "Disappear action called: @{disappear_called}"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|