fourlabsldn / fl-facebook-reviews

Show reviews for a page in facebook style

Home Page:https://fourlabsldn.github.io/fl-facebook-reviews

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fl-facebook-reviews

Show reviews for a page in facebook style

  • See demo To use it you will need:
  • The CSS for the project (which is in the build folder)
  • A configuration object
<!-- Include the project's JS and CSS-->
<script src="../dist/fl-facebook-reviews.js"> </script>
<link rel="stylesheet" href="../dist/fl-facebook-reviews.css">

<div id="target"></div>

<script>
  const data = {
    'summary': {
        'url': '//www.facebook.com/slvglobal',
        'average': 4.8,
        'count': 103,
        'values': {
            1: 5,
            2: 2,
            3: 3,
            4: 43,
            5: 50,
        },
    },
    'reviews': [{
        'rating': 5,
        'created_time': '2016-06-15T16:00:00.000Z',
        'review_text': 'Amazing!',
        'reviewer': {
            'name': 'John Smith',
            'id': '1234556'
        },
    }]
  };

  const div = document.createElement('div');
  div.dataset.info = JSON.stringify(data);
  document.querySelector('#target').appendChild(div);
  flFacebookReviews(div);
</script>

Install

NPM

npm install fl-facebook-reviews --save

Tasks

Build

npm run build

About

Show reviews for a page in facebook style

https://fourlabsldn.github.io/fl-facebook-reviews


Languages

Language:JavaScript 87.8%Language:CSS 6.4%Language:HTML 5.8%