Giter Site home page Giter Site logo

Comments (2)

tallhat avatar tallhat commented on July 30, 2024 1

wow - thanks so much for the quick response. i'll give it a go.
much appreciated :)

from vivus.

maxwellito avatar maxwellito commented on July 30, 2024

Hi there,

I'm afraid there's no examples specific to what you're asking. However it shouldn't be too difficult to build.

<style>
  /* Set a class to fade out the SVG */
  svg.fadeout {
    transition: all 2s;
    opacity: 0;
  }
</style>
<div class="vivus-container"></div>
<script>
  // Get the DOM of the SVG container
  const vivusContainer = document.querySelector('vivus-container');
  // List of the SVG you want to display
  const svgList = ['./drawing1.svg', './drawing2.svg', './drawing3.svg'];
  
  function showNextDrawing() {
    // Get the first item in the list
    const svgPath = svgList.shift();
    svgList.push(svgPath);
    
    // Start vivus
    new Vivus(vivusContainer, { duration: 200, file: svgPath }, (v) => {
      // Now the drawing is finished, let's fade out
      v.el.classList.add('fadeout');
      // Then in 2.5 seconds, let's draw the next one
      setTimeout(showNextDrawing, 2500)
    });
  }
  
  // Let start
  showNextDrawing();
</script>

I haven't tested it, but it should do the job :)

from vivus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.