Making a traditional film animation using kirupa's slide show

Thank you so much new script gives me a great start to see how the functionality works. In the script can you explain how to change playing the slideshow once as opposed to playing continuously, or button play to end and stop and button go to start and stop to show difference in code please.Been changing button true false seems to work a bit better Big hack but if you remove active link below it plays only once. now buttons need tweaking after slideshow has finished. if only firing slideshow once add activelink=0 to play button and remove at function goToNextItem()…else, see notes below

  <script>
    // just querying the DOM...like a boss!
    var links = document.querySelectorAll(".itemLinks");
    var wrapper = document.querySelector("#wrapper");

    // the activeLink provides a pointer to the currently displayed item
    var activeLink = 0;

    // setup the event listeners
    for (var i = 0; i < links.length; i++) {
      var link = links[i];
      link.addEventListener('click', setClickedItem, false);

      // identify the item for the activeLink
      link.itemID = i;
    }

    // set first item as active
    links[activeLink].classList.add("active");

    function setClickedItem(e) {
     removeActiveLinks();
    
     //if changed this stops slideshow instead of restarting at clicked link after stop button is pressed

      var clickedLink = e.target;
      activeLink = clickedLink.itemID;

      changePosition(clickedLink);
    }

    function removeActiveLinks() {
      for (var i = 0; i < links.length; i++) {
        links[i].classList.remove("active");
      }
      
    }

    // Handle changing the slider position as well as ensure
    // the correct link is highlighted as being active
    function changePosition(link) {
      var position = link.getAttribute("data-pos");

      var translateValue = "translate3d(0px," + position + ",  0px)";
      wrapper.style["transform"] = translateValue;

      link.classList.add("active");
    }
    //
    // The code for sliding the content automatically
    //
    var timeoutID;

    function startTimer() {
      // wait 2 seconds before calling goInactive this changes speed of slideshow
      timeoutID = window.setInterval(goToNextItem, 40);
      //setTimeout(goToNextItem, 2000);
    }
    
    //startTimer(); add this to run automatically

    function resetTimer() {
    window.clearInterval(timeoutID);
    startTimer();
    }

    function goToNextItem() {
 //take out to make all links active   
      removeActiveLinks();

      if (activeLink < links.length - 1) {
        activeLink++;
      }

      else {
      //activeLink = 0; insertfor looping playback  
      }

      var newLink = links[activeLink];
      changePosition(newLink);
    }

    let startButton =  document.querySelector("#startButton");
    let pauseButton =  document.querySelector("#pauseButton");
    let playButton =  document.querySelector("#playButton");
    let replayButton =  document.querySelector("#replayButton");

    startButton.disabled = true;
    playButton.disabled = false;
    pauseButton.disabled = true;
  
   startButton.addEventListener("click", () => {
window.location.reload();
      pauseButton.disabled = false;
      playButton.disabled = false;
    });

    pauseButton.addEventListener("click", () => {
      window.clearInterval(timeoutID);
      startButton.disabled = false;
      pauseButton.disabled = true;
      playButton.disabled = false;
    });

    playButton.addEventListener("click", () => {
      window.clearInterval(timeoutID);
      startTimer();
	activeLink = 0;//can set what frame to start with
startButton.disabled = false;
      pauseButton.disabled = false;
      playButton.disabled = true;
    });

    replayButton.addEventListener("click", () => {
      activeLink = 0;
      window.clearInterval(timeoutID);
      removeActiveLinks();
      changePosition(document.querySelector("#Nw1"));
      startTimer();     
      pauseButton.disabled = false;
      playButton.disabled = false;
    });
  </script>

see londonkillsme.com

Sorry for the delay on this. Work and other obligations have shrunk my time on this. I haven’t forgotten about it.

i have a rational consent that when i post here all of my data is used openly, all of our data is collected without allowing it to do so. there is nothing we can do without a lot of hard work to stop that. on open archives, your files there are data sniffers on your html upload accounts whether you like it or not how do we make safe protocols or not.

kirupa getting my svg content down to 3kb per frame from 62kb on my animation as was getting fouc on start up slide really want it to work with larger images, should be able to handle it on older machines and mobiles but lagging not loading content before firing. put an inline svg on first frame and that seemed to help, so not sure if content or retrofitted script that slowing things down. please help when you have time nick - londonkillsme.com

It was very smooth for me! How are you optimizing the SVGs? One tool that I use is SVGOMG:

SVGOMG - SVGO's Missing GUI

I paste my SVG markup into it and let it remove unnecessary content, precision, etc. that can greatly reduce the file size.

just using an svg editor to ungroup and delete repeated unessescary code. but my model should work with larger files as proved by reducing file sizes and finding no difference, there is glitch on first onload it takes 2or3 secs for body onload without first svg frame being inline code. When first frame is a external backgroun the same as all of them. Its a hack to solve this by making it inline. dont know why this is happening. will keep working. thanks K

one of my most important questions is how to use svg backgrounds as a data sorce without them being inline. Convert them to 64 to compact them but no anchors?, You can open external links on a svg file straight, yes. you make an svg a background, yes with no links. you make it inline yes you get layerable links. so i guess it is part of the dom. but why are external svg or image backgrounds not part of the dom when svgs are clickable over html layers. so powerful but missing that background accesibilty to make 3d…scapes like css should be like svg. Also why are fixed positions not allowable to clickable backgrounds, like creating a dashboard, with svg should be background clickable, but this is removed from normal play. I guess this is to keep things safe and accesible. While on another note html body shows up code in cool old school green on black, if you play ordering your layout, unlike svg, ever seen that, great background for your code camp… and on thanks K will keep looking and learning…N