<div class="efl-global-notifications-tray" aria-expanded="false" data-behavior="efl-global-notifications-tray">
    <div class="efl-global-notifications-tray__container">
        <div class="efl-global-notifications-tray__new-notification">
            <div class="efl-global-notifications-tray__wrapper">
                <button class="efl-global-notifications-tray__close"></button>
                <div class="efl-global-notifications-tray__wrapper--title">
                    <div class="heading">Notifications</div>
                </div>
                <div class="efl-global-notifications-tray__wrapper--items">
                    <div class="efl-global-notifications priority-1 " data-icon-type="priority-1" data-behavior="efl-global-notifications" data-notification-id="1">
                        <div class="efl-global-notifications__wrapper">
                            <button class="efl-global-notifications__close"></button>
                            <div class="efl-global-notifications__wrapper--icon">
                                <canvas class="notifications-icon rive-priority-1" width="60" height="60"></canvas>
                            </div>
                            <div class="efl-global-notifications__wrapper--info">
                                <div class="efl-global-notifications__section">
                                    <div class="title">The notification title goes here</div>
                                    <p data-copy="The notification message Example. This is a reminder that on the 00/00/00 at 0 PM to">The notification message Example. This is a reminder that on the 00/00/00 at 0 PM to</p>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="efl-global-notifications priority-2 " data-icon-type="priority-2" data-behavior="efl-global-notifications" data-notification-id="2">
                        <div class="efl-global-notifications__wrapper">
                            <button class="efl-global-notifications__close"></button>
                            <div class="efl-global-notifications__wrapper--icon">
                                <canvas class="notifications-icon rive-priority-2" width="60" height="60"></canvas>
                            </div>
                            <div class="efl-global-notifications__wrapper--info">
                                <div class="efl-global-notifications__section">
                                    <div class="title">The notification title goes here</div>
                                    <p data-copy="Improve your knowledge and management skills when dealing with team crisis and earn your badge">Improve your knowledge and management skills when dealing with team crisis and earn your badge</p>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="efl-global-notifications priority-3 " data-icon-type="priority-3" data-behavior="efl-global-notifications" data-notification-id="3">
                        <div class="efl-global-notifications__wrapper">
                            <button class="efl-global-notifications__close"></button>
                            <div class="efl-global-notifications__wrapper--icon">
                                <canvas class="notifications-icon rive-priority-3" width="60" height="60"></canvas>
                            </div>
                            <div class="efl-global-notifications__wrapper--info">
                                <div class="efl-global-notifications__section">
                                    <div class="title">Complete your profile</div>
                                    <p data-copy="Just a few more steps to go!">Just a few more steps to go!</p>
                                </div>
                                <div class="efl-global-notifications__completion" data-profile-completion="0%">
                                    <div class="efl-global-notifications__completion--info">
                                        <div class="status">
                                            <img src="/assets/example-content/global-notification/profile-not-completed.svg" data-completed-img="/assets/example-content/global-notification/profile-completed.svg" alt="" />
                                            <span>Upload profile picture</span>
                                            <a href="#" class="cta cta--primary  add-cta" tabindex="0">Add</a>

                                        </div>
                                        <div class="status">
                                            <img src="/assets/example-content/global-notification/profile-not-completed.svg" data-completed-img="/assets/example-content/global-notification/profile-completed.svg" alt="" />
                                            <span>About me</span>
                                            <a href="#" class="cta cta--primary  add-cta" tabindex="0">Add</a>

                                        </div>
                                        <div class="status">
                                            <img src="/assets/example-content/global-notification/profile-not-completed.svg" data-completed-img="/assets/example-content/global-notification/profile-completed.svg" alt="" />
                                            <span>My previous experience</span>
                                            <a href="#" class="cta cta--primary  add-cta" tabindex="0">Add</a>

                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <a class="efl-global-notifications-tray__wrapper--morelink"></a>
            </div>
            <div class="efl-global-notifications-tray__shadow1"></div>
            <div class="efl-global-notifications-tray__shadow2"></div>
        </div>
        <div class="efl-global-notifications-tray__no-notification hidden">
            <div class="efl-global-notifications-tray__wrapper">
                <button class="efl-global-notifications-tray__close"></button>
                <div class="efl-global-notifications-tray__wrapper--no-notification">
                    <div class="no-notification-icon">
                        <canvas id="no-notification-rive" width="60" height="60"></canvas>
                    </div>
                    <div class="no-notification">You dont have any notifications right now</div>
                    <p>We will alert you once something comes up</p>
                </div>
            </div>
        </div>
    </div>
