Skip to content

Instantly share code, notes, and snippets.

@taichunmin
Last active October 14, 2020 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taichunmin/fd6c330f77c611d31558ccba1c9c6f21 to your computer and use it in GitHub Desktop.
Save taichunmin/fd6c330f77c611d31558ccba1c9c6f21 to your computer and use it in GitHub Desktop.
id name image image_ratio rating place time tel website
1 Brown Cafe https://scdn.line-apps.com/n/channel_devcenter/img/fx/01_1_cafe.png 20:13 1.0 Miraina Tower, 4-1-6 Shinjuku, Tokyo 10:00 - 23:00 https://linecorp.com https://linecorp.com
<%
function imgStar (isGold) {
return `https://scdn.line-apps.com/n/channel_devcenter/img/fx/review_${isGold ? 'gold' : 'gray'}_star_28.png`
}
%>
{
"type": "bubble",
"body": {
"layout": "vertical",
"type": "box",
"contents": [
{
"size": "xl",
"text": "${vcard.name}",
"type": "text",
"weight": "bold"
},
{
"layout": "baseline",
"margin": "md",
"type": "box",
"contents": [
{
"size": "sm",
"type": "icon",
"url": "${imgStar(vcard.rating > 0)}"
},
{
"size": "sm",
"type": "icon",
"url": "${imgStar(vcard.rating > 1)}"
},
{
"size": "sm",
"type": "icon",
"url": "${imgStar(vcard.rating > 2)}"
},
{
"size": "sm",
"type": "icon",
"url": "${imgStar(vcard.rating > 3)}"
},
{
"size": "sm",
"type": "icon",
"url": "${imgStar(vcard.rating > 4)}"
},
{
"color": "#999999",
"flex": 0,
"margin": "md",
"size": "sm",
"text": "${vcard.rating}",
"type": "text"
}
]
},
{
"layout": "vertical",
"margin": "lg",
"spacing": "sm",
"type": "box",
"contents": [
{
"layout": "baseline",
"spacing": "sm",
"type": "box",
"contents": [
{
"color": "#aaaaaa",
"flex": 1,
"size": "sm",
"text": "Place",
"type": "text"
},
{
"color": "#666666",
"flex": 5,
"size": "sm",
"text": "${vcard.place}",
"type": "text",
"wrap": true
}
]
},
{
"layout": "baseline",
"spacing": "sm",
"type": "box",
"contents": [
{
"color": "#aaaaaa",
"flex": 1,
"size": "sm",
"text": "Time",
"type": "text"
},
{
"color": "#666666",
"flex": 5,
"size": "sm",
"text": "${vcard.time}",
"type": "text",
"wrap": true
}
]
}
]
}
]
},
"footer": {
"flex": 0,
"layout": "vertical",
"spacing": "sm",
"type": "box",
"contents": [
{
"height": "sm",
"style": "link",
"type": "button",
"action": {
"label": "CALL",
"type": "uri",
"uri": "${vcard.tel}"
}
},
{
"height": "sm",
"style": "link",
"type": "button",
"action": {
"label": "WEBSITE",
"type": "uri",
"uri": "${vcard.website}"
}
}
]
},
"hero": {
"aspectMode": "cover",
"aspectRatio": "${vcard.image_ratio}",
"size": "full",
"type": "image",
"url": "${vcard.image}",
"action": {
"type": "uri",
"uri": "${vcard.website}"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment