Skip to content
This repository was archived by the owner on Dec 27, 2025. It is now read-only.
This repository was archived by the owner on Dec 27, 2025. It is now read-only.

Can change when wdt go to the next phrase manually? #3

Description

@fontenele

I want to make a real loading with checking steps, i will set the phrases and when my system loads some item i will make some like this wdtLoading.goToPhrase(3) by index or by identifier wdtLoading.goToPhrase('load-images').

with some like this html:

<div class="wdt-loading-screen">
      <div class="wdt-loading-phrases">
              <div class="wdt-loading-phrase-category" data-category="default">
                      <div class="wdt-loading-phrase" id="load-user-info">Loading user info...</div>
                      <div class="wdt-loading-phrase" id="load-images">Loading images...</div>
              </div>
      </div>
</div>

Update:
with this function i can change to the next phrase:

wdtLoading.setNext = function () {
        var that = this;
        that.activePhrases = that.wdtPhraseActiveCat.querySelectorAll('.wdt-loading-phrase');
        addClass(that.activePhrases[that.currentIndex], 'wdt-checked');
        that.currentIndex++;
        that.currentTransform = that.currentTransform - that.phraseHeight;

        css(that.wdtPhraseActiveCat, {transform: 'translateY(' + that.currentTransform + 'px)'});

        if (that.currentIndex > 1) {
            var currentNone = that.activePhrases[that.currentIndex - 2];
            var currentClone = currentNone.cloneNode(true);
            removeClass(currentClone, 'wdt-checked');
            addClass(currentClone, 'wdt-cloned-phrase');
            currentClone.style.transform = '';
            that.wdtPhraseActiveCat.appendChild(currentClone);
        }
    };

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions