Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style>
- .column {
- /*float: left;*/
- display: inline-block;
- width: 50%;
- background-color: #fff;
- /* border-radius: 20px;*/
- padding: 10px;
- /*height: 743px!important;
- padding-left: 28px;
- MARGIN-LEFT: 18PX;
- margin-top: -50px;*/
- }
- .iconlocation {
- margin-bottom: unset;
- padding: 8px;
- margin-top: -5px;
- }
- .iconcol1 {
- margin-right: 15px;
- margin-left: 0px;
- margin-bottom: unset;
- background-color: #ff8001;
- padding: 8px;
- border-radius: 50%;
- height: 37px;
- width: 37px;
- margin-top: -8px;
- }
- .img-col1 img {
- /*border-radius: 12px;
- padding: -28px;*/
- width: 105%;
- height: 300px;
- margin-bottom:10px;
- /* margin-left: -5px;
- margin-top: -5px;*/
- }
- .loaction{
- display: flex;
- flex-direction: row;
- text-align: left;
- margin-top: 5px;
- margin-bottom: 5px;
- }
- .colroW1 {
- height: 55px;
- display: flex;
- /* align-items: flex-start; */
- flex-direction: row;
- text-align: left;
- padding: 16px 0px 10px 23px;
- background-color: #FEF3D9;
- border-style: solid;
- border-width: 1px 1px 1px 1px;
- border-color: #F8A63A;
- /* border-radius: 35px 35px 35px 35px;*/
- margin-top: 20px;
- }
- .textcol1 {
- font-family: "Amaranth", Sans-serif;
- font-size: 15px;
- font-weight: 600;
- }
- .textloaction{
- color:#9a9ab0;
- margin-bottom: 7px;
- font-family: var(--e-global-typography-accent-font-family), Sans-serif;
- font-size:14px !important;
- }
- }
- .elementor-kit-29 h2{}
- .H2textcol1{
- color: #11142D;
- font-family: var(--e-global-typography-33b1fac-font-family), Sans-serif;
- font-size:24px !important;
- text-align: left !important;
- line-height: var(--e-global-typography-33b1fac-line-height);
- letter-spacing: var(--e-global-typography-33b1fac-letter-spacing);
- word-spacing: var(--e-global-typography-33b1fac-word-spacing);
- }
- hr.solid {
- border-top: 1px solid #dadada;
- }
- .bage-topArea{
- background-color: #ff6600;
- text-align: center;
- color: #fff;
- padding: 10px;
- border-radius:15px 15px 0px 0px;
- /* height:40px; */
- font-size:20px;
- margin: -55px 0px 0px 0px;
- font-family: 'Amaranth';
- width: 31%;
- }
- .bage-bottomArea{
- 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';
- width: 28%;
- }
- /*.bage-topArea{
- background-color: #ff6600;text-align: center;color: #fff;padding: 10px;border-radius:15px 15px 0px 0px;/* height:40px; */
- /*font-size:20px;margin: -2px 0px 0px 0px;font-family: 'Amaranth';*/
- }
- /*.bage-bottomArea{*/
- /* 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';*/
- /*}*/
- .bageUI {
- position: absolute!important;
- width: 9% !important;
- top: -85px !important;
- }
- /*.bageUI {*/
- /*position: relative;*/
- /*width: 100px;*/
- /*top: 52px;*/
- /*left: 36px;*/
- /* display: inline-block;*/
- /* width: 100px;*/
- /* margin-left:37px;*/
- /*}*/
- div#apiData {
- text-align: center;
- }
- @media only screen and (min-width: 320px) and (max-width: 767px){
- .column {
- display: inline-block;
- width: 91%;
- padding: 20px;
- /*height: 672px!important;*/
- MARGIN-LEFT: 14PX;
- margin-bottom: 98px;
- }
- .img-col1 img {
- margin-left: 0px;
- border-radius: 19px;
- }
- .textcol1 {
- font-size: 13px;
- }
- .colroW1 {
- padding: 16px 0px 10px 19px;
- }
- .H2textcol1 {
- }
- .iconcol1 {
- margin-right: 11px;
- }
- }
- </style>
- <div id="apiData"></div>
- <script>
- async function fetchData() {
- let headersList = {
- "Accept": "*/*",
- "User-Agent": "",
- "Authorization": "Basic 976214ba4e83b14b9aed5fccabd614e1cc18ca770870d7210aa51d86e2300335"
- };
- try {
- let response = await fetch("https://api.onwajooba.com/plugin/events", {
- method: "GET",
- headers: headersList
- });
- let data = await response.json();
- // Create cards for each item in the array
- let cardsHtml = '';
- data.forEach(item => {
- if(item < 3){
- console.log('item: ', item);
- }
- console.log('item: ', item);
- var datte=item.startTimeStr ;
- const date = new Date(datte);
- let result=date.toDateString();
- const date1 = date.getDate();
- const month = date.toLocaleString('default', { month: 'short' });
- let time=date.toLocaleString('en-US', { hour: 'numeric', hour12: true });
- function english_ordinal_suffix(date1)
- {
- 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')));
- }
- let eng_date = english_ordinal_suffix(date);
- cardsHtml += `
- <link href='https://fonts.googleapis.com/css?family=Amaranth' rel='stylesheet'>
- <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" />
- <div class="column" style="background-color:#fff;">
- <!--div class="bageUI" style="">
- <h6 class="bage-topArea">${month}</h6>
- <h6 class="bage-bottomArea" style="">${eng_date}</h6>
- </div-->
- <div class="img-col1">
- <a href="${item.absEventUrl}">
- <img src= ${item.absImageUrl} alt="" width="250" height="300">
- </a>
- </div>
- <div class="elementor-widget-container">
- <img loading="lazy" decoding="async" width="1182" height="27" src="https://waqtgurus.com/clients/wp-content/uploads/2023/12/Divider-05.png" class="attachment-full size-full wp-image-1248" alt="" srcset="https://waqtgurus.com/clients/wp-content/uploads/2023/12/Divider-05.png 1182w, https://waqtgurus.com/clients/wp-content/uploads/2023/12/Divider-05-300x7.png 300w, https://waqtgurus.com/clients/wp-content/uploads/2023/12/Divider-05-1024x23.png 1024w, https://waqtgurus.com/clients/wp-content/uploads/2023/12/Divider-05-768x18.png 768w" sizes="(max-width: 1182px) 100vw, 1182px"> </div>
- <h2 class="H2textcol1">${item.name}</h2>
- <div class="loaction">
- <div class="iconlocation">
- <span class="elementor-icon-list-icon">
- <i aria-hidden="true" class="far fa-calendar" style="color:#9a9ab0"></i> </span>
- </div>
- <div class="textloaction">
- <span> ${result}</span> @ <span>${time}</span>
- </div>
- </div>
- <div class="loaction">
- <div class="iconlocation">
- <span class="elementor-icon-list-icon">
- <i aria-hidden="true" class="fas fa-map-marker-alt" style="color:#9a9ab0"></i>
- </span>
- </div>
- <div class="textloaction">
- <span> ${item.roomName} ${item.location}</span>
- </div>
- </div>
- </div>
- `;
- });
- // Insert the generated HTML into the page
- document.getElementById("apiData").innerHTML = cardsHtml;
- } catch (error) {
- console.error("Error fetching data:", error);
- }
- }
- // Call the function to fetch data when the page loads
- window.onload = fetchData;
- </script>
Advertisement
Add Comment
Please, Sign In to add comment