bapparabi

wazooba-even code

Sep 8th, 2024 (edited)
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.28 KB | None | 0 0
  1. <style>
  2. .column.sr {
  3. margin-top: 50px;
  4. }
  5. .column {
  6. /*float: left;*/
  7. display: inline-block;
  8. width: 31.33%;
  9. background-color: #fff;
  10. border-radius: 20px;
  11. padding: 20px;
  12. /*height: 743px!important;*/
  13. padding-left: 28px;
  14. MARGIN-LEFT: 18PX;
  15. margin-top: -50px;
  16. }
  17.  
  18. .iconlocation {
  19. margin-right: 15px;
  20. margin-left: -6px;
  21. margin-bottom: unset;
  22. padding: 8px;
  23. border-radius: 50%;
  24. height: 57px;
  25. width: 61px;
  26. margin-top: -5px;
  27. }
  28. .iconcol1 {
  29. margin-right: 15px;
  30. margin-left: 0px;
  31. margin-bottom: unset;
  32. background-color: #ff8001;
  33. padding: 8px;
  34. border-radius: 50%;
  35. height: 37px;
  36. width: 37px;
  37. margin-top: -8px;
  38. }
  39. .img-col1 img {
  40. border-radius: 12px;
  41. padding: -28px;
  42. width: 105%;
  43. height: 231px;
  44. margin-left: -5px;
  45. margin-top: -5px;
  46. }
  47.  
  48. .loaction{
  49. display: flex;
  50. flex-direction: row;
  51. text-align: left;
  52. margin-top: 20px;
  53. margin-bottom: 20px;
  54. }
  55. .colroW1 {
  56. height: 55px;
  57. display: flex;
  58. /* align-items: flex-start; */
  59. flex-direction: row;
  60. text-align: left;
  61. padding: 16px 0px 10px 23px;
  62. background-color: #FEF3D9;
  63. border-style: solid;
  64. border-width: 1px 1px 1px 1px;
  65. border-color: #F8A63A;
  66. border-radius: 35px 35px 35px 35px;
  67. margin-top: 20px;
  68. }
  69.  
  70. .textcol1 {
  71. font-family: "Amaranth", Sans-serif;
  72. font-size: 15px;
  73. font-weight: 600;
  74. }
  75. .textloaction{
  76.  
  77. margin-bottom: 7px;
  78. color: #ff8001;
  79. font-family: "Amaranth", Sans-serif;
  80. font-size: 13px;
  81. font-weight: bold;
  82.  
  83.  
  84. }
  85. .H2textcol1{
  86. color: #252641;
  87. font-family: "Amaranth";
  88. font-size: 17px;
  89. font-weight: 600;
  90. margin-left: 17px;
  91. margin-top: 20px;
  92. }
  93. hr.solid {
  94. border-top: 1px solid #dadada;
  95. }
  96. .bage-topArea{
  97. background-color: #ff6600;
  98. text-align: center;
  99. color: #fff;
  100. padding: 10px;
  101. border-radius:15px 15px 0px 0px;
  102. /* height:40px; */
  103. font-size:20px;
  104. margin: -55px 0px 0px 0px;
  105. font-family: 'Amaranth';
  106. width: 31%;
  107. }
  108. .bage-bottomArea{
  109. background-color: #fff;text-align: center;color: #000;margin-top: -16px;padding: 10px;border-radius:0px 0px 15px 15px;font-size:20px;margin:0px 0px 0px 0px;font-family: 'Amaranth';
  110. width: 28%;
  111. }
  112. /*.bage-topArea{
  113. background-color: #ff6600;text-align: center;color: #fff;padding: 10px;border-radius:15px 15px 0px 0px;/* height:40px; */
  114. /*font-size:20px;margin: -2px 0px 0px 0px;font-family: 'Amaranth';*/
  115. }*/
  116. /*.bage-bottomArea{*/
  117. /* background-color: #fff;text-align: center;color: #000;margin-top: -16px;padding: 10px;border-radius:0px 0px 15px 15px;font-size:20px;margin:0px 0px 0px 0px;font-family: 'Amaranth';*/
  118. /*}*/
  119. .bageUI {
  120. position: absolute!important;
  121. width: 9% !important;
  122. top: -85px !important;
  123. }
  124. /*.bageUI {*/
  125. /*position: relative;*/
  126. /*width: 100px;*/
  127. /*top: 52px;*/
  128. /*left: 36px;*/
  129. /* display: inline-block;*/
  130. /* width: 100px;*/
  131. /* margin-left:37px;*/
  132. /*}*/
  133. div#apiData {
  134.  
  135. text-align: center;
  136. }
  137. @media only screen and (min-width: 320px) and (max-width: 767px){
  138. .column {
  139. display: inline-block;
  140. width: 91%;
  141.  
  142. padding: 20px;
  143. /*height: 672px!important;*/
  144.  
  145. MARGIN-LEFT: 14PX;
  146. margin-bottom: 98px;
  147. }
  148.  
  149. .img-col1 img {
  150.  
  151. margin-left: 0px;
  152. border-radius: 19px;
  153.  
  154. }
  155. .textcol1 {
  156. font-size: 13px;
  157.  
  158. }
  159. .colroW1 {
  160.  
  161. padding: 16px 0px 10px 19px;
  162. }
  163. .H2textcol1 {
  164. }
  165. .iconcol1 {
  166. margin-right: 11px;
  167.  
  168. }
  169. }
  170. </style>
  171. <div id="apiData"></div>
  172.  
  173. <script>
  174. async function fetchData() {
  175. let headersList = {
  176. "Accept": "*/*",
  177. "User-Agent": "",
  178. "Authorization": "Basic fba1985e99c0860dcdae338d37ff102ee8b840ad6a1bec0bace51071a56f0ede"
  179. };
  180.  
  181. try {
  182. let response = await fetch("https://api.onwajooba.com/plugin/events", {
  183. method: "GET",
  184. headers: headersList
  185. });
  186. let data = await response.json();
  187.  
  188. // Create cards for each item in the array
  189. let cardsHtml = '';
  190. data.forEach(item => {
  191.  
  192. if(item < 3){
  193.  
  194. console.log('item: ', item);
  195. }
  196. console.log('item: ', item);
  197. var datte=item.startTimeStr ;
  198.  
  199. const date = new Date(datte);
  200. let result=date.toDateString();
  201. const date1 = date.getDate();
  202. const month = date.toLocaleString('default', { month: 'short' });
  203. let time=date.toLocaleString('en-US', { hour: 'numeric', hour12: true });
  204. function english_ordinal_suffix(date1)
  205. {
  206. return date.getDate()+(date.getDate() % 10 == 1 && date.getDate() != 11 ? 'st' : (date.getDate() % 10 == 2 && date.getDate() != 12 ? 'nd' : (date.getDate() % 10 == 3 && date.getDate() != 13 ? 'rd' : 'th')));
  207. }
  208. let eng_date = english_ordinal_suffix(date);
  209.  
  210. cardsHtml += `
  211. <link href='https://fonts.googleapis.com/css?family=Amaranth' rel='stylesheet'>
  212. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
  213.  
  214.  
  215.  
  216.  
  217.  
  218. <div class="column sr" style="background-color:#fff;">
  219. <div class="bageUI" style="">
  220. <h6 class="bage-topArea">${month}</h6>
  221. <h6 class="bage-bottomArea" style="">${eng_date}</h6>
  222. </div>
  223. <div class="img-col1">
  224. <a href="${item.absEventUrl}">
  225. <img src= ${item.absImageUrl} alt="" width="250" height="300">
  226. </a>
  227. </div>
  228. <div class="colroW1">
  229. <div class="iconcol1">
  230. <span>
  231. <!-- <i class="fa-solid fa-calendar-days" style="color: #ff8001;" ></i> -->
  232. <i class="fa-solid fa-calendar-days" style="color: #ffffff;font-size: 20px;
  233. padding-left: 1px;"
  234. ></i>
  235. </span>
  236. </div>
  237. <div class="textcol1">
  238. <span> ${result}</span> @ <span>${time}</span>
  239. </div>
  240.  
  241. </div>
  242. <a href="${item.absEventUrl}">
  243. <h2 class="H2textcol1">${item.name}</h2>
  244. </a>
  245. <hr class="solid">
  246.  
  247. <div class="loaction">
  248. <div class="iconlocation">
  249. <img src="https://mmatlanta.org/wp-content/uploads/2024/02/placeholder-3.png" alt="" >
  250. </span>
  251. </div>
  252. <div class="textloaction">
  253.  
  254. <span> ${item.roomName} ${item.location}</span>
  255.  
  256. </div>
  257.  
  258. </div>
  259. </div>
  260.  
  261.  
  262.  
  263.  
  264. `;
  265.  
  266.  
  267. });
  268.  
  269. // Insert the generated HTML into the page
  270. document.getElementById("apiData").innerHTML = cardsHtml;
  271. } catch (error) {
  272. console.error("Error fetching data:", error);
  273. }
  274. }
  275.  
  276. // Call the function to fetch data when the page loads
  277. window.onload = fetchData;
  278. </script>
Advertisement
Add Comment
Please, Sign In to add comment