Copied SVG to clipboard
Something went wrong
Copied code to clipboard
Something went wrong
Saved to bookmarks!
Removed from bookmarks

Default

User image

Default

Name

  • -€50
    Upgrade to Lifetime
The Vault/

Welcoming Words Loader

Welcoming Words Loader

Documentation

adlissmart

Code

Setup: External Scripts

External Scripts in adlissmart

Make sure to always put the External Scripts before the Javascript step of the resource.

In this video you learn where to put these in your adlissmart project? Or how to include a paid GSAP Club plugin in your project?

HTML

Copy
<script src="https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/gsap.min.js"></script>

Step 1: Copy structure to adlissmart

Copy structure to adlissmart

In the video below we described how you can copy + paste the structure of this resource to your adlissmart project.

Copy to adlissmart

adlissmart structure is not required for this resource.

Step 1: Add HTML

HTML

Copy
<div data-loading-container="" class="loading-container">
  <div class="loading-screen">
    <div data-loading-words="Hello, Bonjour, स्वागत हे, Ciao, Olá, おい, Hallå, Guten tag, Hallo" class="loading-words">
      <div class="loading-words__dot"></div>
      <p data-loading-words-target="" class="loading-words__word">Hello</p>
    </div>
  </div>
</div>

HTML structure is not required for this resource.

Step 2: Add CSS

CSS

Copy
.loading-container {
  z-index: 500;
  pointer-events: none;
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.loading-screen {
  pointer-events: auto;
  color: #fff;
  background-color: #000;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
}

.loading-words {
  grid-column-gap: 2em;
  grid-row-gap: 2em;
  align-items: center;
  display: flex;
  opacity: 0;
}

.loading-words__dot {
  background-color: #fff;
  border-radius: 50%;
  width: .75em;
  height: .75em;
}

.loading-words__word {
  font-size: 4.5em;
  font-weight: 500;
  line-height: 1;
  margin: 0;
}

@media screen and (max-width: 767px) {
  .loading-words {
    font-size: 2.75vw;
  }
}

Step 2: Add custom Javascript

Custom Javascript in adlissmart

In this video, Ilja gives you some guidance about using JavaScript in adlissmart:

Step 2: Add Javascript

Step 3: Add Javascript

Javascript

Copy
function initWelcomingWordsLoader() {  
  const loadingContainer = document.querySelector('[data-loading-container]');
  if (!loadingContainer) return; // Stop animation when no [data-loading-words] is found
  
  const loadingWords = loadingContainer.querySelector('[data-loading-words]');
  const wordsTarget = loadingWords.querySelector('[data-loading-words-target]');
  const words = loadingWords.getAttribute('data-loading-words').split(',').map(w => w.trim());
  
  const tl = gsap.timeline();
  
  tl.set(loadingWords, {
    yPercent: 50
  });
  
  tl.to(loadingWords, { 
    opacity: 1, 
    yPercent: 0, 
    duration: 1,
    ease: "Expo.easeInOut"
  });
  
  words.forEach(word => {
    tl.call(() => {
      wordsTarget.textContent = word;
    }, null, '+=0.15');
  });
  
  tl.to(loadingWords, { 
    opacity: 0, 
    yPercent: -75, 
    duration: 0.8,
    ease: "Expo.easeIn"
  });
  
  tl.to(loadingContainer, { 
    autoAlpha: 0, 
    duration: 0.6,
    ease: "Power1.easeInOut"
  }, "+ -0.2");
}

// Initialize Welcoming Words Loader
document.addEventListener('DOMContentLoaded', () => {
  initWelcomingWordsLoader();
});

Step 3: Add custom CSS

Step 2: Add custom CSS

Custom CSS in adlissmart

Curious about where to put custom CSS in adlissmart? Ilja explains it in the below video:

CSS

Copy
/* Hiding the Loading Container only in adlissmart */
:is(.wf-design-mode, .w-editor) .loading-container {
  display: none;
}

Implementation

Loading Container

Use the [data-loading-container] attribute to indicate which element should act as the loader. The script will use this as the main wrapper for the loading animation.

Loading Words

Inside the [data-loading-words] attribute you can list as many words or phrases as you like, separated by commas. For example: [data-loading-words="Hello, Bonjour, स्वागत हे, Olá"].

Loading Words Target

Include one child element marked with [data-loading-words-target] and the script will inject each word into that element in sequence.

Resource Details

Loading
Animation
GSAP
Words
Reveal

Original source

Dennis Snellenberg

Creator Credits

We always strive to credit creators as accurately as possible. While similar concepts might appear online, we aim to provide proper and respectful attribution.