mirror of
https://github.com/divkit/divkit.git
synced 2026-05-07 20:02:32 +00:00
660 lines
24 KiB
JSON
660 lines
24 KiB
JSON
{
|
|
"templates": {
|
|
"title_text": {
|
|
"type": "text",
|
|
"font_size": 20,
|
|
"font_weight": "medium",
|
|
"text_alignment_horizontal": "left",
|
|
"margins": {
|
|
"left": 16,
|
|
"right": 16
|
|
},
|
|
"text_alignment_vertical": "center",
|
|
"text_color": "#000000"
|
|
},
|
|
"content_text": {
|
|
"type": "text",
|
|
"font_size": 14,
|
|
"line_height": 20,
|
|
"text_color": "#000000"
|
|
},
|
|
"comment_text": {
|
|
"type": "text",
|
|
"font_size": 14,
|
|
"text_color": "#5e5e5e"
|
|
},
|
|
"comment": {
|
|
"type": "grid",
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "comment_grid",
|
|
"log_limit": 5,
|
|
"visibility_duration": 1000
|
|
}
|
|
],
|
|
"background": [
|
|
{
|
|
"type": "solid",
|
|
"color": "#0e000000"
|
|
}
|
|
],
|
|
"border": {
|
|
"corner_radius": 4
|
|
},
|
|
"column_count": 3,
|
|
"items": [
|
|
{
|
|
"type": "separator",
|
|
"id": "separator",
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "separator",
|
|
"log_limit": 5,
|
|
"visibility_duration": 1000
|
|
}
|
|
],
|
|
"width": {
|
|
"type": "fixed",
|
|
"value": 4
|
|
},
|
|
"height": {
|
|
"type": "match_parent"
|
|
},
|
|
"row_span": 2,
|
|
"delimiter_style": {
|
|
"color": "#00000000"
|
|
},
|
|
"background": [
|
|
{
|
|
"type": "solid",
|
|
"$color": "marker_color"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "text",
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "text",
|
|
"log_limit": 5,
|
|
"visibility_duration": 1000
|
|
}
|
|
],
|
|
"width": {
|
|
"type": "match_parent",
|
|
"weight": 1
|
|
},
|
|
"height": {
|
|
"type": "fixed",
|
|
"value": 20
|
|
},
|
|
"margins": {
|
|
"left": 8,
|
|
"right": 8
|
|
},
|
|
"font_size": 12,
|
|
"font_weight": "light",
|
|
"max_lines": 1,
|
|
"text_alignment_vertical": "center",
|
|
"text_color": "#3498DB",
|
|
"$text": "author"
|
|
},
|
|
{
|
|
"type": "text",
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "text2",
|
|
"log_limit": 5,
|
|
"visibility_duration": 1000
|
|
}
|
|
],
|
|
"width": {
|
|
"type": "wrap_content"
|
|
},
|
|
"height": {
|
|
"type": "fixed",
|
|
"value": 20
|
|
},
|
|
"margins": {
|
|
"right": 8
|
|
},
|
|
"font_size": 12,
|
|
"max_lines": 1,
|
|
"text_alignment_vertical": "center",
|
|
"text_color": "#1ABC9C",
|
|
"$text": "date"
|
|
},
|
|
{
|
|
"type": "state",
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "comment_state",
|
|
"log_limit": 5,
|
|
"visibility_duration": 1000
|
|
}
|
|
],
|
|
"margins": {
|
|
"left": 8,
|
|
"right": 8,
|
|
"bottom": 8
|
|
},
|
|
"column_span": 2,
|
|
"$id": "comment_id",
|
|
"states": [
|
|
{
|
|
"state_id": "collapsed",
|
|
"animation_in": {
|
|
"name": "fade",
|
|
"interpolator": "ease",
|
|
"duration": 200
|
|
},
|
|
"animation_out": {
|
|
"name": "fade",
|
|
"interpolator": "ease_in_out",
|
|
"duration": 200
|
|
},
|
|
"div": {
|
|
"type": "comment_text",
|
|
"max_lines": 2,
|
|
"$text": "comment",
|
|
"ellipsis": {
|
|
"text": "… SHOW MORE",
|
|
"ranges": [
|
|
{
|
|
"start": 2,
|
|
"end": 11,
|
|
"font_size": 11,
|
|
"font_weight": "medium",
|
|
"text_color": "#95A5A6",
|
|
"$actions": "collapsed_actions"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"state_id": "expanded",
|
|
"animation_in": {
|
|
"name": "fade",
|
|
"interpolator": "ease",
|
|
"duration": 200
|
|
},
|
|
"animation_out": {
|
|
"name": "fade",
|
|
"interpolator": "ease_in_out",
|
|
"duration": 200
|
|
},
|
|
"div": {
|
|
"type": "comment_text",
|
|
"$text": "comment",
|
|
"$actions": "expanded_actions"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"button": {
|
|
"type": "text",
|
|
"height": {
|
|
"type": "fixed",
|
|
"value": 36
|
|
},
|
|
"background": [
|
|
{
|
|
"type": "solid",
|
|
"color": "#f1dff2"
|
|
}
|
|
],
|
|
"border": {
|
|
"corner_radius": 8
|
|
},
|
|
"font_size": 16,
|
|
"max_lines": 1,
|
|
"text_alignment_horizontal": "center",
|
|
"text_alignment_vertical": "center",
|
|
"text_color": "#000000"
|
|
},
|
|
"borderless_button": {
|
|
"type": "text",
|
|
"height": {
|
|
"type": "fixed",
|
|
"value": 40
|
|
},
|
|
"paddings": {
|
|
"left": 16,
|
|
"right": 16
|
|
},
|
|
"margins": {
|
|
"left": 16,
|
|
"right": 16
|
|
},
|
|
"font_size": 14,
|
|
"max_lines": 1,
|
|
"text_alignment_horizontal": "center",
|
|
"text_alignment_vertical": "center",
|
|
"text_color": "#2980B9"
|
|
},
|
|
"space": {
|
|
"type": "separator",
|
|
"delimiter_style": {
|
|
"color": "#00000000"
|
|
}
|
|
},
|
|
"article_card": {
|
|
"type": "container",
|
|
"margins": {
|
|
"left": 8,
|
|
"top": 8,
|
|
"right": 8,
|
|
"bottom": 8
|
|
},
|
|
"paddings": {
|
|
"left": 16,
|
|
"top": 16,
|
|
"right": 16,
|
|
"bottom": 16
|
|
},
|
|
"border": {
|
|
"corner_radius": 8
|
|
},
|
|
"orientation": "vertical"
|
|
}
|
|
},
|
|
"card": {
|
|
"log_id": "article_card",
|
|
"states": [
|
|
{
|
|
"state_id": 0,
|
|
"div": {
|
|
"type": "article_card",
|
|
"items": [
|
|
{
|
|
"type": "title_text",
|
|
"margins": {
|
|
"bottom": 8
|
|
},
|
|
"text": "Title",
|
|
"width": {
|
|
"type": "wrap_content"
|
|
},
|
|
"tooltips": [
|
|
{
|
|
"id": "tooltip",
|
|
"position": "bottom",
|
|
"duration": 0,
|
|
"offset": {
|
|
"x": {
|
|
"value": 0
|
|
},
|
|
"y": {
|
|
"value": 4
|
|
}
|
|
},
|
|
"div": {
|
|
"type": "text",
|
|
"width": {
|
|
"type": "wrap_content"
|
|
},
|
|
"paddings": {
|
|
"left": 16,
|
|
"top": 16,
|
|
"right": 16,
|
|
"bottom": 16
|
|
},
|
|
"background": [
|
|
{
|
|
"type": "solid",
|
|
"color": "#3498DB"
|
|
}
|
|
],
|
|
"border": {
|
|
"corner_radius": 6
|
|
},
|
|
"text_color": "#2C3E50",
|
|
"text": "Title tooltip",
|
|
"action": {
|
|
"log_id": "hide_tooltip",
|
|
"url": "div-action://hide_tooltip?id=tooltip"
|
|
},
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "item_log_id",
|
|
"url": "div-action://hide_tooltip?id=tooltip",
|
|
"log_limit": 0,
|
|
"visibility_duration": 5000,
|
|
"visibility_percentage": 100
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"action": {
|
|
"log_id": "show_tooltip",
|
|
"url": "div-action://show_tooltip?id=tooltip"
|
|
}
|
|
},
|
|
{
|
|
"type": "state",
|
|
"id": "content",
|
|
"states": [
|
|
{
|
|
"state_id": "collapsed",
|
|
"animation_in": {
|
|
"name": "fade",
|
|
"interpolator": "ease",
|
|
"duration": 200
|
|
},
|
|
"animation_out": {
|
|
"name": "fade",
|
|
"interpolator": "ease_in_out",
|
|
"duration": 200
|
|
},
|
|
"div": {
|
|
"type": "content_text",
|
|
"margins": {
|
|
"bottom": 16
|
|
},
|
|
"max_lines": 3,
|
|
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
|
|
}
|
|
},
|
|
{
|
|
"state_id": "expanded",
|
|
"animation_in": {
|
|
"name": "fade",
|
|
"interpolator": "ease",
|
|
"duration": 200
|
|
},
|
|
"animation_out": {
|
|
"name": "fade",
|
|
"interpolator": "ease_in_out",
|
|
"duration": 200
|
|
},
|
|
"div": {
|
|
"type": "container",
|
|
"orientation": "vertical",
|
|
"items": [
|
|
{
|
|
"type": "content_text",
|
|
"margins": {
|
|
"bottom": 8
|
|
},
|
|
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
|
|
},
|
|
{
|
|
"type": "state",
|
|
"id": "comments",
|
|
"states": [
|
|
{
|
|
"state_id": "collapsed",
|
|
"div": {
|
|
"type": "space",
|
|
"height": {
|
|
"type": "fixed",
|
|
"value": 0
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"state_id": "expanded",
|
|
"animation_in": {
|
|
"name": "translate",
|
|
"interpolator": "ease",
|
|
"duration": 200
|
|
},
|
|
"animation_out": {
|
|
"name": "translate",
|
|
"interpolator": "ease",
|
|
"duration": 200
|
|
},
|
|
"div": {
|
|
"type": "container",
|
|
"margins": {
|
|
"left": 8,
|
|
"right": 8,
|
|
"bottom": 20
|
|
},
|
|
"orientation": "vertical",
|
|
"items": [
|
|
{
|
|
"type": "comment",
|
|
"id": "comment_1",
|
|
"margins": {
|
|
"bottom": 8
|
|
},
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "comment_01",
|
|
"log_limit": 5,
|
|
"visibility_duration": 1000
|
|
}
|
|
],
|
|
"comment_id": "comment_01",
|
|
"marker_color": "#F1C40F",
|
|
"author": "username",
|
|
"date": "today, 12:00",
|
|
"comment": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
|
"collapsed_actions": [
|
|
{
|
|
"log_id": "expand_comment_01",
|
|
"url": "div-action://set_state?state_id=0/content/expanded/comments/expanded/comment_01/expanded"
|
|
}
|
|
],
|
|
"expanded_actions": [
|
|
{
|
|
"log_id": "collapse_comment_01",
|
|
"url": "div-action://set_state?state_id=0/content/expanded/comments/expanded/comment_01/collapsed"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "comment",
|
|
"id": "comment_2",
|
|
"margins": {
|
|
"bottom": 8
|
|
},
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "comment_02",
|
|
"log_limit": 5,
|
|
"visibility_duration": 2000
|
|
}
|
|
],
|
|
"comment_id": "comment_02",
|
|
"marker_color": "#E67E22",
|
|
"author": "username",
|
|
"date": "today, 12:00",
|
|
"comment": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
|
"collapsed_actions": [
|
|
{
|
|
"log_id": "expand_comment_02",
|
|
"url": "div-action://set_state?state_id=0/content/expanded/comments/expanded/comment_02/expanded"
|
|
}
|
|
],
|
|
"expanded_actions": [
|
|
{
|
|
"log_id": "collapse_comment_02",
|
|
"url": "div-action://set_state?state_id=0/content/expanded/comments/expanded/comment_02/collapsed"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "comment",
|
|
"id": "comment_3",
|
|
"margins": {
|
|
"bottom": 8
|
|
},
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "comment_03",
|
|
"log_limit": 5,
|
|
"visibility_duration": 3000
|
|
}
|
|
],
|
|
"comment_id": "comment_03",
|
|
"marker_color": "#E74C3C",
|
|
"author": "username",
|
|
"date": "today, 12:00",
|
|
"comment": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
|
"collapsed_actions": [
|
|
{
|
|
"log_id": "expand_comment_03",
|
|
"url": "div-action://set_state?state_id=0/content/expanded/comments/expanded/comment_03/expanded"
|
|
}
|
|
],
|
|
"expanded_actions": [
|
|
{
|
|
"log_id": "collapse_comment_03",
|
|
"url": "div-action://set_state?state_id=0/content/expanded/comments/expanded/comment_03/collapsed"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "comment",
|
|
"id": "comment_4",
|
|
"visibility_actions": [
|
|
{
|
|
"log_id": "comment_04",
|
|
"log_limit": 5,
|
|
"visibility_duration": 4000
|
|
}
|
|
],
|
|
"comment_id": "comment_04",
|
|
"marker_color": "#9B59B6",
|
|
"author": "username",
|
|
"date": "today, 12:00",
|
|
"comment": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
|
"collapsed_actions": [
|
|
{
|
|
"log_id": "expand_comment_04",
|
|
"url": "div-action://set_state?state_id=0/content/expanded/comments/expanded/comment_04/expanded"
|
|
}
|
|
],
|
|
"expanded_actions": [
|
|
{
|
|
"log_id": "collapse_comment_04",
|
|
"url": "div-action://set_state?state_id=0/content/expanded/comments/expanded/comment_04/collapsed"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "state",
|
|
"margins": {
|
|
"bottom": 8
|
|
},
|
|
"id": "comments_button",
|
|
"states": [
|
|
{
|
|
"state_id": "text_show_comments",
|
|
"animation_in": {
|
|
"name": "fade",
|
|
"start_delay": 200,
|
|
"duration": 0
|
|
},
|
|
"animation_out": {
|
|
"name": "fade",
|
|
"start_delay": 200,
|
|
"duration": 0
|
|
},
|
|
"div": {
|
|
"type": "borderless_button",
|
|
"text": "SHOW COMMENTS",
|
|
"actions": [
|
|
{
|
|
"log_id": "show_comments",
|
|
"url": "div-action://set_state?state_id=0/content/expanded/comments/expanded"
|
|
},
|
|
{
|
|
"log_id": "button_text_hide_comments",
|
|
"url": "div-action://set_state?state_id=0/content/expanded/comments_button/text_hide_comments"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"state_id": "text_hide_comments",
|
|
"animation_in": {
|
|
"name": "fade",
|
|
"start_delay": 200,
|
|
"duration": 0
|
|
},
|
|
"animation_out": {
|
|
"name": "fade",
|
|
"start_delay": 200,
|
|
"duration": 0
|
|
},
|
|
"div": {
|
|
"type": "borderless_button",
|
|
"text": "HIDE COMMENTS",
|
|
"actions": [
|
|
{
|
|
"log_id": "hide_comments",
|
|
"url": "div-action://set_state?state_id=0/content/expanded/comments/collapsed"
|
|
},
|
|
{
|
|
"log_id": "button_text_show_comments",
|
|
"url": "div-action://set_state?state_id=0/content/expanded/comments_button/text_show_comments"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "state",
|
|
"id": "button",
|
|
"states": [
|
|
{
|
|
"state_id": "text_expand",
|
|
"div": {
|
|
"type": "button",
|
|
"text": "EXPAND",
|
|
"actions": [
|
|
{
|
|
"log_id": "expand_content",
|
|
"url": "div-action://set_state?state_id=0/content/expanded"
|
|
},
|
|
{
|
|
"log_id": "button_text_collapse",
|
|
"url": "div-action://set_state?state_id=0/button/text_collapse"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"state_id": "text_collapse",
|
|
"div": {
|
|
"type": "button",
|
|
"text": "COLLAPSE",
|
|
"actions": [
|
|
{
|
|
"log_id": "collapse_content",
|
|
"url": "div-action://set_state?state_id=0/content/collapsed"
|
|
},
|
|
{
|
|
"log_id": "button_text_expand",
|
|
"url": "div-action://set_state?state_id=0/button/text_expand"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|