Giter Site home page Giter Site logo

rocket-flicker's Introduction

NO LONGER SUPPORTED

Rocket Flicker

A module that lets you flick through content.

Getting Started

Install via NPM.

npm install rocket-flicker

NOTE that this module has a dependency Rocket Tools (28kb) which will automatically be installed as well.

Start by including the necessary files.

<head>
   <link href="node_modules/rocket-flicker/css/flicker.min.css" rel="stylesheet" type="text/css">
</head>
<body>
   /* Your content goes here */
   <script src="node_modules/rocket-tools/js/tools.min.js"></script>
   <script src="node_modules/rocket-flicker/js/flicker.min.js"></script>
</body>

Basic Examplechrishumboldt/Rocket-Form

See the setup of the HTML and Javascript call below.

<div class="mod-flicker">
   <ul>
      <li data-background="image-url.jpg">
         <div class="mod-flicker-title">Example Heading</div>
         <div class="mod-flicker-text">Sub Text</div>
      </li>
      <li data-background="image-url.jpg">
         <div class="mod-flicker-title">Example Heading</div>
         <div class="mod-flicker-text">Sub Text</div>
      </li>
   </ul>
</div>

<script>
Rocket.flicker();
</script>

Initialisation

Each initialisation will return an array of module objects (An array will always be returned even if the target is an id). This includes the flicker element itself as well as relevant methods. For example:

const flickers = Rocket.flicker();

// The flickers and all methods
for (let i = 0, len = flickers.length; i < len; i++) {
   console.log(flickers[i].flicker);
   flickers[i].move(3); // Move this flicker to position 3
   flickers[i].start(); // Start the auto flicker
   flickers[i].stop(); // Stop the auto flicker
}

Alternatively if you know the target is unique you can reference the flicker right away with the 0 index. For example:

const myFlicker = Rocket.flicker({
   target: '#flicker'
})[0]; // Reference the first item in the array right away.

myFlicker.stop();

Options

See the different options you have available on initialization.

Name Default Options Description
target .rocket-flicker Set the flicker target elements.
animation transformslide transformslide transitionfade transitionslide Choose the animation type you want.
arrows true true false Arrows are used to navigate back and forth between the flicks.
arrowsConstraint false true false When you get to the end of the flicks pressing the next arrow will navigate you to the beginning again should you have a false constraint. The same applies to the previous arrow.
autoFlick true true false Sets the flick to run automatically. A manual flick resets the delay.
autoFlickDelay 10 Set the delay (in seconds) between each auto flick.
dotAlignment center center left right Set the horizontal alignment of the dot navigation.
dots true true false Dot navigation is used to indicate and navigate between the flicks.
pauseOnHover false true false Pause / Stop the autoFlick on hover. Restart it again when the mouse leaves.
position 1 Set the starting flick.

Defaults

You can also overwrite the module options globally by altering the defaults. To do so reference the defaults object property. For example:

Rocket.defaults.flicker.autoFlickDelay = 20;
Rocket.defaults.flicker.dots = false;

Advanced Example

See an advanced example below with options as per the above.

const myFlicker = Rocket.flicker({
   target: '.flicker-example',
   animation: 'transitionfade',
   autoFlick: false,
   dotAlignment: 'right'
});

Make It Touch Enabled

To make your flicker touch enabled, just included the Hammer library (Rocket Flicker comes with a copy). For example:

<body>
   /* Your content goes here */
   <script src="node_modules/rocket-flicker/js/hammer-v2.0.3.min.js"></script>
   <script src="node_modules/rocket-tools/js/tools.min.js"></script>
   <script src="node_modules/rocket-flicker/js/flicker.min.js"></script>
</body>

Rebuilding Files

In order to rebuild production files you will first need to install the Rocket Command Line Tool. To do so run the following npm command in your terminal. NOTE that this package is installed globally and can take a while as it has quite a few dependencies.

npm install rocket-command -g

Once installed navigate to the Rocket Flicker root and run the following command:

rocket build

The relevant minified CSS and JS will now be rebuilt.

Flickerplate Deprecated

The original library, Flickerplate, has been deprecated. The entire Webplate project is being refactored and rebranded with a new development philosophy. Flickerplate will be maintained only with bug fixes under the flickerplate branch.

Author

Created and maintained by Chris Humboldt
Website: chrishumboldt.com
GitHub github.com/chrishumboldt

Contributors

dsuket

Copyright and License

Copyright 2018 Rocket Project

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

rocket-flicker's People

Contributors

amilajack avatar chrishumboldt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rocket-flicker's Issues

