Giter VIP home page Giter VIP logo

ember-cli-slick's Introduction

@surkus/ember-cli-slick

@surkus/ember-cli-slick is a component that wraps the Slick Slider Jquery plugin functionality for use with Ember CLI.

This was originally written by laantorchaweb and has since been upgraded to work with Ember CLI >= 3.4.

The versioning has changed to correspond to the supported Slick Carousel version. Current version is 1.8.x.

Surkus is a huge proponent of Ember and as such will support maintaining these addons for as long as we use them. Giving confidence to the community that these will be properly updated and maintained over time.

Installation

From inside your ember-cli project, run the following:

ember install @surkus/ember-cli-slick

Add css to your dot sass or scss file.

  @import @surkus/ember-cli-slick/slick
  @import @surkus/ember-cli-slick/slick-theme

slick-slider Component

{{#slick-slider autoplay=true arrows=false}}
  <div class="box"> <img src="https://picsum.photos/200/300"> </div>
  <div class="box"> <img src="https://picsum.photos/200/300"> </div>
  <div class="box"> <img src="https://picsum.photos/200/300"> </div>
  <div class="box"> <img src="https://picsum.photos/200/300"> </div>
{{/slick-slider}}

Callbacks

slickInit => init //Changed for the purpose of component
beforeChange
afterChange
breakpoint
edge
reInit
setPosition
swipe
destroy
lazyLoaded
lazyLoadError
{{#slick-slider	afterChange=(action 'someAfterChange')}}
  <div class="box"> <img src="https://picsum.photos/200/300"> </div>
  <div class="box"> <img src="https://picsum.photos/200/300"> </div>
  <div class="box"> <img src="https://picsum.photos/200/300"> </div>
  <div class="box"> <img src="https://picsum.photos/200/300"> </div>
{{/slick-slider}}

Init Event

A slickInit event may be bound from your template. This event is triggered after Ember's internal didInsertElement with a DOM reference to the newly created widget allowing direct manipulation of the DOM elements after creation.

{{#slick-slider	slickInit=(action 'someInitAction')}}
  <div class="box"> <img src="https://picsum.photos/200/300"> </div>
  <div class="box"> <img src="https://picsum.photos/200/300"> </div>
  <div class="box"> <img src="https://picsum.photos/200/300"> </div>
  <div class="box"> <img src="https://picsum.photos/200/300"> </div>
{{/slick-slider}}

The responsive configuration needs to be passed by a controller property

{{#slick-slider	responsive=breakpoints}}
  <div class="box"> <img src="https://picsum.photos/200/300"> </div>
  <div class="box"> <img src="https://picsum.photos/200/300"> </div>
  <div class="box"> <img src="https://picsum.photos/200/300"> </div>
  <div class="box"> <img src="https://picsum.photos/200/300"> </div>
{{/slick-slider}}
import Controller from '@ember/controller';

const breakpoint = [
  {
    'breakpoint': 1024,
    'settings': {
      'slidesToShow': 3,
      'slidesToScroll': 3,
      'infinite': true
    }
  },
  {
    'breakpoint': 600,
    'settings': {
      'slidesToShow': 2,
      'slidesToScroll': 2
    }
  },
  {
    'breakpoint': 480,
    'settings': {
      'slidesToShow': 1,
      'slidesToScroll': 1
    }
  }
]

export default Controller.extend({
  breakpoints
});

Customization

This widget supports the full range of slick-slider configuration options. The full list with descriptions can be found at the slick-slider homepage.

  • accessibility
  • adaptiveHeight
  • autoplay
  • autoplaySpeed
  • arrows
  • asNavFor
  • appendArrows
  • appendDots
  • prevArrow
  • nextArrow
  • centerMode
  • centerPadding
  • cssEase
  • customPaging
  • dots
  • draggable
  • fade
  • focusOnSelect
  • easing
  • edgeFriction
  • infinite
  • initialSlide
  • lazyLoad
  • mobileFirst
  • pauseOnHover
  • pauseOnDotsHover
  • respondTo
  • responsive
  • rows
  • slide
  • slidesPerRow
  • slidesToShow
  • slidesToScroll
  • speed
  • swipe
  • swipeToSlide
  • touchMove
  • touchThreshold
  • useCss
  • variableWidth
  • vertical
  • verticalSwiping
  • rtl

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

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

ember-cli-slick's People

Contributors

laantorchaweb avatar lardawge avatar max-konin avatar systembugtj avatar 4xposed avatar mabab avatar tobiaslounsbury avatar sweco-secfha avatar gfrymerblink avatar ynnoj avatar ember-tomster avatar santhoshraju91 avatar superjova avatar

Watchers

 avatar 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.