Code Monkey home page Code Monkey logo

bespoke-substeps's Introduction

bespoke-substeps

Substeps for Bespoke.js presentations

Similar and initially inspired on bespoke-bullets.

    

You can see bespoke-substeps in action in e.g. Asynchronous JavaScript Interfaces presentation

Features

  • Order of display can be customized (via data-order attribute), so it doesn't necessary need to follow order in document

  • Separated steps can be configured to appear in parallel (just apply same data-order value)

  • There are four types of actions (configured via data-action attribute) that can be used:

    • activate (default) show element (turn off visibility: hidden)
    • deactivate hide element (turn on visibility: hidden)
    • insert insert element (turn off display: none)
    • remove remove element (turn on display: none)
    • mark mark element (just for duration of given step turn off background: inherit)

    How it works: step remains in opposite state to configured action until it has it's turn. Anytime later configured action is in effect, just in case of mark action, configure state is maintained only for time of given step.

Usage

If CJS bundler you're using, supports CSS modules out of a box, then just do:

var substeps = require('bespoke-substeps');

Otherwise require strictly JS logic of plugin with

var substeps = require('bespoke-substeps/dom');

and manually assure that styles placed in style.css are also loaded with your application.

Then configure bespoke to use the plugin:

bespoke.from(selector, [
  substeps()
]);

Example HTML configuration

All step elements need to share substep class. Unless overridden they're assigned with activate action and incremented order.

<section class="bespoke-slide">
  <h1>Slide title</h1>
  <ul class="substep" data-order="3" data-action="remove"><!-- Removed in final step -->
    <li class="substep">First step</li><!-- assigned  order: 0.01 -->
    <li class="substep">Second step</li><!-- assigned order: 0.02 -->
    <li class="substep" data-order="2">Fourth step (1)</p><!-- assigned  order: 2 -->
    <li class="substep" data-order="1">Third step</p><!-- assigned  order: 1 -->
    <li class="substep" data-order="2">Fourth step (2)</p><!-- assigned  order: 2 -->
    <li class="substep">Fifth step</p><!-- assigned  order: 2.01 -->
  </ul>
  <ul class="substep" data-order="3" data-action="insert"><!-- Inserted in final step -->
    <li>Final only item</li>
  </ul>
</section>

Installation

npm

In your presentation path:

$ npm install bespoke-substeps

bespoke-substeps's People

Contributors

medikoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bespoke-substeps's Issues

Substeps is not available in bower repo?

I have just tried adding bespoke-substeps in my bower.json and that is what happened :

$ grep substeps bower.json
    "bespoke-substeps": "~0.1.3",
$ bower install
bower bespoke-substeps#~0.1.3        ENOTFOUND Package bespoke-substeps not found

Is it possible to upload it to bower repos ?

Error with default bespoke installation

Hello!

Would you suggest how to fix this error I get with your plugin with default bespoke installation?

[20:10:49] Plumber found unhandled error:
 Error in plugin 'gulp-browserify'
module "./style" not found from "/Users/neochief/Dropbox/work/www/rhpre/node_modules/bespoke-substeps/index.js"

From your code, it looks like it breaks when there's css file requirement. As far as I know, browserify can't include css files out of the box, so maybe it need some special plugin to require css file? I'm not really an expert, so your feedback would be really appreciated.

Thanks!

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.