huiyifyj / Coalk

⚠️(OBSOLETE) 💬A comment component base on firebase realtime database for static pages.

Home Page:https://github.com/huiyifyj/Coalk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Coalk

TravisCI npm firebase LICENSE

💬 Coalk is comment component base on firebase realtime database for static pages.

Preview Live

Note: This project is developing.

Features

  • Simple and lightweight.
  • No server-side implementation.
  • Support on authentication with gravatr json API.
  • Serverless, data be stored in firebase realtime database.

Install

  • Via npm :
$ npm i coalk
  • Import CDN :
<!-- Temporary vacancy -->
  • Build files :
$ npm i
$ npm run build

Then generate coalk.min.css and coalk.min.js and their sourcemap files in dist folder.

Usage

Add a container to you page:

<div id="coalk"></div>

Then use the Javascript code below to new a comment instance:

<script>
new Coalk({
    apiKey: 'Firebase apiKey',
    databaseURL: 'Firebase databaseURL',
    authDomain: "Firebase authDomain",
    // And other options setting.
});
</script>

About options parameters

Option Default Description
cdn https://gravatar.loli.net/avatar/ string
The gravatar CDN url.
row 8 number
The comment maximum number loaded initially.
language navigator.browserLanguage.toLowerCase() string
The language setting, values: 'en', 'zh-cn'.
apiKey null string
Your firebase apiKey.
authDomain null string
Your firebase Authentication authDomain.
databaseURL null string
Your firebase realtime database databaseURL.

Development

$ git clone git@github.com:huiyifyj/comment.js.git
$ cd comment.js
$ npm install
$ npm run dev

Then open your browser, visit http://127.0.0.1:3000/ .

License

MIT



© 2019   |   Huiyi.FYJ

About

⚠️(OBSOLETE) 💬A comment component base on firebase realtime database for static pages.

https://github.com/huiyifyj/Coalk

License:MIT License


Languages

Language:JavaScript 76.5%Language:CSS 13.2%Language:HTML 10.4%