x x x
Only portrait mode is currently supported - please rotate your device.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

HTML
<style>
#unpublished-events .conf-macro.output-block[data-macro-name=confiform-cleanview] {
    padding: 0px 35px;
    display: grid;
    grid-template-columns: repeat(auto-fill, 280px);
    grid-gap: 20px;
    height: auto !important;
    justify-content: space-evenly;
}
</style>


Show If
useralex@gsvlabs.com


HTML
 <script>
  const getMinutesUntilEventStart = (startDate) => {
    let nowDate = new Date();
    let eventStartDate = new Date(startDate);

    let diffMilliseconds = eventStartDate.getTime() - nowDate.getTime();
    let diffMinutes =  (diffMilliseconds / 60000);
    console.log("Difference in Minutes:", diffMinutes);

    return diffMinutes;
  }

  window.addEventListener('load', () => {
    let upcomingEvents = document.getElementById('scroll-section-1');
    let upcomingCards = Array.from(upcomingEvents.getElementsByClassName('eventcard'));

    for (let i = 0; i < upcomingCards.length; i++) {
      let currCard = upcomingCards[i];
      let currCardStart = currCard.dataset.startdate;
      let minsTilStart = getMinutesUntilEventStart(currCardStart);
      if (minsTilStart < 0) {
        let liveEl = document.createElement("div");
        liveEl.classList.add('live-circle');
        liveEl.innerText = "LIVE";
        currCard.insertAdjacentElement('afterbegin', liveEl);
      }  
    }
  });
</script>
<style>
  .live-circle {
    font-size: 14px;
    padding: 10px;
    text-transform: uppercase;
    font-weight: bold;
    background-color: brown;
    border-radius: 40%;
    color: white;
  }
</style>