Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bradmartin/nativescript-periscopehearts
:two_hearts: NativeScript plugin for Periscope's heart animation :two_hearts:
https://github.com/bradmartin/nativescript-periscopehearts
animation nativescript nativescript-plugin ui-components
Last synced: about 2 months ago
JSON representation
:two_hearts: NativeScript plugin for Periscope's heart animation :two_hearts:
- Host: GitHub
- URL: https://github.com/bradmartin/nativescript-periscopehearts
- Owner: bradmartin
- License: apache-2.0
- Created: 2016-02-08T22:39:21.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-01-07T18:13:46.000Z (almost 7 years ago)
- Last Synced: 2024-10-17T07:29:31.926Z (2 months ago)
- Topics: animation, nativescript, nativescript-plugin, ui-components
- Language: TypeScript
- Homepage:
- Size: 23.8 MB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![npm](https://img.shields.io/npm/v/nativescript-periscopehearts.svg)](https://www.npmjs.com/package/nativescript-periscopehearts)
[![npm](https://img.shields.io/npm/dt/nativescript-periscopehearts.svg?label=npm%20downloads)](https://www.npmjs.com/package/nativescript-periscopehearts)
[![GitHub stars](https://img.shields.io/github/stars/bradmartin/nativescript-periscopehearts.svg)](https://github.com/bradmartin/nativescript-periscopehearts/stargazers)
[![PayPal Donate](https://img.shields.io/badge/Donate-PayPal-ff4081.svg)](https://www.paypal.me/bradwayne88)# NativeScript-PeriscopeHearts :two_hearts:
NativeScript plugin for Periscope's heart animation (Android Only for now...). Open source library used: [tyrantgit/HeartLayout](https://github.com/tyrantgit/HeartLayout)## Sample
![Sample Hearts](periscopeHearts.gif)
## Installation
From your command prompt/termial go to your app's root folder and execute:`npm install nativescript-periscopehearts`
## Usage
#### XML:
```XML
```
#### JS:
```JS
// Array of hex color strings
var colorArray = [
{ hex: "#3489db" },
{ hex: '#FF4081' },
{ hex: '#229911' },
{ hex: '#fff000' }
];function newHeart(args) {
var heartLayout = frame.topmost().currentPage.getViewById("heartLayout");// Just getting a random hex string from the colorArray values
var rand = colorArray[Math.floor(Math.random() * colorArray.length)];// Call addHeart() on the PeriscopeHearts UI element to pop in a new heart
heartLayout.addHeart(rand.hex);
}
exports.newHeart = newHeart;
```## API
**addHeart (color)** - *required*
Function that adds one heart into the view.