LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code


CSS
@import url('https://fonts.googleapis.com/css?family=Lato:100,100i,300,300i,400,400i,700,700i,900,900i');
body {
  font-family: 'Lato', "Helvetica", Arial, sans-serif;
}

/* remove bootstrap gutter*/
.row.no-gutter {
  margin-left: 0;
  margin-right: 0;
}

.row.no-gutter [class*='col-']:not(:first-child),
.row.no-gutter [class*='col-']:not(:last-child) {
  padding-right: 0;
  padding-left: 0;
}


/* the good stuff */
body {
}

.img-featured-container {
  overflow: hidden;
  position: relative;
}

.img-featured-container img {
  width: 100%;
/*   padding: 10px; */
}

.img-featured-container .img-backdrop {
  background: -webkit-linear-gradient(315deg, rgba(38, 163, 255, 0.85), rgba(83, 201, 179, 0.85));
  background: linear-gradient(135deg, rgba(38, 163, 255, 0.85), rgba(83, 201, 179, 0.85));
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 1;
  opacity: 0;
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

.img-featured-container:hover > .img-backdrop {
  opacity: 1;
}

/* center text horizontally and vertically on image hover */
.img-featured-container .description-container {
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
  padding: 0 30px;
  text-align: center;
  line-height: 20px;
  width: 100%;
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
  z-index: 2;
  opacity: 0;
  -webkit-transition: all .2s ease;
  transition: all .2s ease;
}

.img-featured-container .description-container .fa-instagram {
  font-size: 40px;
}

.img-featured-container .description-container p {
  font-weight: 300;
  margin-bottom: 0;
}

.img-featured-container:hover .description-container {
  opacity: 1;
}

.img-featured-container .description-container .caption {
  display: none;
  margin-bottom: 10px;
}

.img-featured-container .description-container .likes,
.img-featured-container .description-container .comments {
  margin: 0 5px;
}

/* load more button */
#btn-instafeed-load {
  color: #fff;
  background: #26a3ff;
  font-size: 16px;
  margin: 20px auto;
  padding: 8px 40px;
  display: block;
  border: none;
}

/* media queries  */
@media screen and (min-width:768px) {
  .img-featured-container .description-container .caption {
    display: block;
  }
}
JS
// How to get an access token:
// http://jelled.com/instagram/access-token

// TODO:
// - improve UI
// - make it easy to copy and paste image url

// {{model.user.username}}, {{likes}} likes

var galleryFeed = new Instafeed({
  get: "user",
  userId: 4622774,
  accessToken: "4622774.7cbaeb5.ec8c5041b92b44ada03e4a4a9153bc54",
  resolution: "standard_resolution",
  useHttp: "true",
  limit: 6,
  template: '',
  target: "instafeed-gallery-feed",
  after: function() {
    // disable button if no more results to load
    if (!this.hasNext()) {
      btnInstafeedLoad.setAttribute('disabled', 'disabled');
    }
  },
});
galleryFeed.run();

var btnInstafeedLoad = document.getElementById("btn-instafeed-load");
btnInstafeedLoad.addEventListener("click", function() {
  galleryFeed.next()
});

Description

A simple instafeed.js user feed example with a 'load more' button to load in additional posts.
Term
Mon, 11/27/2017 - 21:22

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv