event.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
  8. <META HTTP-EQUIV="Expires" CONTENT="-1">
  9. <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
  10. <title>WHAT'S NEXT 永續峰會|NFT方舟加密藝術跨界直播-「風」 | ARK Cards</title>
  11. <link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />
  12. <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet"
  13. integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
  14. <link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.css" />
  15. <link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick-theme.css" />
  16. <link rel="stylesheet" href="./style.css">
  17. </head>
  18. <body>
  19. <section id="sec01" class="sec01 container-fluid px-0 mx-0 mb-5">
  20. <div class="card bg-transparent text-white border-0">
  21. <img src="./img/1618431559-GettyImages-1309739877.jpg" class="img-fluid" alt="...">
  22. <div style="position: relative;" class="card-img-overlay p-0 d-flex align-items-end justify-content-center">
  23. <h5 style="background: rgba(0,0,0,0.7); font-size: 16px; position: absolute; z-index: 20;" class="card-title p-4 w-50 text-center fw-bold">現場活動好康</h5>
  24. </div>
  25. </div>
  26. </section>
  27. <form class="nft-event" action="">
  28. <section id="sec05-moblie" class="sec05 my-4">
  29. <div class="sec05-moblie container-fluid">
  30. <div class="sec05-moblie-header">
  31. <h1 class="secn-title ps-2">您可以獲得台北方舟「風」通行證 + 港記酥皇 NFT</h1>
  32. </div>
  33. <p class="text-start mb-2">※ 點選【同意接收】按鈕,即可獲得</p>
  34. <p class="text-start mb-2">※ 若於取得贈送之「風」通行證 + 港記酥皇 NFT後,發送給他人,將不會再重覆贈送</p>
  35. <div class="sec06-nft-mall row row-cols-1 row-cols-md-4 g-4">
  36. <div class="col">
  37. <div class="card h-100">
  38. <!-- <a class="event-nft-send mb-2" target="_blank">
  39. <img src="https://ark.cards/img/nft/wind.png" class="card-img-top" alt="風的通行證">
  40. </a> -->
  41. <video loop autoplay muted style="width:100%;">
  42. <source src="https://ark.cards/img/nft/wind.mp4" type="video/mp4">
  43. Your browser does not support the video tag.
  44. </video>
  45. <div class="mt-3" style="background-color:#231D20;">
  46. <video loop autoplay muted style="width:100%;">
  47. <source src="https://ark.cards/img/nft/kongkee.mp4" type="video/mp4">
  48. Your browser does not support the video tag.
  49. </video>
  50. </div>
  51. <div class="card-body text-center">
  52. <div class="mb-3">
  53. <input type="email" class="mb-1 form-control" id="email" placeholder="請輸入您的Email">
  54. <div class="text-danger small" style="text-align: left;">* 會發送合約地址至您指定的Email</div>
  55. </div>
  56. <input class="d-none" id="userid">
  57. <button type="submit" class="btn btn-primary">同意接收</button>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </section>
  64. </form>
  65. <footer style="background: #484848;" class="py-4 w-100 px-0 mx-0">
  66. <p class="text-white text-center mb-0">Copyright 2021 版權所有 © Ark.Cards</p>
  67. </footer>
  68. <script src="https://unpkg.com/aos@next/dist/aos.js"></script>
  69. <script>
  70. AOS.init();
  71. </script>
  72. <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js"
  73. integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p"
  74. crossorigin="anonymous"></script>
  75. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.min.js"
  76. integrity="sha384-Atwg2Pkwv9vp0ygtn1JAojH0nYbwNJLPhwyoVbhoPwBhjQPR5VtM2+xf0Uwh9KtT"
  77. crossorigin="anonymous"></script>
  78. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  79. <script type="text/javascript" src="//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js"></script>
  80. <script src="./goto.js"></script>
  81. <script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
  82. <script charset="utf-8" src="https://static.line-scdn.net/liff/edge/2/sdk.js"></script>
  83. </body>
  84. <script>
  85. // 「風」通行證 + 「港記酥皇」已送出訊息通知
  86. function nft_sent_message() {
  87. Swal.fire({
  88. icon: 'success',
  89. confirmButtonColor: '#3085d6',
  90. html: '加入 Ark Cards 好友</p>點擊【我的NFT收藏】</p>即可收到「風」通行證 + 「港記酥皇」'
  91. }).then((result) => {
  92. if (result.isConfirmed) {
  93. window.location.replace('https://liff.line.me/1645278921-kWRPP32q/?accountId=067ztnge');
  94. }
  95. });
  96. }
  97. // Email格式檢查
  98. function validate_email(email) {
  99. const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
  100. return re.test(String(email).toLowerCase());
  101. }
  102. // 點擊「同意接收」按鈕
  103. $(".nft-event").submit(function (e) {
  104. var email = $('#email').val();
  105. var userid = $('#userid').val();
  106. console.log('email = ' + email + ', userid = ' + userid); // test
  107. // Email欄位必填檢查
  108. if (email == "") { // 未輸入Email
  109. Swal.fire({
  110. title: '注意!',
  111. icon: 'error',
  112. confirmButtonColor: '#3085d6',
  113. html: '請先輸入Email<p><p>我們會發送合約地址至您指定的Email'
  114. });
  115. return false;
  116. } else {
  117. if (!validate_email(email)) {
  118. Swal.fire({
  119. title: 'Email格式錯誤',
  120. icon: 'error',
  121. confirmButtonColor: '#3085d6',
  122. html: '請輸入正確的Email<p><p>我們會發送合約地址至您指定的Email'
  123. });
  124. return false;
  125. }
  126. }
  127. var jsonInfo = {"email": email, "userid": userid};
  128. var jsonString = JSON.stringify(jsonInfo);
  129. console.log(jsonString);
  130. $.ajax({
  131. type: 'POST',
  132. url: 'https://api.ptt.cx:8750/api/v1/line/event',
  133. data: jsonString,
  134. dataType: 'json',
  135. async: false,
  136. success: function (data) {
  137. console.log('送出成功: ' + JSON.stringify(data));
  138. // 呼叫fastAPI,贈送「風」通行證 + 「港記酥皇」
  139. nft_sent_message();
  140. },
  141. beforeSend: function () {
  142. console.log('beforeSend');
  143. },
  144. complete: function () {
  145. console.log('complete');
  146. },
  147. error: function (jqXHR, textStatus, errorThrown) {
  148. console.log(JSON.stringify(jqXHR));
  149. console.log("AJAX errr: " + textStatus + ' : ' + errorThrown);
  150. console.log('送出失敗: ' + jqXHR.responseText);
  151. }
  152. });
  153. return false;
  154. });
  155. $(document).ready(function () {
  156. // 取得liff_id
  157. liff.init({
  158. liffId: "1656404434-DoEqYOad"
  159. })
  160. .then(() => {
  161. var context = liff.getContext();
  162. console.log(context);
  163. var profile = liff.getProfile();
  164. console.log(profile);
  165. // login
  166. if (!liff.isLoggedIn()) {
  167. console.log("您未登入");
  168. console.log('context.userId = ' + context.userId); // test
  169. liff.login({ redirectUri: "https://ark.cards/event.html" }); // test
  170. } else {
  171. console.log("您已登入");
  172. }
  173. $('#userid').val(context.userId);
  174. })
  175. .catch((err) => {
  176. console.log('初始化失敗: ' + err.code + ", " + err.message);
  177. });
  178. });
  179. </script>
  180. </html>