Advertisement
Guest User

flex python

a guest
Oct 2nd, 2019
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.44 KB | None | 0 0
  1. columns = []
  2. carousel_column = BubbleContainer(
  3.     body=BoxComponent(
  4.         layout='vertical',
  5.         contents=[
  6.             ImageComponent(
  7.                 url="https://scdn.line-apps.com/n/channel_devcenter/img/flexsnapshot/clip/clip1.jpg",
  8.                 size='full',
  9.                 aspect_ratio='2:3',
  10.                 aspect_mode='cover',
  11.                 gravity='top',
  12.             ),
  13.             BoxComponent(
  14.                 layout='vertical',
  15.                 contents=[
  16.                     BoxComponent(
  17.                         layout='vertical',
  18.                         contents=[
  19.                             #titile
  20.                             TextComponent(text='test', weight='bold', color='#ffffff', size='md'),
  21.                         ],
  22.                     ),
  23.                     BoxComponent(
  24.                         layout='baseline',
  25.                         contents=[
  26.                             # info
  27.                             TextComponent(text='asdasda adsasd ass', color='#ebebeb', size='xs', gravity='bottom', flex=0),
  28.                         ],
  29.                         spacing='lg',
  30.                     ),
  31.                     BoxComponent(
  32.                         layout='vertical',
  33.                         contents=[
  34.                             FillerComponent(),
  35.                             BoxComponent(
  36.                                 layout='baseline',
  37.                                 contents=[
  38.                                     FillerComponent(),
  39.                                     IconComponent(
  40.                                         url='https://scdn.line-apps.com/n/channel_devcenter/img/flexsnapshot/clip/clip14.png'
  41.                                     ),
  42.                                     TextComponent(text='Selengkapnya', color='#ffffff', flex=0, offset_top='-2px'),
  43.                                     FillerComponent(),
  44.                                 ],
  45.                                 spacing='sm',
  46.                             ),
  47.                             FillerComponent(),
  48.                         ],
  49.                         border_width='1px',
  50.                         corner_radius='4px',
  51.                         spacing='sm',
  52.                         border_color='#ffffff',
  53.                         margin='xxl',
  54.                         height='40px',
  55.                     ),  
  56.                 ],
  57.                 position= 'absolute',
  58.                 offset_bottom= '0px',
  59.                 offset_start= '0px',
  60.                 offset_end= '0px',
  61.                 background_color= '#03303Acc',
  62.                 padding_all= '20px',
  63.                 padding_top= '18px',
  64.             ),
  65.             BoxComponent(
  66.                 layout='vertical',
  67.                 contents=[
  68.                     TextComponent(text='SALE', align='center', color='#ffffff', size='xs', offset_top='3px'),
  69.                 ],
  70.                 position= 'absolute',
  71.                 corner_radius= '20px',
  72.                 offset_top= '18px',
  73.                 background_color= '#ff334b',
  74.                 offset_start= '18px',
  75.                 height= '25px',
  76.                 width= '53px',
  77.             ),      
  78.         ],
  79.         padding_all= '0px',
  80.     )
  81. )
  82. columns.append(carousel_column)
  83.  
  84. carousel_template = CarouselContainer(contents=columns)
  85. template_message = FlexSendMessage(
  86.     alt_text='TEST', contents=carousel_template)
  87. line_bot_api.reply_message(
  88.     event.reply_token, [
  89.         template_message])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement