Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div id="marquee">
  <div id="stamps"> <!-- all your stamps go after this, as regular images -->
      <img src="https://fabled.day/image/signifiers/stamps/shyos.gif">
      
      <img src="https://fabled.day/image/signifiers/stamps/aesthete.gif">
      
      <img src="https://fabled.day/image/signifiers/stamps/dials.gif">
      
      <img src="https://fabled.day/image/signifiers/stamps/dreamer.gif">
      
      
      <img src="https://fabled.day/image/signifiers/stamps/pinkds.png">
      <img src="https://fabled.day/image/signifiers/stamps/pokemon.gif">
      <img src="https://fabled.day/image/signifiers/stamps/roses.gif">
      <img src="https://fabled.day/image/signifiers/stamps/sleepy.png">
      <img src="https://fabled.day/image/signifiers/stamps/whoa.gif">
      <img src="https://fabled.day/image/signifiers/stamps/aliens.png">
      <img src="https://fabled.day/image/signifiers/stamps/loveds.png">
      <img src="https://fabled.day/image/signifiers/stamps/nighttime.png">
      <img src="https://fabled.day/image/signifiers/stamps/tea.png">
      <img src="https://fabled.day/image/signifiers/stamps/wtf.gif">
       <img src="https://fabled.day/image/signifiers/stamps/poke.gif">
          <img src="https://fabled.day/image/signifiers/stamps/sims.gif">
      
       <img src="https://fabled.day/image/signifiers/stamps/try.gif">
    
           <img src="https://fabled.day/image/signifiers/stamps/colors.gif">
             <img src="https://fabled.day/image/signifiers/stamps/waffles.png">
    </div>
  </div>
  
  
  
              
            
!

CSS

              
                #marquee {
    width:40%; /* width of the marquee is set to 40% of the screen size here for demonstrative purposes. it would probably be best at 100% within a containing element like a sidebar or header */
    margin:auto; /* keeps it centered lol */
    overflow: hidden;
    white-space: nowrap;
    padding: .5em;
  }
  
  #marquee:hover #stamps {
    animation-play-state: paused; /* remove this line if you'd rather the stamps not pause when the visitor hovers over them */
  }
  
  #stamps {
    display: inline-block;
    will-change: transform;
    animation: marquee 100s linear infinite; /* here, 100s denotes 100 seconds, so change it to the speed you'd like your marquee to flow. slower is better imho */
  }
  


  #stamps img {
    width: 99px;
    height:56px; /* since most stamps are 56px tall and 99 px wide, i've set the defaults to this */
    opacity:0.5; /* remove the previous line if you don't want your images dimmed as a default */
    transition: all 0.2s;
      position: relative; 
  z-index: 1; 

  }
  
  #stamps img:hover {
    transform: scale(1.2); /* remove this if you'd rather they not explode on hover  */
    opacity:1;
      z-index: 100;
  }
  
  @keyframes marquee {
    0% {
      transform: translateX(0%);
    }
    100% {
      transform: translateX(-100%);
    }
  }
              
            
!

JS

              
                //https://www.freecodecamp.org/news/how-to-shuffle-an-array-of-items-using-javascript-or-typescript/
function stampshuffle() {
    const marquee = document.querySelector('#stamps');
    const stamps = Array.from(marquee.querySelectorAll('img'));

    for (let i = stamps.length - 1; i > 0; i--) {
        const randomIndex = Math.floor(Math.random() * (i + 1));
        [stamps[i], stamps[randomIndex]] = [stamps[randomIndex], stamps[i]];
    }

    stamps.forEach(img => marquee.appendChild(img));
}

stampshuffle(); 

              
            
!
999px

Console