</div>

No notes defined.

{
  "notification": false,
  "notification1": {
    "title": "The notification title goes here",
    "notification-id": "1"
  },
  "notification2": {
    "title": "The notification title goes here",
    "notification-id": "2"
  },
  "notification3": {
    "notification-id": "3"
  },
  "notification4": {
    "notification-id": "4"
  }
}
  • Content:
    import { Rive, Fit, Layout } from '@rive-app/canvas';
    import { notificationAnimation } from '../efl-global-notifications/efl-global-notifications';
    
    export default parentElement => {
      const notificationIcon = document.querySelector(
        '.global-site-navigation__level1.site-notification > a'
      );
      const MOBILE_BREAKPOINT = 820;
      const body = document.querySelector('body');
      const hamburger = document.querySelector('[aria-controls="main-nav"]');
      const closeBtns = parentElement.querySelectorAll(
        '.efl-global-notifications-tray__close'
      );
      const moreLink = parentElement.querySelector(
        '.efl-global-notifications-tray__wrapper--morelink'
      );
      const notifications = parentElement.querySelectorAll(
        '.efl-global-notifications'
      );
      const noNotificationIcon = parentElement.querySelector(
        '#no-notification-rive'
      );
      const noNotification = parentElement.querySelector(
        '.efl-global-notifications-tray__no-notification'
      );
      const newNotification = parentElement.querySelector(
        '.efl-global-notifications-tray__new-notification'
      );
      const notificationcloseBtn = parentElement.querySelectorAll(
        '.efl-global-notifications__close'
      );
      const totalActiveNotification = parentElement.querySelectorAll(
        '.efl-global-notifications:not(.hidden)'
      );
      const notifyBell = document.querySelector(
        '.global-site-navigation__level1.site-notification'
      );
      const shadow1 = parentElement.querySelector(
        '.efl-global-notifications-tray__shadow1'
      );
      const shadow2 = parentElement.querySelector(
        '.efl-global-notifications-tray__shadow2'
      );
    
      const loadFirstNotification = () => {
        const notHiddenNotification = parentElement.querySelectorAll(
          '.efl-global-notifications:not(.hidden)'
        );
        const hiddenNotification = parentElement.querySelectorAll(
          '.efl-global-notifications.hidden'
        );
        const firstNotification = notHiddenNotification[0];
        const moreNotifications = notHiddenNotification.length;
    
        if (moreLink) {
          moreLink.innerHTML = `${moreNotifications - 1} more notifications`;
        }
    
        if (hiddenNotification) {
          hiddenNotification.forEach(element => {
            element.classList.remove('firstNotification');
          });
        }
        if (firstNotification) {
          firstNotification.classList.add('firstNotification');
        }
    
        const priorityThree = parentElement.querySelector(
          '.efl-global-notifications.priority-3.firstNotification'
        );
    
        setTimeout(() => {
          if (priorityThree && window.innerWidth > MOBILE_BREAKPOINT) {
            parentElement.style.maxHeight = '355px'; // eslint-disable-line no-param-reassign
          } else {
            parentElement.style.maxHeight = ''; // eslint-disable-line no-param-reassign
          }
        }, 300);
      };
    
      const loadNoNotification = () => {
        const total = parentElement.querySelectorAll(
          '.efl-global-notifications:not(.hidden)'
        );
    
        if (!total.length) {
          const lyout = new Layout({
            fit: Fit.Cover,
          });
    
          const riveAnimation = new Rive({
            src: '/assets/example-content/quiz_notification.riv',
            canvas: noNotificationIcon,
            layout: lyout,
            onLoad: () => {
              riveAnimation.resizeDrawingSurfaceToCanvas();
            },
          });
    
          riveAnimation.play('Active');
        } else {
          const firstNotification = notifications[0];
          const { iconType } = firstNotification.dataset;
          const riveCanvas = document.createElement('canvas');
          const riveDiv = firstNotification.querySelector(
            '.efl-global-notifications__wrapper--icon'
          );
    
          riveDiv.innerHTML = '';
    
          riveCanvas.width = '60';
          riveCanvas.height = '60';
          riveCanvas.id = `rive-notification-0`;
          riveCanvas.className = `rive-${iconType}`;
          riveDiv.appendChild(riveCanvas);
    
          notificationAnimation(parentElement, iconType, riveCanvas);
        }
      };
    
      const NotificationMarkAsRead = () => {
        let eflGlobalNotifications = [];
    
        totalActiveNotification.forEach(item => {
          const { notificationId } = item.dataset;
          const notificationDetail = `{"id": "${notificationId}","read": true,"close": false}`;
    
          if (localStorage.getItem('eflGlobalNotifications')) {
            eflGlobalNotifications = JSON.parse(
              localStorage.getItem('eflGlobalNotifications')
            );
            const idExist = eflGlobalNotifications.find(
              val => val.id === notificationId
            );
    
            if (!idExist) {
              eflGlobalNotifications[eflGlobalNotifications.length] = JSON.parse(
                notificationDetail
              );
              localStorage.setItem(
                'eflGlobalNotifications',
                JSON.stringify(eflGlobalNotifications)
              );
            }
    
            if (idExist) {
              item.classList.add('read');
            }
          } else {
            localStorage.setItem(
              'eflGlobalNotifications',
              `[${notificationDetail}]`
            );
          }
        });
        if (notifyBell) {
          notifyBell.classList.remove('new');
        }
      };
    
      const isNewNotification = () => {
        const eflGlobalNotifications = localStorage.getItem(
          'eflGlobalNotifications'
        );
    
        if (eflGlobalNotifications) {
          const notificationJson = JSON.parse(
            localStorage.getItem('eflGlobalNotifications')
          );
          let count = 0;
          let moreNotify = totalActiveNotification.length;
    
          totalActiveNotification.forEach(item => {
            const { notificationId } = item.dataset;
    
            notificationJson.forEach(val => {
              if (val.id === `${notificationId}`) {
                count += 1;
              }
              if (val.id === `${notificationId}` && val.close === true) {
                item.classList.add('hidden');
                moreNotify -= 1;
              }
              if (val.id === `${notificationId}` && val.read === true) {
                item.classList.add('read');
    
                if (item.classList.contains('priority-3')) {
                  const profileLinks = item.querySelectorAll('.status');
    
                  profileLinks.forEach(link => {
                    if (!link.querySelector('a')) {
                      link.classList.add('completed');
                    } else {
                      link.classList.remove('completed');
                    }
                  });
                }
              }
            });
          });
    
          if (totalActiveNotification.length > count && notifyBell) {
            notifyBell.classList.add('new');
          } else if (totalActiveNotification.length === count && notifyBell) {
            notifyBell.classList.remove('new');
          }
    
          if (moreLink) {
            moreLink.innerHTML = `${moreNotify - 1} more notifications`;
          }
    
          if (moreNotify === 0) {
            noNotification.classList.remove('hidden');
            newNotification.classList.add('hidden');
          } else {
            noNotification.classList.add('hidden');
            newNotification.classList.remove('hidden');
          }
        } else if (!totalActiveNotification.length && notifyBell) {
          notifyBell.classList.remove('new');
          noNotification.classList.remove('hidden');
          newNotification.classList.add('hidden');
        }
      };
    
      if (notificationIcon) {
        notificationIcon.addEventListener('click', e => {
          e.preventDefault();
          isNewNotification();
    
          if (window.innerWidth < MOBILE_BREAKPOINT) {
            body.classList.remove('navigation-open');
            body.classList.remove('navigation-open--main');
            const mobileNavigation = document.querySelector(
              '.global-site-navigation'
            );
            const bottomLink = document.querySelector(
              '.global-site-navigation__bottom-link'
            );
    
            if (hamburger) {
              hamburger.setAttribute('aria-expanded', 'false');
            }
            setTimeout(() => {
              mobileNavigation.classList.add('mobile-navigation-closed');
              if (bottomLink) {
                bottomLink.classList.add('hidden');
              }
            }, 300);
            setTimeout(() => {
              parentElement.classList.add('sliding');
              parentElement.classList.add('active');
              loadNoNotification();
              loadFirstNotification();
            }, 301);
            setTimeout(() => {
              parentElement.classList.remove('sliding');
            }, 600);
          } else {
            parentElement.classList.add('sliding');
            parentElement.classList.add('active');
            loadNoNotification();
            loadFirstNotification();
            setTimeout(() => {
              parentElement.classList.remove('sliding');
            }, 300);
          }
    
          const totalNotifications = parentElement.querySelectorAll(
            '.efl-global-notifications:not(.hidden)'
          );
    
          if (totalNotifications.length === 1) {
            const activeNotification = parentElement.querySelector(
              '.efl-global-notifications:not(.hidden)'
            );
    
            NotificationMarkAsRead();
    
            if (moreLink) {
              moreLink.classList.add('hidden');
            }
            shadow1.classList.add('hidden');
            shadow2.classList.add('hidden');
    
            closeBtns[0].classList.add('hidden');
            notificationcloseBtn.forEach(btn => {
              btn.style.display = 'flex'; // eslint-disable-line no-param-reassign
              btn.style.top = '0'; // eslint-disable-line no-param-reassign
              activeNotification.querySelector(
                '.efl-global-notifications__wrapper'
              ).style.marginBottom = '16px'; // eslint-disable-line no-param-reassign
            });
          }
        });
        if (moreLink) {
          moreLink.classList.remove('hidden');
        }
      }
    
      closeBtns.forEach(btn => {
        btn.addEventListener('click', e => {
          e.preventDefault();
          parentElement.classList.add('sliding');
    
          if (window.innerWidth < MOBILE_BREAKPOINT) {
            const notificationDescription = parentElement.querySelectorAll(
              '.efl-global-notifications__section p'
            );
    
            notificationDescription.forEach(currentEle => {
              if (currentEle.innerHTML.length > 60) {
                const description = currentEle.innerHTML.substring(0, 70);
    
                currentEle.innerHTML = description; // eslint-disable-line no-param-reassign
                const readMoreSpan = document.createElement('span');
    
                currentEle.appendChild(readMoreSpan);
                readMoreSpan.className = 'read-more';
                readMoreSpan.innerHTML = 'Read More';
                currentEle.style.overflow = ''; // eslint-disable-line no-param-reassign
                currentEle.style.display = ''; // eslint-disable-line no-param-reassign
    
                const readMorebtn = parentElement.querySelectorAll('.read-more');
    
                readMorebtn.forEach(cta => {
                  cta.addEventListener('click', event => {
                    event.preventDefault();
                    const getDescription = event.target.closest(
                      '.efl-global-notifications__section p'
                    );
                    const dataCopyValue = getDescription.getAttribute('data-copy');
    
                    getDescription.style.overflow = 'unset'; // eslint-disable-line no-param-reassign
                    getDescription.style.display = 'block'; // eslint-disable-line no-param-reassign
                    getDescription.innerHTML = dataCopyValue; // eslint-disable-line no-param-reassign
                  });
                });
              }
            });
          }
    
          setTimeout(() => {
            parentElement.classList.remove('sliding');
            parentElement.classList.remove('active');
            parentElement.setAttribute('aria-expanded', 'false');
            if (moreLink) {
              moreLink.classList.remove('hidden');
            }
          }, 300);
        });
      });
    
      if (notificationcloseBtn) {
        notificationcloseBtn.forEach(btn => {
          btn.addEventListener('click', e => {
            e.preventDefault();
    
            const notificationJson = JSON.parse(
              localStorage.getItem('eflGlobalNotifications')
            );
            const { notificationId } = btn.closest(
              '.efl-global-notifications'
            ).dataset;
    
            notificationJson.forEach((val, index) => {
              if (val.id === `${notificationId}`) {
                notificationJson[index] = JSON.parse(`{
                  "id": "${notificationId}",
                  "read": true,
                  "close": true
                }`);
              }
            });
    
            localStorage.setItem(
              'eflGlobalNotifications',
              JSON.stringify(notificationJson)
            );
    
            const total = parentElement.querySelectorAll(
              '.efl-global-notifications:not(.hidden)'
            ).length;
    
            if (!total) {
              noNotification.classList.remove('hidden');
              newNotification.classList.add('hidden');
    
              loadNoNotification();
            }
          });
        });
      }
    
      if (moreLink) {
        moreLink.addEventListener('click', e => {
          e.preventDefault();
          const imageWidth = '60';
          const imageHeight = '60';
    
          notifications.forEach((element, index) => {
            const riveCanvas = document.createElement('canvas');
            const riveDiv = element.querySelector(
              '.efl-global-notifications__wrapper--icon'
            );
            const { iconType } = element.dataset;
    
            riveDiv.innerHTML = '';
    
            riveCanvas.width = imageWidth;
            riveCanvas.height = imageHeight;
            riveCanvas.id = `rive-notification-${index}`;
            riveCanvas.className = `rive-${iconType}`;
            riveDiv.appendChild(riveCanvas);
    
            notificationAnimation(element, iconType, riveCanvas);
          });
          parentElement.setAttribute('aria-expanded', 'true');
          moreLink.classList.add('hidden');
    
          NotificationMarkAsRead();
        });
      }
    
      document.addEventListener('click', e => {
        if (
          !e.target.closest(
            '.global-site-navigation__level1.site-notification > a'
          ) &&
          !e.target.closest('.efl-global-notifications-tray')
        ) {
          if (parentElement && window.innerWidth > MOBILE_BREAKPOINT) {
            parentElement.classList.add('sliding');
            setTimeout(() => {
              parentElement.classList.remove('sliding');
              parentElement.classList.remove('active');
              parentElement.setAttribute('aria-expanded', 'false');
              if (moreLink) {
                moreLink.classList.remove('hidden');
              }
            }, 300);
          }
        }
      });
    
      if (window.innerWidth > MOBILE_BREAKPOINT) {
        window.addEventListener('scroll', () => {
          const globalNotification = document.querySelector('.global-fixed-header');
          const topGap = '-114px';
    
          if (globalNotification.style.top === topGap) {
            parentElement.style.top = '22px'; // eslint-disable-line no-param-reassign
          } else {
            parentElement.style.top = ''; // eslint-disable-line no-param-reassign
          }
        });
      }
    
      isNewNotification();
    };
    
  • URL: /components/raw/efl-global-notifications-tray/efl-global-notifications-tray.js
  • Filesystem Path: src/library/components/efl-global-notifications-tray/efl-global-notifications-tray.js
  • Size: 14.7 KB
  • Content:
    .efl-global-notifications-tray {
      max-width: calc(100vw - 16px);
      position: fixed;
      width: 100vw;
      z-index: 9999999999;
      height: 100%;
      max-height: 19.2rem;
      bottom: -46.1rem;
      transition: bottom 0.6s cubic-bezier(0.16, 1, 0.3, 1);
      left: 8px;
      display: none;
      &__container {
        position: relative;
        width: inherit;
        height: inherit;
      }
    
      /* width */
      ::-webkit-scrollbar {
        width: 4px;
      }
    
      /* Track */
      ::-webkit-scrollbar-track {
        background: $white;
      }
    
      /* Handle */
      ::-webkit-scrollbar-thumb {
        background: $grey-light;
      }
    
      /* Handle on hover */
      ::-webkit-scrollbar-thumb:hover {
        background: $grey-light;
      }
      &__wrapper {
        display: flex;
        position: absolute;
        flex-direction: column;
        background: $white;
        border-radius: 0.8rem 0.8rem 0 0;
        box-shadow: 0 4px 24px rgba(98, 95, 95, 0.4);
        padding: 1.6rem;
        padding-top: 3.2rem;
        z-index: 5;
        bottom: 0;
        width: 100%;
        .efl-global-notifications {
          border: none;
          filter: initial;
          canvas {
            &.rive-priority-1,
            &.rive-priority-2 {
              width: 6rem;
              height: 6rem;
              top: -5px;
            }
            &.rive-priority-3 {
              width: 7.5rem;
              height: 7.5rem;
              left: -10px;
              top: -10px;
            }
          }
        }
        & > button {
          display: flex;
          justify-content: center;
          align-items: center;
          border: none;
          cursor: pointer;
          background-color: transparent;
          color: $blue;
          padding: 0.5rem;
          position: absolute;
          right: 1.6rem;
          z-index: 1;
    
          &:hover {
            background-color: $grey-light;
          }
    
          &::after {
            content: '';
            display: block;
            width: 2.4rem;
            height: 2.4rem;
            background: url('./assets/images/tray-close.svg') no-repeat center;
            background-size: contain;
          }
        }
        .no-notification {
          @extend .efl-heading-3;
    
          color: $blue;
          margin-bottom: 3.2rem;
          font-weight: 500;
    
          @include text-limit(2);
        }
        &--title {
          .heading {
            @extend .efl-heading-3;
    
            font-size: 2.4rem;
            line-height: 2.6rem;
            color: $black;
            margin-bottom: 3.2rem;
            font-weight: 400;
    
            @include text-limit(2);
          }
        }
        &--no-notification {
          max-width: 100%;
          display: flex;
          flex-direction: column;
          .no-notification {
            max-width: 23.1rem;
            text-align: center;
            margin: 0 auto;
            margin-bottom: 1.6rem;
          }
          p {
            @extend .efl-p-medium;
    
            color: $color-interface-light;
            margin-bottom: 2.4rem;
    
            @include text-limit(2);
    
            text-align: center;
          }
          .no-notification-icon {
            text-align: center;
            canvas {
              width: 9rem;
              height: 9rem;
              filter: grayscale(1);
            }
          }
        }
      }
      &.active {
        bottom: 5.4rem;
        display: flex;
        &.sliding {
          bottom: -46.1rem;
        }
      }
      &[aria-expanded='false'] {
        .efl-global-notifications-tray__wrapper > button {
          top: 1.6rem;
          &::after {
            width: 1.6rem;
            height: 1.6rem;
            background: url('./assets/images/notifications-close.svg') no-repeat
              center;
          }
        }
        .efl-global-notifications-tray__wrapper {
          border-radius: 1.6rem;
          &--title {
            display: none;
          }
          &--items {
            & > * {
              display: none;
              &.firstNotification {
                display: flex;
                flex-direction: column;
                padding: 0;
                .efl-global-notifications__wrapper button {
                  display: none;
                }
              }
            }
          }
          &--morelink {
            @extend .efl-p-1;
    
            display: flex;
            justify-content: space-between;
            align-items: center;
            color: $color-interface-light;
            text-decoration: underline;
            margin-left: 8.6rem;
            margin-top: 1.6rem;
            cursor: pointer;
            &::after {
              content: '';
              display: inline-block;
              background-image: url('./assets/images/notification-more-icon.svg');
              background-size: 100%;
              background-repeat: no-repeat;
              width: 1.2rem;
              height: 1rem;
              margin-right: 1.1rem;
            }
          }
        }
        .efl-global-notifications-tray__shadow1 {
          content: '';
          background: $white;
          box-shadow: 0 4px 24px rgba(98, 95, 95, 0.4);
          border-radius: 16px;
          width: calc(100% - 3.2rem);
          height: 5.5rem;
          position: absolute;
          bottom: -8px;
          z-index: 4;
          left: 1.6rem;
        }
        .efl-global-notifications-tray__shadow2 {
          content: '';
          background: $white;
          box-shadow: 0 4px 24px rgba(98, 95, 95, 0.4);
          border-radius: 16px;
          width: calc(100% - 6.4rem);
          height: 5.5rem;
          position: absolute;
          bottom: -16px;
          z-index: 3;
          left: 3.2rem;
        }
      }
      &[aria-expanded='true'] {
        bottom: -8px;
        max-height: 46.1rem;
        max-width: initial;
        width: 100%;
        left: initial;
        .efl-global-notifications-tray__wrapper {
          border-radius: 0.8rem 0.8rem 0 0;
          &--items {
            max-height: 350px;
            overflow-y: auto;
            /* stylelint-disable no-descending-specificity */
            & > * {
              border-top: 1px solid $grey-light !important;
              border-radius: 0;
              padding-left: 0;
              padding-right: 0;
              .efl-global-notifications__section::before {
                border: none;
              }
              .efl-global-notifications__completion::before {
                border: none;
              }
              .efl-global-notifications__wrapper--info {
                padding-left: 0;
              }
              &.priority-3 {
                .efl-global-notifications__wrapper--info {
                  margin-left: 0;
                }
                .efl-global-notifications__section {
                  margin-left: 1.3rem;
                }
                .efl-global-notifications__completion--info img {
                  margin-left: 1.3rem;
                }
                .efl-global-notifications__completion--info {
                  margin-top: 0;
                }
              }
            }
          }
        }
      }
    
      @media screen and (min-width: $mq-medium) {
        max-width: 49.9rem;
        width: 49.9rem;
        height: 100%;
        max-height: 20.2rem;
        bottom: initial;
        transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
        &__wrapper {
          border-radius: 1.6rem;
          border: 2px solid $grey;
          bottom: initial;
          &--title {
            font-size: 2.4rem;
            line-height: 2.6rem;
          }
          &--items {
            max-height: 350px;
            overflow-y: auto;
          }
        }
        &.active {
          top: 13.8rem;
          right: 2.4rem;
          left: initial;
          bottom: initial;
          &.sliding {
            top: -46.1rem;
            bottom: initial;
          }
        }
        &[aria-expanded='false'] {
          .efl-global-notifications-tray__wrapper {
            border-radius: 1.6rem;
          }
          .efl-global-notifications-tray__shadow1 {
            bottom: 13px;
          }
          .efl-global-notifications-tray__shadow2 {
            bottom: 0;
          }
        }
        &[aria-expanded='true'] {
          max-height: 46.4rem;
          max-width: 49.9rem;
          width: 100vw;
          .efl-global-notifications-tray__wrapper {
            border-radius: 1.6rem;
          }
          .efl-global-notifications-tray__shadow1,
          .efl-global-notifications-tray__shadow2 {
            display: none;
          }
        }
      }
    
      @media screen and (min-width: 1440px) {
        &.active {
          right: calc(50vw - 70rem + 2.4rem);
        }
      }
    }
    
  • URL: /components/raw/efl-global-notifications-tray/efl-global-notifications-tray.scss
  • Filesystem Path: src/library/components/efl-global-notifications-tray/efl-global-notifications-tray.scss
  • Size: 7.6 KB
