mirror of
https://github.com/divkit/divkit.git
synced 2026-05-07 20:02:32 +00:00
e35dc0a5e9
commit_hash:22623192cdabbd2dcedf862b9a6d9aa8219e422b
305 lines
7.5 KiB
JSON
305 lines
7.5 KiB
JSON
{
|
|
"templates": {
|
|
"nps_button": {
|
|
"type": "text",
|
|
"paddings": {
|
|
"top": 12,
|
|
"bottom": 12,
|
|
"left": 48,
|
|
"right": 48
|
|
},
|
|
"text_alignment_horizontal": "center",
|
|
"text_alignment_vertical": "center",
|
|
"font_size": 24,
|
|
"height": {
|
|
"type": "wrap_content"
|
|
},
|
|
"width": {
|
|
"type": "match_parent"
|
|
},
|
|
"border": {
|
|
"corner_radius": 16
|
|
},
|
|
"background": [
|
|
{
|
|
"type": "solid",
|
|
"color": "#0e000000"
|
|
}
|
|
]
|
|
},
|
|
"counter": {
|
|
"type": "state",
|
|
"margins": {
|
|
"top": 16,
|
|
"left": 12,
|
|
"right": 12
|
|
},
|
|
"states": [
|
|
{
|
|
"state_id": "6",
|
|
"div": {
|
|
"type": "nps_button",
|
|
"text": "🤔 Not sure"
|
|
}
|
|
},
|
|
{
|
|
"state_id": "1",
|
|
"div": {
|
|
"type": "nps_button",
|
|
"text": "😔 This is bad"
|
|
}
|
|
},
|
|
{
|
|
"state_id": "2",
|
|
"div": {
|
|
"type": "nps_button",
|
|
"text": "😔 This is bad"
|
|
}
|
|
},
|
|
{
|
|
"state_id": "3",
|
|
"div": {
|
|
"type": "nps_button",
|
|
"text": "😔 This is bad"
|
|
}
|
|
},
|
|
{
|
|
"state_id": "4",
|
|
"div": {
|
|
"type": "nps_button",
|
|
"text": "🤔 Not sure"
|
|
}
|
|
},
|
|
{
|
|
"state_id": "5",
|
|
"div": {
|
|
"type": "nps_button",
|
|
"text": "🤔 Not sure"
|
|
}
|
|
},
|
|
{
|
|
"state_id": "7",
|
|
"div": {
|
|
"type": "nps_button",
|
|
"text": "😐 You can do better"
|
|
}
|
|
},
|
|
{
|
|
"state_id": "8",
|
|
"div": {
|
|
"type": "nps_button",
|
|
"text": "🙂 Good"
|
|
}
|
|
},
|
|
{
|
|
"state_id": "9",
|
|
"div": {
|
|
"type": "nps_button",
|
|
"text": "😁 Excellent"
|
|
}
|
|
},
|
|
{
|
|
"state_id": "10",
|
|
"div": {
|
|
"type": "nps_button",
|
|
"text": "😍😍😍 Awesome"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"card": {
|
|
"log_id": "test",
|
|
"variables": [
|
|
{
|
|
"name": "my_thumb_value",
|
|
"type": "integer",
|
|
"value": 6
|
|
}
|
|
],
|
|
"variable_triggers": [
|
|
{
|
|
"condition": "@{my_thumb_value >= 0}",
|
|
"mode": "on_variable",
|
|
"actions": [
|
|
{
|
|
"log_id": "ya_action",
|
|
"url": "div-action://set_state?state_id=0/counter/@{my_thumb_value}"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"states": [
|
|
{
|
|
"state_id": 0,
|
|
"div": {
|
|
"type": "container",
|
|
"height": {
|
|
"type": "match_parent"
|
|
},
|
|
"content_alignment_vertical": "center",
|
|
"margins": {
|
|
"left": 8,
|
|
"right": 8
|
|
},
|
|
"items": [
|
|
{
|
|
"type": "text",
|
|
"text": "Will you recommend Yandex to your friends and family?",
|
|
"margins": {
|
|
"left": 16,
|
|
"right": 16,
|
|
"bottom": 12
|
|
},
|
|
"font_size": 24
|
|
},
|
|
{
|
|
"type": "slider",
|
|
"width": {
|
|
"type": "match_parent"
|
|
},
|
|
"id": "min_0_max_10",
|
|
"accessibility": {
|
|
"description": "Min - 0, max - 10"
|
|
},
|
|
"paddings": {
|
|
"left": 8,
|
|
"right": 8,
|
|
"top": 16
|
|
},
|
|
"max_value": 10,
|
|
"min_value": 1,
|
|
"thumb_value_variable": "my_thumb_value",
|
|
"thumb_style": {
|
|
"type": "shape_drawable",
|
|
"color": "#FFCC00",
|
|
"stroke": {
|
|
"color": "#ffffff",
|
|
"width": 3
|
|
},
|
|
"shape": {
|
|
"type": "rounded_rectangle",
|
|
"item_height": {
|
|
"type": "fixed",
|
|
"value": 32
|
|
},
|
|
"item_width": {
|
|
"type": "fixed",
|
|
"value": 32
|
|
},
|
|
"corner_radius": {
|
|
"type": "fixed",
|
|
"value": 100
|
|
}
|
|
}
|
|
},
|
|
"tick_mark_active_style": {
|
|
"type": "shape_drawable",
|
|
"color": "#FFCC00",
|
|
"stroke": {
|
|
"color": "#ffffff",
|
|
"width": 2
|
|
},
|
|
"shape": {
|
|
"type": "rounded_rectangle",
|
|
"item_height": {
|
|
"type": "fixed",
|
|
"value": 8
|
|
},
|
|
"item_width": {
|
|
"type": "fixed",
|
|
"value": 8
|
|
},
|
|
"corner_radius": {
|
|
"type": "fixed",
|
|
"value": 5
|
|
}
|
|
}
|
|
},
|
|
"tick_mark_inactive_style": {
|
|
"type": "shape_drawable",
|
|
"color": "#20000000",
|
|
"stroke": {
|
|
"color": "#ffffff",
|
|
"width": 2
|
|
},
|
|
"shape": {
|
|
"type": "rounded_rectangle",
|
|
"item_height": {
|
|
"type": "fixed",
|
|
"value": 8
|
|
},
|
|
"item_width": {
|
|
"type": "fixed",
|
|
"value": 8
|
|
},
|
|
"corner_radius": {
|
|
"type": "fixed",
|
|
"value": 5
|
|
}
|
|
}
|
|
},
|
|
"track_active_style": {
|
|
"type": "shape_drawable",
|
|
"color": "#FFCC00",
|
|
"shape": {
|
|
"type": "rounded_rectangle",
|
|
"item_height": {
|
|
"type": "fixed",
|
|
"value": 6
|
|
}
|
|
}
|
|
},
|
|
"track_inactive_style": {
|
|
"type": "shape_drawable",
|
|
"color": "#20000000",
|
|
"shape": {
|
|
"type": "rounded_rectangle",
|
|
"item_height": {
|
|
"type": "fixed",
|
|
"value": 6
|
|
}
|
|
}
|
|
},
|
|
"thumb_text_style": {
|
|
"font_size": 14,
|
|
"text_color": "#FFFFFF",
|
|
"font_weight": "bold"
|
|
}
|
|
},
|
|
{
|
|
"type": "container",
|
|
"orientation": "overlap",
|
|
"margins": {
|
|
"left": 16,
|
|
"right": 16
|
|
},
|
|
"items": [
|
|
{
|
|
"type": "text",
|
|
"text": "always",
|
|
"item_width": {
|
|
"type": "match_parent"
|
|
},
|
|
"text_alignment_horizontal": "right",
|
|
"text_alignment_vertical": "center",
|
|
"text_color": "#a0000000"
|
|
},
|
|
{
|
|
"type": "text",
|
|
"text": "never",
|
|
"text_color": "#a0000000"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "counter",
|
|
"id": "counter"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|