mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
287 lines
8.0 KiB
JSON
287 lines
8.0 KiB
JSON
{
|
|
"templates": {
|
|
"button": {
|
|
"type": "text",
|
|
"height": {
|
|
"type": "fixed",
|
|
"value": 28
|
|
},
|
|
"width": {
|
|
"type": "fixed",
|
|
"value": 56
|
|
},
|
|
"text_alignment_horizontal": "center",
|
|
"text_alignment_vertical": "center",
|
|
"font_size": 18,
|
|
"font_weight": "bold",
|
|
"text_color": "#ffffff",
|
|
"background": [
|
|
{
|
|
"color": "#D098D3",
|
|
"type": "solid"
|
|
}
|
|
],
|
|
"margins": {
|
|
"left": 8,
|
|
"top": 8,
|
|
"right": 8,
|
|
"bottom": 8
|
|
},
|
|
"border": {
|
|
"corner_radius": 8
|
|
}
|
|
},
|
|
"text_block": {
|
|
"type": "text",
|
|
"background": [
|
|
{
|
|
"type": "solid",
|
|
"color": "#0e000000"
|
|
}
|
|
],
|
|
"height": {
|
|
"type": "fixed",
|
|
"value": 240,
|
|
"unit": "sp"
|
|
},
|
|
"border": {
|
|
"corner_radius": 16
|
|
},
|
|
"font_size": 20,
|
|
"text_alignment_vertical": "center",
|
|
"text_alignment_horizontal": "center",
|
|
"text_color": "#000000"
|
|
},
|
|
"image_block": {
|
|
"type": "image",
|
|
"border": {
|
|
"corner_radius": 16
|
|
},
|
|
"alpha": 0.8,
|
|
"image_url": "https://yastatic.net/s3/home/yandex-app/div_demo/containers.png",
|
|
"placeholder_color": "#C0C0B0",
|
|
"preload_required": 1,
|
|
"width": {
|
|
"type": "match_parent"
|
|
},
|
|
"height": {
|
|
"type": "fixed",
|
|
"value": 240
|
|
}
|
|
}
|
|
},
|
|
"card": {
|
|
"log_id": "card",
|
|
"states": [
|
|
{
|
|
"div": {
|
|
"items": [
|
|
{
|
|
"id": "my_pager",
|
|
"item_spacing": {
|
|
"type": "fixed",
|
|
"value": 4
|
|
},
|
|
"margins": {
|
|
"top": 8
|
|
},
|
|
"paddings": {
|
|
"right": 4,
|
|
"left": 4
|
|
},
|
|
"items": [
|
|
{
|
|
"type": "text_block",
|
|
"text": "New first item",
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "content_item_show:0",
|
|
"visibility_percentage": 80,
|
|
"visibility_duration": 0
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "text_block",
|
|
"text": "Item 0",
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "content_item_show:0",
|
|
"visibility_percentage": 80,
|
|
"visibility_duration": 0
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "image_block",
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "content_item_show:1",
|
|
"visibility_percentage": 80,
|
|
"visibility_duration": 0
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "text_block",
|
|
"text": "Item 2",
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "content_item_show:2",
|
|
"visibility_percentage": 80,
|
|
"visibility_duration": 0
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "image_block",
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "content_item_show:3",
|
|
"visibility_percentage": 80,
|
|
"visibility_duration": 0
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "text_block",
|
|
"text": "Item 4",
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "content_item_show:4",
|
|
"visibility_percentage": 80,
|
|
"visibility_duration": 0
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "image_block",
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "content_item_show:5",
|
|
"visibility_percentage": 80,
|
|
"visibility_duration": 0
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "text_block",
|
|
"text": "New last item",
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "content_item_show:0",
|
|
"visibility_percentage": 80,
|
|
"visibility_duration": 0
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"layout_mode": {
|
|
"neighbour_page_width": {
|
|
"type": "fixed",
|
|
"value": 20
|
|
},
|
|
"type": "fixed"
|
|
},
|
|
"restrict_parent_scroll": 1,
|
|
"type": "pager"
|
|
},
|
|
{
|
|
"items": [
|
|
{
|
|
"id": "scroll_click_1",
|
|
"actions": [
|
|
{
|
|
"log_id": "prev",
|
|
"url": "div-action://set_current_item?id=my_pager&item=0"
|
|
}
|
|
],
|
|
"text": "<<",
|
|
"text_alignment_horizontal": "center",
|
|
"type": "button"
|
|
},
|
|
{
|
|
"id": "scroll_click_2",
|
|
"actions": [
|
|
{
|
|
"log_id": "prev",
|
|
"url": "div-action://set_previous_item?id=my_pager"
|
|
}
|
|
],
|
|
"text": "<",
|
|
"text_alignment_horizontal": "center",
|
|
"type": "button"
|
|
},
|
|
{
|
|
"id": "scroll_click_3",
|
|
"actions": [
|
|
{
|
|
"log_id": "next",
|
|
"url": "div-action://set_next_item?id=my_pager"
|
|
}
|
|
],
|
|
"text": ">",
|
|
"text_alignment_horizontal": "center",
|
|
"type": "button"
|
|
},
|
|
{
|
|
"id": "scroll_click_4",
|
|
"actions": [
|
|
{
|
|
"log_id": "next",
|
|
"url": "div-action://set_current_item?id=my_pager&item=5"
|
|
}
|
|
],
|
|
"text": ">>",
|
|
"type": "button"
|
|
}
|
|
],
|
|
"orientation": "horizontal",
|
|
"content_alignment_horizontal": "center",
|
|
"alignment_horizontal": "center",
|
|
"type": "container"
|
|
},
|
|
{
|
|
"type": "container",
|
|
"orientation": "horizontal",
|
|
"width": {
|
|
"type": "match_parent"
|
|
},
|
|
"content_alignment_horizontal": "space-between",
|
|
"margins": {
|
|
"top": 30,
|
|
"bottom": 30
|
|
},
|
|
"items": [
|
|
{
|
|
"type": "button",
|
|
"text": "UnDo",
|
|
"actions": [
|
|
{
|
|
"log_id": "rebinding",
|
|
"url": "div-demo-action://set_data?path=rebind/pager/un_added.json"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "button",
|
|
"text": "Next",
|
|
"actions": [
|
|
{
|
|
"log_id": "rebinding",
|
|
"url": "div-demo-action://set_data?path=rebind/pager/replaced_text.json"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"orientation": "vertical",
|
|
"type": "container"
|
|
},
|
|
"state_id": 0
|
|
}
|
|
]
|
|
}
|
|
}
|