cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

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.

            
              <div class="container">
<!-- svg from https://pixelbuddha.net/freebie/mario-pixel-icon-collection -->
	<svg id="bananas" data-name="bananas" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 665"><defs><style>.cls-1{fill:#f7feff;}.cls-2{fill:#231e2b;}.cls-3{fill:#cf8934;}.cls-4{fill:#e2b436;}</style></defs><title>bananas</title><rect class="cls-1" x="237.5" y="617.5" width="237.5" height="47.5"/><rect class="cls-1" x="475" y="570" width="95" height="47.5"/><rect class="cls-2" x="237.5" y="570" width="237.5" height="47.5"/><rect class="cls-1" x="142.5" y="570" width="95" height="47.5"/><rect class="cls-1" x="570" y="522.5" width="47.5" height="47.5"/><rect class="cls-2" x="475" y="522.5" width="95" height="47.5"/><rect class="cls-3" x="237.5" y="522.5" width="237.5" height="47.5"/><rect class="cls-2" x="142.5" y="522.5" width="95" height="47.5"/><rect class="cls-1" x="95" y="522.5" width="47.5" height="47.5"/><rect class="cls-1" x="617.5" y="475" width="47.5" height="47.5"/><rect class="cls-2" x="570" y="475" width="47.5" height="47.5"/><rect class="cls-3" x="475" y="475" width="95" height="47.5"/><rect class="cls-3" x="142.5" y="475" width="95" height="47.5"/><rect class="cls-2" x="95" y="475" width="47.5" height="47.5"/><rect class="cls-1" x="47.5" y="475" width="47.5" height="47.5"/><rect class="cls-1" x="665" y="427.5" width="47.5" height="47.5"/><rect class="cls-2" x="617.5" y="427.5" width="47.5" height="47.5"/><rect class="cls-3" x="570" y="427.5" width="47.5" height="47.5"/><polygon class="cls-2" points="95 380 237.5 380 237.5 332.5 190 332.5 190 190 237.5 190 237.5 142.5 142.5 142.5 142.5 332.5 47.5 332.5 47.5 475 95 475 95 380"/><rect class="cls-3" x="617.5" y="380" width="47.5" height="47.5"/><polygon class="cls-3" points="427.5 427.5 427.5 380 285 380 285 332.5 237.5 332.5 237.5 380 95 380 95 475 142.5 475 142.5 427.5 427.5 427.5"/><rect class="cls-1" y="332.5" width="47.5" height="142.5"/><polygon class="cls-2" points="712.5 47.5 570 47.5 570 190 617.5 190 617.5 95 665 95 665 427.5 712.5 427.5 712.5 47.5"/><rect class="cls-3" x="427.5" y="332.5" width="95" height="47.5"/><polygon class="cls-4" points="617.5 332.5 522.5 332.5 522.5 380 427.5 380 427.5 427.5 142.5 427.5 142.5 475 237.5 475 237.5 522.5 475 522.5 475 475 570 475 570 427.5 617.5 427.5 617.5 380 665 380 665 285 617.5 285 617.5 332.5"/><rect class="cls-3" x="522.5" y="285" width="95" height="47.5"/><rect class="cls-3" x="190" y="285" width="47.5" height="47.5"/><polygon class="cls-1" points="142.5 332.5 142.5 142.5 95 142.5 95 285 47.5 285 47.5 332.5 142.5 332.5"/><rect class="cls-3" x="617.5" y="142.5" width="47.5" height="142.5"/><polygon class="cls-4" points="475 237.5 475 285 332.5 285 332.5 237.5 237.5 237.5 237.5 190 190 190 190 285 237.5 285 237.5 332.5 285 332.5 285 380 427.5 380 427.5 332.5 522.5 332.5 522.5 285 617.5 285 617.5 190 570 190 570 237.5 475 237.5"/><rect class="cls-2" x="332.5" y="237.5" width="142.5" height="47.5"/><rect class="cls-2" x="475" y="190" width="95" height="47.5"/><rect class="cls-1" x="332.5" y="190" width="142.5" height="47.5"/><rect class="cls-2" x="237.5" y="190" width="95" height="47.5"/><polygon class="cls-1" points="570 190 570 47.5 522.5 47.5 522.5 142.5 475 142.5 475 190 570 190"/><rect class="cls-1" x="237.5" y="142.5" width="95" height="47.5"/><rect class="cls-4" x="617.5" y="95" width="47.5" height="47.5"/><rect class="cls-1" x="142.5" y="95" width="95" height="47.5"/><rect class="cls-1" x="712.5" y="47.5" width="47.5" height="380"/><rect class="cls-1" x="570" width="142.5" height="47.5"/></svg>
	<h1>Donkey Kong</h1>
</div>
            
          
!
            
              .container {
	margin: 40px auto;
	max-width: 400px;
	position: relative;
}
h1 {
	font-family: "Satisfy", cursive;
	font-size: 30px;
	text-align: right;
	left: 235px;
	position: absolute;
}
#bananas {
	width: 400px;
}
rect,
polygon {
	animation: 3s opac;
	animation-iteration-count: 1;
}
@keyframes opac {
    0% {
		 opacity: 0.1;
	}
     100% {
		 opacity: 1;
	}
}
/* rect:hover {
	transform: scale(2);
} */
            
          
!
            
              var rect = document.getElementsByTagName('rect');
var rectLength = rect.length;
// loop starts here
for (var i = 0; i < rectLength; i++) {
	var randomValue = rect[Math.floor(rectLength * Math.random())];
	randomValue.style.animation = 'opac';
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console