<div class="efl-global-notifications-tray" aria-expanded="false" data-behavior="efl-global-notifications-tray">
    <div class="efl-global-notifications-tray__container">
        <div class="efl-global-notifications-tray__new-notification">
            <div class="efl-global-notifications-tray__wrapper">
                <button class="efl-global-notifications-tray__close"></button>            
                <div class="efl-global-notifications-tray__wrapper--title">
                    <div class="heading">Notifications</div>
                </div>
                <div class="efl-global-notifications-tray__wrapper--items">
                    {{render '@efl-global-notifications' notification1 merge="true"}}
                    {{render '@efl-global-notifications--priority-2' notification2 merge="true"}}
                    {{render '@efl-global-notifications--priority-3' notification3 merge="true"}}
                </div>
                <a class="efl-global-notifications-tray__wrapper--morelink"></a>         
            </div>
            <div class="efl-global-notifications-tray__shadow1"></div>
            <div class="efl-global-notifications-tray__shadow2"></div>
        </div>
         <div class="efl-global-notifications-tray__no-notification hidden">
            <div class="efl-global-notifications-tray__wrapper">
                <button class="efl-global-notifications-tray__close"></button>
                <div class="efl-global-notifications-tray__wrapper--no-notification">
                    <div class="no-notification-icon">
                        <canvas id="no-notification-rive" width="60" height="60"></canvas>
                    </div>
                    <div class="no-notification">You dont have  any notifications right now</div>
                    <p>We will alert you once something comes up</p>
                </div>
            </div>
        </div>
    </div>
</div>