GithubHelp home page GithubHelp logo

ruslanzavacky / ember-cli-owl-carousel Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 68 KB

Ember addon for building beautiful carousels using Owl Carousel2

License: MIT License

JavaScript 83.60% HTML 16.40%

ember-cli-owl-carousel's Introduction

ember-cli-owl-carousel2

npm version Dependency Status

Fastboot compatible addon for Owl Carousel 2

Installation

This addon will install latest version of owl.carousel as dependency.

  • ember install ember-cli-owl-carousel2

Usage

This addon provides owl-carousel2 component. By default it'll use default theme or append owl-theme class.

{{#owl-carousel2}}
  <div> Your Content </div>
  <div> Your Content </div>
  <div> Your Content </div>
{{/owl-carousel2}}

You can choose to not use default theme by passing theme=false. Or even exclude theme from build process (see below).

{{#owl-carousel2 theme=false}}
  <div> Your Content </div>
  <div> Your Content </div>
  <div> Your Content </div>
{{/owl-carousel2}}

You can pass any valid Owl Carousel options to the component.

{{#owl-carousel2 loop=true items=1}}
  <div> Your Content </div>
  <div> Your Content </div>
  <div> Your Content </div>
{{/owl-carousel2}}

And set callbacks by passing closure actions to the component

{{#owl-carousel2 onDragged=(action 'dragged')}}
  <div> Your Content </div>
  <div> Your Content </div>
{{/owl-carousel2}}

Also can pass navText and responsive options as JSON string. Please make sure that JSON.parse() can parse without errors.

{{#owl-carousel2 navText="[\"next\",\"prev\"]"}}
  <div> Your Content </div>
  <div> Your Content </div>
{{/owl-carousel2}}
{{#owl-carousel2 responsive='{ "320": { "items": 1 }, "1024": { "items": 2 }, "1600": { "items": 3 } }'}}
  <div> Your Content </div>
  <div> Your Content </div>
{{/owl-carousel2}}

SASS

If you would like to style using SASS please read the owl.carousel documentation. Please remember to install ember-cli-sass addon and exclude CSS in the configuration.

// app/styles/app.scss

@import 'node_modules/owl.carousel/src/scss/owl.carousel';

Build configuration

In most cases this addon requires no configuration. By default it imports JS, CSS and default theme from owl carousel.

  • Don't import CSS (+ theme)
// ember-cli-build.js

var app = new EmberAddon(defaults, {
  'ember-cli-owl-carousel2': {
    css: false
  }
});
  • Change theme
// ember-cli-build.js

var app = new EmberAddon(defaults, {
  'ember-cli-owl-carousel2': {
    theme: 'green'
  }
});
  • Don't import theme, but CSS
// ember-cli-build.js

var app = new EmberAddon(defaults, {
  'ember-cli-owl-carousel2': {
    theme: false
  }
});

Running

Running Tests

  • npm test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit https://ember-cli.com/.

ember-cli-owl-carousel's People

Contributors

dulmandakh avatar ember-tomster avatar ruslanzavacky avatar

Watchers

 avatar  avatar

Forkers

shanekoss

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.