Pen Settings

HTML

CSS

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

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

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.

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

              
                <ul id="instafeed"></ul>
              
            
!

CSS

              
                #instafeed {
  margin: 0; 
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: auto;
  grid-gap: 1rem;
}
#instafeed li {
  margin: 0;
  padding: 0;
  list-style: none;
  background: url() center center / cover no-repeat;
  position: relative;
}
#instafeed li a {
  display: block;
  padding-bottom: 100%;
}
#instafeed li.video a:before {
  content: "";
  background: url(https://profilepageimages.usecue.com/img/play.svg) center center / 45% auto no-repeat;
  width: 32px;
  height: 32px;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 1;
}
#instafeed li.carousel_album a:before {
  content: "";
  background: url(https://profilepageimages.usecue.com/img/carousel.svg) center center / 50% auto no-repeat;
  width: 32px;
  height: 32px;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 1;
}
#instafeed li:hover a::after {
  content: "";
  position: absolute;
  left: 0; 
  top: 0;
  width: 100%;
  height: 100%;
  background: url(https://profilepageimages.usecue.com/img/interact.svg) center center / auto 19px no-repeat;
  z-index: 1;
}
#instafeed li a img {display: none;}

/* show only 18 images on mobile */
@media only screen and (max-width: 600px) {
  #instafeed li:nth-child(n+18) {display: none;}
}
              
            
!

JS

              
                /*-----------------------------------------------------------*/
/*                       INSTRUCTIONS                        */
/*-----------------------------------------------------------*/
/*                                                           */
/*   First you have to create an account at:                 */
/*   https://profilepageimages.usecue.com                    */
/*   Then you need to change the instagram username below.   */
/*                                                           */
/**/     var instagram_username = 'laselvahotyoga';        /**/
/**/     var instagram_amount = 25;                        /**/
/*                                                           */
/*   Note that this script does not use jQuery. Nor does     */
/*   it retreive images directly from Facebook/Instagram.    */
/*   You can also try some other demo accounts, like:        */
/*   'jhvanderschee' or 'laselvahotyoga'.                    */
/*                                                           */
/*   Happy coding!                                           */
/*                                                           */
/*-----------------------------------------------------------*/

var jsonurl = 'https://profilepageimages.usecue.com/images/'+instagram_username+'/images.json';
var request = new XMLHttpRequest();
request.open('GET', jsonurl, true);

request.onload = function() {
  if (this.status >= 200 && this.status < 400) {
    // Success!
    var data = JSON.parse(this.response);
    data.forEach( function callback(object,index) {
      if(index<instagram_amount) {
        var image_small = object.image_small;
        var caption = object.caption;
        if(!caption) caption = '';
        var permalink = object.permalink.replace(/\/$/, '');
        var media_type = object.media_type.toLowerCase();
        document.getElementById('instafeed').innerHTML = document.getElementById('instafeed').innerHTML + "<li style='background-image: url("+image_small+")' class='"+media_type+"'><a href='"+permalink+"' target='_blank' title='"+caption+"'><img src='"+image_small+"' alt='"+caption+"' /></a></li>";
      }
    });
  } else {
    // We reached our target server, but it returned an error
  }
};

request.onerror = function() {
  // There was a connection error of some sort
};

request.send();
              
            
!
999px

Console