index copy.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1" />
  6. <title>LIFF 2.0 Example</title>
  7. <link rel="shortcut icon" href="icon/icon.ico" type="image/x-icon" />
  8. <link rel="icon" href="icon/icon.ico" type="image/x-icon" />
  9. <style media="screen">
  10. body {
  11. background: #eceff1;
  12. color: rgba(0, 0, 0, 0.87);
  13. font-family: Roboto, Helvetica, Arial, sans-serif;
  14. margin: 0;
  15. padding: 0;
  16. }
  17. #message {
  18. background: white;
  19. max-width: 1000px;
  20. margin: 10px auto 16px;
  21. padding: 32px 24px;
  22. border-radius: 10px;
  23. }
  24. #message h2 {
  25. color: #ffa100;
  26. font-weight: bold;
  27. font-size: 30px;
  28. margin: 0 0 8px;
  29. }
  30. #message h1 {
  31. font-size: 22px;
  32. font-weight: 300;
  33. color: rgba(0, 0, 0, 0.6);
  34. margin: 0 0 16px;
  35. }
  36. #message p {
  37. line-height: 140%;
  38. margin: 16px 0 24px;
  39. font-size: 14px;
  40. }
  41. #message a {
  42. display: block;
  43. text-align: center;
  44. background: #039be5;
  45. text-transform: uppercase;
  46. text-decoration: none;
  47. color: white;
  48. padding: 16px;
  49. border-radius: 4px;
  50. }
  51. #message,
  52. #message a {
  53. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  54. }
  55. #load {
  56. color: rgba(0, 0, 0, 0.4);
  57. text-align: center;
  58. font-size: 13px;
  59. }
  60. @media (max-width: 600px) {
  61. body,
  62. #message {
  63. margin-top: 0;
  64. background: white;
  65. box-shadow: none;
  66. }
  67. body {
  68. border-top: 16px solid #ffa100;
  69. }
  70. }
  71. table {
  72. margin-top: 10px;
  73. border: 2px solid black;
  74. border-collapse: collapse;
  75. width: 100%;
  76. }
  77. table td {
  78. border: 1px solid black;
  79. }
  80. table td.shrink {
  81. white-space: wrap;
  82. font-size: 19px;
  83. padding: 5px;
  84. background-color: yellow;
  85. }
  86. table td.shrink_context {
  87. white-space: wrap;
  88. font-size: 19px;
  89. padding: 5px;
  90. background-color: rgb(0, 255, 106);
  91. }
  92. table td.shrink_top {
  93. white-space: nowrap;
  94. background-color: black;
  95. color: white;
  96. font-size: 25px;
  97. }
  98. table td.expand {
  99. width: 99%;
  100. white-space: wrap;
  101. font-size: 19px;
  102. padding: 5px;
  103. }
  104. table td.expand_top {
  105. width: 99%;
  106. white-space: wrap;
  107. background-color: black;
  108. }
  109. tr:hover {
  110. background-color: gray;
  111. }
  112. button {
  113. background-color: #4caf50;
  114. /* Green */
  115. border: none;
  116. color: white;
  117. padding: 10px 10px;
  118. text-align: center;
  119. text-decoration: none;
  120. display: inline-block;
  121. font-size: 16px;
  122. border-radius: 5px;
  123. -webkit-transition-duration: 0.4s;
  124. /* Safari */
  125. transition-duration: 0.4s;
  126. cursor: pointer;
  127. }
  128. button:hover {
  129. background-color: honeydew;
  130. color: black;
  131. }
  132. </style>
  133. </head>
  134. <body>
  135. <div id="message">
  136. <center>
  137. <h2>LIFF 2.0 | Example</h2>
  138. </center>
  139. <center>
  140. <img
  141. src="https://firebasestorage.googleapis.com/v0/b/uce-bot.appspot.com/o/user.jpg?alt=media&token=554b90c5-562c-469a-bfee-f36b5e3f54c9"
  142. style="border-radius: 10px;" width="150px" height="150px" id="profileImage" />
  143. </center>
  144. <center>
  145. <button onclick="login()">liff.login()</button>
  146. <button onclick="logout()">liff.logout()</button>
  147. <button onclick="sendMessage()">liff.sendMessage()</button>
  148. <button onclick="scanCode()">liff.scanCode()</button>
  149. <button onclick="openWindow()">liff.openWindow()</button>
  150. <button onclick="closeWindow()">liff.closeWindow()</button>
  151. <button onclick="shareTargetPicker()">liff.shareTargetPicker()</button>
  152. </center>
  153. <table>
  154. <tr>
  155. <td class="shrink_top">* Profile</td>
  156. <td class="expand_top">
  157. <button onclick="getProfile()">View raw JSON Data</button>
  158. </td>
  159. </tr>
  160. <tr>
  161. <td class="shrink">userId</td>
  162. <td class="expand" id="userId">Loading . . .</td>
  163. </tr>
  164. <tr>
  165. <td class="shrink">displayName</td>
  166. <td class="expand" id="displayName">Loading. . .</td>
  167. </tr>
  168. <tr>
  169. <td class="shrink">statusMessage</td>
  170. <td class="expand" id="statusMessage">Loading . . .</td>
  171. </tr>
  172. <tr>
  173. <td class="shrink">Email</td>
  174. <td class="expand" id="email">Loading . . .</td>
  175. </tr>
  176. <tr>
  177. <td class="shrink">pictureUrl</td>
  178. <td class="expand">
  179. <a id="pictureUrl" target="_blank">Loading . . .</a>
  180. </td>
  181. </tr>
  182. <tr>
  183. <td class="shrink_top">* LIFF Context</td>
  184. <td class="expand_top"></td>
  185. </tr>
  186. <tr>
  187. <td class="shrink_context">liff.getOS()</td>
  188. <td class="expand" id="getOS">Loading . . .</td>
  189. </tr>
  190. <tr>
  191. <td class="shrink_context">liff.getLanguage()</td>
  192. <td class="expand" id="getLanguage">Loading . . .</td>
  193. </tr>
  194. <tr>
  195. <td class="shrink_context">liff.getVersion()</td>
  196. <td class="expand" id="getVersion">Loading . . .</td>
  197. </tr>
  198. <tr>
  199. <td class="shrink_context">liff.isInClient()</td>
  200. <td class="expand" id="isInClient">Loading . . .</td>
  201. </tr>
  202. <tr>
  203. <td class="shrink_context">liff.isLoggedIn()</td>
  204. <td class="expand" id="isLoggedIn">Loading . . .</td>
  205. </tr>
  206. <tr>
  207. <td class="shrink_context">liff.getAccessToken()</td>
  208. <td class="expand" id="getAccessToken">
  209. <button onclick="getAccessToken()">show AccessToken</button>
  210. </td>
  211. </tr>
  212. <tr>
  213. <td class="shrink_context">liff.getContext()</td>
  214. <td class="expand" id="">
  215. <button onclick="getContext()">show raw JSON Data</button>
  216. </td>
  217. </tr>
  218. <tr>
  219. <td class="shrink_context">| -> type</td>
  220. <td class="expand" id="context_type">Loading . . .</td>
  221. </tr>
  222. <tr>
  223. <td class="shrink_context">| -> viewType</td>
  224. <td class="expand" id="context_viewType">Loading . . .</td>
  225. </tr>
  226. <tr>
  227. <td class="shrink_context">| -> userId</td>
  228. <td class="expand" id="context_userId">Loading . . .</td>
  229. </tr>
  230. <tr>
  231. <td class="shrink_context">| -> utouId</td>
  232. <td class="expand" id="context_utouId">Loading . . .</td>
  233. </tr>
  234. <tr>
  235. <td class="shrink_context">| -> roomId</td>
  236. <td class="expand" id="context_roomId">Loading . . .</td>
  237. </tr>
  238. <tr>
  239. <td class="shrink_context">| -> groupId</td>
  240. <td class="expand" id="context_groupId">Loading . . .</td>
  241. </tr>
  242. </table>
  243. </div>
  244. <p id="load">Develop with ♡ by Siratee K.</p>
  245. <script src="https://static.line-scdn.net/liff/edge/2.1/sdk.js"></script>
  246. <script src="js/liff-init.js?1234"></script>
  247. <script src="js/liff-functions.js?12345"></script>
  248. </body>
  249. </html>