on('drag')

not sure if it's jquery finger but on('drag') does not work on ie10.

Is it possible to change the animation type for the transition between last and first slides?

I'm using arrow-constraints="false" to allow looping back to first slide from last slide. No matter how i set the flick-animation type, I am getting a different animation type between the last and first slides -- when you click the right arrow on the last slide it shuffles through all of the slides very quickly before it returns to the first slide. I want a smooth transition from last to first, that looks the same as all the other transitions. Example here: http://03be309.netsolhost.com/wordpress/

Is there a way to change this setting, something I can modify in the .js file? I can't figure out where/how to do this.

Custom auto-flick-delay

Hey,

I tried to do a slideshow where some slides last longer than others but without success.

I've tried something like this:

<div class="flicker-example">
    <ul>
        <li data-background="img/flicker-1.jpg">
            <div class="flick-title">Flickerplate Is Working</div>
            <div class="flick-sub-text">Heaven forbid this package you downloaded is broken. That wouldn't be embarrassing at all.</div>
        </li>
        <li data-auto-flick-delay="60" data-background="img/flicker-2.jpg">
            <div class="flick-title">Teste</div>
            <div class="flick-sub-text">Take a look at the extensive documentation to see how you can change the settings in multiple ways.</div>
        </li>
        <li data-background="img/flicker-3.jpg">
            <div class="flick-title">Touch Enabled Through the Hammer.js Library</div>
            <div class="flick-sub-text"><a href="http://hammerjs.github.io/">Hammer.js</a> is a great touch library that has been included as part of the Flickerplate package.</div>
        </li>
    </ul>
</div>

The "data-auto-flick-delay" tag seems to work only on the main div ("flicker-example").
Is this possible to achieve?

Thanks.

Link to add more time

This is in addition to the display app that I'm making, it'd be great to have a link to add more time to the auto timer before it continues to slide.

Flicker Postion

Is there a way to change the starting position of the slide. Like on the second slide.

I believe i altered $flick_position = 1; but not much happened. I'll keep looking for a solution, unless there is one.

Dot navigation isn't transitioning correctly

Hi, Maybe you know how to fix this.. I'm using the slider here: http://schulerbooks.com. It's a Drupal 7 site. When I click on a dot the previous dot stays lit up and I think the slide order is getting messed up a little. I did change one little thing in the js. In the fade transition where it gives the slide opacity I also added z-index in order to be able to wrap the images with special links that go to different pages on the site.

Flickerplate fade transition problem

Hi! I am trying to use the jquery-fade transition for my slider and here's what happens:
https://www.dropbox.com/s/rnaf8nfssjpyxdi/flickerplate-error.mov?dl=0

The default transition works fine (the slide) but if I try to use jquery-fade or transition-fade, only the first slide works and the rest show up blank. Also, it seems the DOM structure gets altered somehow since those social icons disappear.

Any ideas? Thanks! I really need it for the project I'm working on so any help or possible fixes are highly appreciated.

Cheers!
Alexandru Doda

height 100%

I download example from github and height 100% don't work.
- flicker height bug

ul within ul

When adding an ul within the ul the attributes of flicker-inner and flicker-content gets added. making it impossible to add ul within the slider.

Reset auto flick

Is there a way to add a timer and a reset location for the slides.
I have slides A, B, C.
Set to default at slide B.
User selects slide A, after say 20 sec, slide slides back to slide B.

Add .gitignore file

Please add .gitignore file

// ignore all grunt related directories and files.
node_modules/*/

problem internet explorer 9

Hallo, I'm a Web Designer and I've a problem in internet explorer 9. The slide doesn't go to the next image. The button changes but the slides are blocked on first. I've also try your plugin in all recent browsers, in pc and mac, in some smartphone and ipad, and it works fine. Just this problem with ie9, anyone can help me to fix?

Thanks,
Stefano

Reset timer when user active

This is part of my retail store project, when a user taps the screen or drags that counts as active and the timer should be reset to a new timer instead of the default one so that the user can read the slide before it auto rotates.

This would be a great addition...

Dynamically remove flickerplate from webpage

Hi,

I am trying to remove the flickerplate element from the web page via JS. Unfortunately after I do that, the flickerAutoFlick method keeps firing producing an error every interval. I may be missing something here but I can't find a way to stop the autoflick before disposing of the flickerplate object?

Regards
Eric

Link to slide

Is it possible to have a link that will go to the desired slide.

For right now there is empty space on the bottom it would be awesome to have a link on the bottom that would link back to a desired slide.

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.