Giter Site home page Giter Site logo

sgoodz / vue3-instagram-feed Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 6.0 40 KB

Vue 3 Instagram feed component using a personal access token - 2022 Meta API

HTML 7.16% Vue 77.49% JavaScript 15.35%
vue facebook facebook-api insta instagram instagram-ap instagram-feed javascript meta vue3

vue3-instagram-feed's Introduction

Vue 3 Instagram Feed/Gallery

MIT v0.1.4 JavaScript Style Guide

A Vue 3 component that displays a basic Instagram feed using Instagram Basic Graph API and your Facebook access token.

Important: This only works with Vue 3 as I am using the composition API. You also need to generate an Instagram Access Token from the Meta Developer Portal.

Installation

yarn add vue3-instagram-feed

OR

npm install vue3-instagram-feed

Usage

To display a simple gallery with a set number of images.

Props:

  • accessToken: Required.
  • count: Required. Defines the number of images.
  • pagination: Optional. Takes a boolean.
  • caption: Optional. Takes a boolean.
<template>
  <InstagramFeed
    :count="12"
    accessToken="<your token here>"
    :pagination="true"
    :caption="true"
  />
</template>

Main.js

import { createApp } from "vue";
import App from "./App.vue";

import InstagramFeed from "vue3-instagram-feed";
import "vue3-instagram-feed/dist/style.css";

createApp(App).use(InstagramFeed).mount("#app");

Styling

vue3-instagram-feed includes default styling (dist/styles.css) with that you can use as a base to create your own CSS. All the component's elements are inside a div which acts a wrapper for the icons and the input.

The styles are as shown below, you can ovveride them as you wish.

.instagram-wrapper {
  max-width: 93.5rem;
  margin: 0 auto;
  padding: 0 2rem;
}
.instagram-gallery {
  display: flex;
  flex-wrap: wrap;
  margin: -1rem, -1rem;
  padding-bottom: 3rem;
}
.instagram-gallery-item {
  position: relative;
  flex: 1 0 22rem;
  margin: 1rem;
  color: #fff;
  cursor: pointer;
}
.instagram-gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

vue3-instagram-feed's People

Contributors

harrydulaney avatar saulgoodz avatar sgoodz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vue3-instagram-feed's Issues

Video autoplay

Is it possible (or is it possible to get a feature for) making the posts that are videos on instagram autoplay in the feed? I'm aware any potential sound would have to be muted. They're already properly imported as video elements, so it would be as simple as having a feature toggle for whether to autoplay videos or not.

If there's any interest I can try to submit a pull request in the future.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.