Giter Site home page Giter Site logo

warisgeek / ionic-content-banner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from djett41/ionic-content-banner

0.0 1.0 0.0 2.1 MB

An informational content banner for Ionic applications

License: MIT License

HTML 3.99% JavaScript 86.35% CSS 9.66%

ionic-content-banner's Introduction

#Ionic Content Banner

A Facebook style info/error content banner for the Ionic Framework

Table of Contents

Demo

  • Download my sports news app SportScoop on iOS/Android to see it live!! Web Demo | iOS | Android

SportScoop

  • Watch the Demo video below

Ionic Content Banner

  • Download the Demo app on Ionic View with appId: 5445a4a4
  • Run the demo source code by cloning the ionic-content-banner repo, navigating to /demo and running the following

Run the following ommands:

npm install
bower install
gulp

Setup

Install

bower install ionic-content-banner

JS/CSS Imports (index.html)

Include the following JavaScript/CSS file imports in your index.html. Remember to import the ionic libraries first! The example below assumes your 3rd party bower dependencies are located in the default bower_components folder.

<link rel="stylesheet" href="bower_components/ionic-content-banner/dist/ionic.content.banner.css">
<script src="bower_components/ionic-content-banner/dist/ionic.content.banner.js"></script>

Angular Dependency (app.js)

Add jett.ionic.content.banner as a module dependency of your app module.

angular.module('Demo', ['ionic', 'jett.ionic.content.banner'])
  .config(function () {..});

SASS Import (main.scss)

Include the scss/ionic.content.banner.scss file at the top of your main.scss file as shown below. Import any custom Content Banner scss styles below the ionic and ionic.content.banner scss.

@import
  "path_to_bower_components/ionic/scss/ionic",
  "path_to_bower_components/ionic-content-banner/scss/ionic.content.banner";

Usage

$ionicContentBanner

A service you can inject in your controller to show the Content Banner

$ionicContentBanner.show

Create and show a new Content Banner. A new isolated scope will be created for the Content Banner and the new Content Banner will animate just under the top of the active views ion-content.

@returns {function} close A function which, when called, closes the Content Banner. Make sure you use this to clean up and remove the content banner!!

@param {object} options The options for the content banner. Properties:

  • {string=} icon

    The icon used for the close button. defaults to ion-ios-close-empty

  • {string=} transition

    The transition used to animate in the content banner. Supported options are vertical and fade; defaults to vertical. The content banner will create a css class content-banner-transition-{transitionVal}, so you can add a custom value and then a custom css class to match if you would like to create your own transition.

  • {string=} type

    The type of banner to show. Supported types are info and error; defaults to info. The content banner will create a css class content-banner-{typeVal}, so you can add a custom type value and then a custom css class to match if you would like to create your own type.

  • [String] text

    A string array that contains the text values to display on the banner. If the array contains more than one value, the content banner will cycle through the values of the array at the supplied interval (see below).

  • {number=} interval

    Number of milliseconds between text value changes. Default value is 7000ms (7 seconds).

  • {number=} autoClose

    Number of milliseconds before the content banner automatically closes. This option is disabled by default.

  • {boolean=} cancelOnStateChange

    Whether to cancel the content banner when navigating to a new state. Default value is true.

Screenshots

ionic-content-banner's People

Contributors

djett41 avatar leob avatar

Watchers

James Cloos avatar

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.