Giter VIP home page Giter VIP logo

bespoke's Introduction

Build Status Coverage Status Gitter

Bespoke.js

DIY Presentation Micro-Framework

Bespoke.js is a super minimal (1KB min'd and gzipped), modular presentation library for modern browsers, designed to foster a rich plugin ecosystem.

The core library sets up the presentation, provides a simple control API and manages events. Any other functionality is implemented as a plugin.

Joining the Bespoke.js ecosystem is simple with the suite of official Yeoman generators:

Creating a Presentation

Due to the highly modular nature of Bespoke.js, the quickest way to get started is with Bespoke.js Generator, a Yeoman generator that scaffolds a boilerplate presentation with a Gulp build system.

Assuming you have Node.js installed, in a blank directory:

$ npm install -g generator-bespoke
$ yo bespoke

In your newly scaffolded project, you can use the following Gulp tasks:

  • $ gulp serve to run a preview server with LiveReload.
  • $ gulp deploy to deploy to GitHub Pages.
  • $ gulp to compile static assets to 'public'.

For more detailed instructions, check out the Bespoke.js Generator repo.

If you'd prefer to craft a new presentation from scratch, you can install Bespoke.js from npm with npm install bespoke, Bower with bower install bespoke.js, or manually download either the production version or the development version. The Bespoke.js core is extremely lightweight, so you'll probably want to include some plugins.

Basic Usage

Loading Bespoke

Bespoke.js is shipped in a UMD format, meaning that bespoke and its plugins are available as CommonJS/AMD modules or browser globals.

Markup

It's completely up to you which tags you use, but the following is a good starting point:

<article id="presentation">
  <section>Slide 1</section>
  <section>Slide 2</section>
  <section>Slide 3</section>
</article>

JavaScript

To create a new presentation, Bespoke.js provides the from(selector[, plugins]) method, which takes a selector or element reference and an array of plugins, and returns a deck instance.

var deck = bespoke.from('#presentation', [plugins]);

// Next slide
deck.next();

// Previous slide
deck.prev();

// Go to a specific slide
deck.slide(0);

// Get the active slide index
deck.slide(); // 0

By default, all non-script child elements of the resolved parent element become slides. You can customize this behavior by passing a custom selector.

Plugins

Official Plugins

All official plugins can be installed from npm or Bower, e.g. $ npm install bespoke-keys or $ bower install bespoke-touch

All Plugins

You can view the full list of Bespoke.js plugins on npm by browsing the bespoke-plugin keyword.

Using Plugins

All official plugins are provided in a UMD format, meaning they are available as CommonJS/AMD modules or browser globals.

For example, if you're using CommonJS modules via browserify or webpack, it would look something like this:

var bespoke = require('bespoke'),
  classes = require('bespoke-classes'),
  keys = require('bespoke-keys'),
  touch = require('bespoke-touch');

var deck = bespoke.from('#presentation', [
  classes(),
  keys(),
  touch()
]);

If you're using browser globals, all official plugins are added to the bespoke.plugins object, for example:

var deck = bespoke.from('#presentation', [
  bespoke.plugins.classes(),
  bespoke.plugins.keys(),
  bespoke.plugins.touch()
]);

The first slide is activated automatically after all plugins are called unless one of those plugins has already activated a slide.

Themes

Official Themes

As with plugins, all official themes can be installed from npm or Bower, e.g. $ npm install bespoke-theme-cube or $ bower install bespoke-theme-voltaire

All Themes

You can view the full list of Bespoke.js themes on npm by browsing the bespoke-theme keyword.

Using Themes

Themes are included just like any other plugin:

var bespoke = require('bespoke'),
  cube = require('bespoke-theme-cube'),
  keys = require('bespoke-keys'),
  touch = require('bespoke-touch');

var deck = bespoke.from('#presentation', [
  cube(),
  keys(),
  touch()
]);

If you're using browser globals, all official themes are added to the bespoke.themes object, for example:

var deck = bespoke.from('#presentation', [
  bespoke.themes.cube(),
  bespoke.plugins.keys(),
  bespoke.plugins.touch()
]);

Advanced Usage

From HTMLElement

If you already have a reference to a DOM node, you can pass it directly to the from method.

bespoke.from(element);

Slide Selector

You can specify which elements become slides by passing an options Hash containing the key parent and, optionally, the key slides) to the from method. The value of either key can be a CSS selector or a DOM node.

bespoke.from({ parent: selectorOrElement, slides: selectorOrElementList });

For example:

bespoke.from({ parent: '#presentation', slides: '#presentation > section' });

This advanced usage allows you to include auxiliary HTML inside the parent element, skip slides that don't match the selector or explicitly filter out slides before passing on the collection.

Deck Instances

Deck instances are provided to plugins and returned when instantiating a presentation. The following properties are available on each instance.

Note: The optional eventData parameter is an object that will be merged with the event object in subsequent event handlers.

next([eventData]) Next slide.
prev([eventData]) Previous slide.
slide([index[, eventData]]) Get or set the active slide index.
on(event, callback) Attach event handlers
off(event, callback) Unbind event handlers
fire(event[, eventData]) Fire custom events. This method is primarily designed for plugin authors.
parent The deck's parent element
slides An array of slide elements
destroy Fire the destroy event. This method can be used to remove the deck from the DOM.

Events

Binding Events

Events are bound via the deck instance. Each event is passed an event object containing a reference to the relevant slide and its index.

deck.on(eventName, function(event) {
  event.slide; // Relevant slide
  event.index; // Index of relevant slide

  // Prevent default functionality (for deck interaction events only)
  return false;
});
Standard Events

In most cases, you will only need to use these standard events.

activate A slide has been activated. event.slide is the activated slide.
deactivate A slide has been deactivated. event.slide is the deactivated slide.
destroy Presentation is about to be destroyed, it's time for clean-up.
Deck Interaction Events

These events are fired when the deck has been interacted with, but before the interaction has had any effect.

This allows you to intercept the default behaviour by returning false from the event handler.

next The next slide has been requested, even if last slide is active. event.slide is the current slide.
prev The previous slide has been requested, even if first slide is active. event.slide is the current slide.
slide A specific slide has been requested. event.slide is the requested slide.
Unbinding events

When binding events, the on method returns a function that can be used to remove the event handler.

var off = deck.on('activate', function() {
  // ...
});

// Unbind event
off();

You can also use the off method. However, you must use the same function reference that was used when registering the event.

// Bind event
deck.on('activate', onActivate);

// Unbind event
deck.off('activate', onActivate);

Creating Plugins

Want a boilerplate plugin? Use the official Bespoke.js Plugin Generator.

If you'd like to learn by example, check out the list of existing plugins.

Basic Plugins

Plugins are simply functions that are called when presentations are created. They are passed a deck instance which allows you to interact with the deck's state, bind events and modify its elements.

To be consistent with the suite of official Bespoke.js plugins, it is highly recommended that you implement your plugin as a function that takes configuration and returns a plugin function.

// Creating the plugin
var myPlugin = function() {
  return function() {
    deck.on('activate', function(e) {
      console.log('Activated slide ' + (e.index + 1) + ' of ' + deck.slides.length);
    });
  }
};

The plugin can now be provided in the plugins array when using the from(selector[, plugins]) method.

// Using the plugin
bespoke.from('#presentation', [
  myPlugin()
]);

Plugins with Options

If your plugin needs some configurability, your plugin factory function can take options and return a configured plugin function.

// Creating the plugin with options
var myPlugin = function(options) {
  return function(deck) {
    var showTotal = options && options.showTotal;

    deck.on('activate', function(e) {
      console.log('Activated slide ' + (e.index + 1) +
        (showTotal ? ' of ' + deck.slides.length : ''));
    });
  }
};

// Using the plugin with options
bespoke.from('#presentation', [
  myPlugin({ showTotal: true })
]);

Custom Event Data

Additional event data can be supplied to next, prev and slide, which is merged with the final event object in subsequent event handlers.

This functionality is particularly useful if you need to differentiate between events caused by your plugin, and those caused by your end users or other plugins.

var myPlugin = function() {
  return function(deck) {

    // Differentiating our plugin's events
    deck.on('activate', function(event) {
      if (event.foo === 'bar') {
        // Triggered by my plugin...
      } else {
        // Triggered by end user, or another plugin...
      }
    });

    // Providing custom event data
    deck.next({
      foo: 'bar'
    });

  };
}

Creating Themes

Themes are essentially just plugins that also happen to insert styles into the page.

You can quickly scaffold a boilerplate theme project with the official Bespoke.js Theme Generator.

Presentations

Made a presentation with Bespoke.js? Let me know.

Questions?

Contact me on GitHub or Twitter: @markdalgleish

License

MIT License

bespoke's People

Contributors

andreypopp avatar davsket avatar joshwnj avatar kkirsche avatar kof avatar latentflip avatar markdalgleish avatar mcollina avatar medikoo avatar mojavelinux avatar mortonfox avatar neochief avatar timgates42 avatar tzi 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  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

bespoke's Issues

Next Prev Issue

Hi i create a Modul thats used bespoke on many Instances,

here the link https://gist.github.com/brewing/5697280

Whenever I click only once before he makes next and vice versa maybe you'll see what I have in my script wrong I do not come behind. What I also desperately trying to fill the bespoke.decks but this is not me successful i cant use var on and two because i dont no how many decks i have thats dynamic

Links aren't clickable in Firefox

When a Bespoke.js presentation is viewed in Firefox, and presumably all Gecko-based UAs, links aren't clickable. I have no idea why. Chrome does not have this problem.

I see nothing obvious in the console. Perhaps this is caused by a preventDefault() somewhere? I don't know.

Demo Page not working on iPad

I was trying to see how it looks on the iPad but the demo page (on http://markdalgleish.com/projects/bespoke.js/) doesnt seem to load on iPad (safari and chrome). The "Example Theme" selector seems blank, so its probably not a core issue with bespoke.js but maybe with other libraries included in that page.

I also tested the "Yeoman" presentation and that worked fine on iPad, so the framework as such is working. The one issue I saw on the Yeoman page (on an iPad) is that when you are in landscape mode, the page loads twice -- it loads up fully, refreshes and then it loads it as tiles. On the portrait mode, everything was fine with the Yeoman presentation

Browser Versions:
Chrome: 25.0.1364.124
Safari: 5.1 Mobile

plugin run when before hook events.

Hello.
I tried to create plugin that modify sections before bespoke start hook event.
But currently cannot that.

Out of necessity, I implement this function as outside plugin. But that so dirty. 😭
like this

beforeBespke('article', function(from){
  bespoke.from(from, {
    keys: true,
    touch: true,
  });
})
var beforeBespke = function(from, callback){
  // emulate bespoke from
  var parent = selectorOrElement.nodeType === 1 ? selectorOrElement : document.querySelector(selectorOrElement)
  var slides = [].filter.call(parent.children, function(el) { return el.nodeName !== 'SCRIPT'; })
  var deck = {
    slides : slides
  }

  //  :
  // do something modification to slide.
  // (This is a point want to plugin)
  //  :

  callback(from)
}

Please tell me if you have more good idea

Yeoman install with PDF export fail

Hello,
To reproduce it, use yo bespoke and keep the default values for everything but Would you like to generate PDFs?.
Resulting in:

> install-nw

/fooproject/node_modules/install-nw/cmd.js:121
  version = [v.major, v.minor, v.patch].join('.');
              ^

TypeError: Cannot read property 'major' of null
    at down (/fooproject/node_modules/install-nw/cmd.js:121:15)
    at init (/fooproject/node_modules/install-nw/cmd.js:72:11)
    at Object.<anonymous> (/fooproject/node_modules/install-nw/cmd.js:41:10)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
npm WARN presentation-hello-world@0.0.0 No repository field.
npm WARN presentation-hello-world@0.0.0 No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nw-shot@4.2.0 postinstall: `install-nw`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nw-shot@4.2.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I fix that with this trick (adding "nw" : "0.12.3" to the root of my package.json and doing an npm install). Still, launching gulp pdf results in:

[19:07:38] RangeError: Invalid array length
    at module.exports (/fooproject/node_modules/bespoke-to-pdf/index.js:43:18)
    at module.exports (/fooproject/node_modules/bespoke-pdf/index.js:13:10)
    at Gulp.<anonymous> (/fooproject/gulpfile.js:64:10)
    at module.exports (/fooproject/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/fooproject/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/fooproject/node_modules/orchestrator/index.js:214:10)
    at /fooproject/node_modules/orchestrator/index.js:279:18
    at finish (/fooproject/node_modules/orchestrator/lib/runTask.js:21:8)
    at module.exports (/fooproject/node_modules/orchestrator/lib/runTask.js:60:3)
    at Gulp.Orchestrator._runTask (/fooproject/node_modules/orchestrator/index.js:273:3)fooproject

[email protected]
[email protected]

Why not in Coffeescript?

Hello,

You've choose to use Jade for HTML and Stylus for CSS; why no CoffeeScript for JS?

Regards,
L0une

Seems to crash mobile safari on orientation change

Seems like an awesome framework. I was thinking of incorporating this into a project, but your demo page seems to crash mobile safari on orientation change. Any ideas what could be causing this? Thank you.

Coverflow Scss

/* Coverflow Theme */
@mixin transformItem($translateX, $rotateY, $scale,$zIndex,$opacitiy) {
-webkit-transform: translateX($translateX) rotateY($rotateY) scale($scale);
-moz-transform: translateX($translateX) rotateY($rotateY) scale($scale);
-ms-transform: translateX($translateX) rotateY($rotateY) scale($scale);
-o-transform: translateX($translateX) rotateY($rotateY) scale($scale);
transform: translateX($translateX) rotateY($rotateY) scale($scale);
-sand-transform: translateX($translateX) rotateY($rotateY) scale($scale);
z-index: $zIndex;
opacity: $opacitiy;
}
.coverflow {
height: 320px;
position: relative;
article{
-webkit-perspective: 600px;
-moz-perspective: 600px;
-ms-perspective: 600px;
-o-perspective: 600px;
perspective: 600px;
position: absolute;
top: 0px;
right: 0;
left: 43%;
bottom: 0;
}
section{
background: transparent;
-webkit-transform: none;
-moz-transform: none;
-ms-transform: none;
-o-transform: none;
transform: none;
background: transparent;
width: 72px;
height: 280px;
position: absolute;
padding-top: 0;
opacity: 0;
a{
color: rgb(42, 206, 185);
}
&.bespoke-active {
opacity: 1;
z-index: 1;
}
&.bespoke-slide {
-webkit-transition: -webkit-transform .7s ease, opacity .7s ease, background-color .7s ease;
-moz-transition: -moz-transform .7s ease, opacity .7s ease, background-color .7s ease;
-ms-transition: -ms-transform .7s ease, opacity .7s ease, background-color .7s ease;
-o-transition: -o-transform .7s ease, opacity .7s ease, background-color .7s ease;
transition: transform .7s ease, opacity .7s ease, background-color .7s ease;
}
&.bespoke-before {
@include transformItem(-140px,-5deg,0.5,6,0.0);
}
&.bespoke-before-3 {
@include transformItem(-128px,5deg,0.6,7,0.4);
}
&.bespoke-before-2 {
@include transformItem(-92px,5deg,0.7,9,0.5);
}
&.bespoke-before-1 {
@include transformItem(-56px,5deg,0.8,9,0.6);
}
&.bespoke-after {
@include transformItem(36px,-5deg,0.8,6,0.0);
}
&.bespoke-after-1 {
@include transformItem(56px,-5deg,0.8,9,0.6);
}
&.bespoke-after-2 {
@include transformItem(92px,-5deg,0.7,8,0.5);
}
&.bespoke-after-3 {
@include transformItem(128px,-5deg,0.6,7,0.4);
}
}
}

Activate not firing

Having trouble with the an event not firing...

var deck;
deck = bespoke.from('#presentation');
deck.on('activate', function(event) {
alert('fire');
});

this never seems to be fire, however presentation loads correctly.

How can I adjust printed pdf slide sizes etc. ?

I would like to print my presentation's https://github.com/pmalek/knngraphs/tree/gh-pages-src slides into pdf but when I try to print it in Google Chrome into pdf then I get like 2.5 slides on the page.

I have tried adjusting the styles but nothing changes. I have changed default styles/main.styl generated by bespoke generator to following:

slide_width = 1180px
slide_height = 700px

but the default values give the same results. I have also tried changing:

.bespoke-slide
  ...
  @media print
    height: 743px // seems to correspond with an A4, landscape page height

but nothing changes either.

screenshot from 2014-07-02 22 43 40

Additionally : how can I change the orientation so that printed slides are also landscape as the presentation in the browser?

Scrollable content is broken on iOS

Hi, thanks for making Bespoke.js. I found an issue with Bespoke that you can see here: http://jeremyckahn.github.io/bespoke-bug/public/

When I test this on desktop Chrome, the overflowing content can be scrolled as expected. On iOS, the content cannot be scrolled. This is because Bespoke is catching the touchmove event and preventing the default behavior. This logic breaks all overflowing, scrollable content.

In my project (not the sample linked), I was able to work around this issue by calling stopPropagation on the touchmove event for scrollable content. However, it would be great is Bespoke could handle this itself.

I might take a stab at a solution if I have time, but I at least want to report the bug and get it on your radar.

Add an off method

Add an off method as a complement to the on method. I've come across situations in my plugins when I want to listen for deck events only at certain times. It would be nice if I could unregister an event handler. jQuery has an off method for this very purpose. I think Bespoke.js needs the same.

If I understand the code correctly, it seems that if you invoke the function that is returned from the on method, it unregisters the event.

deck.on('activate', activate)();

However, this is a very bizarre API, IMO. I'd much rather have an explicit off method to call.

Current Index

I know this is trivial to derive, but it would be fantastic if the deck had a "currentIndex" property or something like it. Can't be that much more code.

Error IE8

I recently started working on a project which includes this plugin, it looks realy cool by the way, but there seems to be one small problem. When running in IE8 javascript gives an error (Object doesn't support property or method 'bind' ) this beacause of the .bind() on the 'off' and 'on' events, maybe something to look at?

Presentations could use a watermark

I saw the gulp vs. grunt presentation and was very impressed with the way it looked and behaved. So I wanted to know what was used to create the presentation. Unfortunately, none of the slides tell you what was used. I even viewed the source. Still nothing. I had to do a lot of digging to finally find out it was bespoke.

My suggestion is therefore to put a watermark on presentations somehow. It would be good publicity for the project.

insert html code example

Hello! I tried to use bespoke for presentation angularjs for my colleagues. But when i try to insert my html code bespoke removes html-tags =(
my code:

        pre.language-html 
          code.
            <head> sf</head>

with language-javascript it's the same result.

Sorry for my bad english...
Thanks!

Events return the previously-active slide instead of the newly-active slide

This may be intended behavior, although I can't imagine why. If I want to wire up a deck to display which slide is current, I want to do something like this (assume jQuery):

var deck = bespoke.horizontal.from('article');
deck.on('next', onNav);
deck.on('prev', onNav);

function onNav(e) { 
     $('.indexcounter').text(e.index);
}

But instead it shows which one WAS active instead of which one is GOING TO BE active. This severely limits the usefulness of the events.

Add control over which children become slides

Currently, any direct child of the parent element becomes a slide. This is not always the desired behavior. Certain plugins or situations may want to allow child elements to be inserted for auxiliary purposes, or to allow slides to be excluded (an abbreviated presentation). For these reasons, it would be nice if the from method allowed both the parent and the child selectors to be specified.

I propose that we allow the argument to be an array. The second item in the array is assumed to be the child selector or collection of nodes.

bespoke.from(['article', 'article > section'], [(plugins)]);

I'd also be open to using a Hash if the Array argument seems to cryptic:

bespoke.from({ container: 'article', slides: 'article > section' }, [(plugins)]);

or

bespoke.from({ parent: 'article', slides: 'article > section' }, [(plugins)]);

If we want to shorten it slightly, we could automatically prepend the container/parent selector the the slides selector so it can be written as:

bespoke.from({ parent: 'article', slides: '> section' }, [(plugins)]);

This would also ensure that they are descendant elements.

Ie

Hey,
Can you plz share a example for ie Browsers ?
i implement es5-shim.min.js and classList but the coverflow doesnt run

Migrating plugins

Hi @markdalgleish!

I would like to migrate bespoke-run. Do you have a guide, or a list of steps for migrating plugins to the new format easily?

Thanks!

Minimal quickstart.

Hi,

Such a cool premise of creating a diy presentations with a 1k core bespoke.js and a simple theme.css.

I followed the installation wizard, but probably used it wrong as it produced a 99mb presentation directory containing a 70k build.js and an empty build.css.

Can you point me to a starting presentation.html, bespoke.js and theme.css that I can use without all this extra plumbing?

Thanks,
Keenan

Query About Dynamically Adding Slides

Hello! :)

I am looking to use bespoke.js as part of a Google Chrome Extension I am building, in which the user uses bespoke.js to open new tabs as new slides, rather than new tabs in the browser.

$("#1").on("click", "a", function(event) {
event.preventDefault(); 
var the_url = $(this).attr("href");
console.log(the_url);
$("#1").after("<section></section>");
var the_section = $("#1").next("section");
$.get(the_url, function(data) {
the_section.html(data);
function init() {
        deck = bespoke.from('article');
    }
    init();
});
});

This works, and I see the new slide, but the problem is, I can't tab to it. As in, it is there, but I can't use the arrow keys to navigate to it, it is just a static slide.

I'm using the demo.js and bespoke.min from your homepage.

Please assist with this and advise if possible.

Images of my problem here:

1st

Here I have the first two slides in my DOM when the page loads, section id = 1 and another empty section. I can tab across these two as I should with ease:

2nd

But when I click a link to generate a new slide from $("#1") - I get this, I can see the new slide, but I can't tab to it, I can only tab to the empty section that was already there:

3rd

4th

I can't get to The Kingdom of Dragak's slide. I can see it, but can't use the arrow keys to get to it. I just get stuck with this:

5th

How do I fix that, if possible?

Thank you for your time and for this awesome presentation library.

deck.slide(-1) should go to last slide

To make life for plugin authors simpler, it would be nice if deck.slide(-1) went to the last slide to avoid having to constantly type:

deck.slide(deck.slides.length - 1);

If this isn't acceptable, a reasonable compromise might be to add a deck.end() method to advance to the last slide.

Touch screen

Hi.
I've tried bespoke.js on a touchscreen pc and on a tablet, but it doesn't work.
Any suggestion?

Thx

Destroy a Slide Deck

Sorry if I am missing something here, but after creating a deck, how do I destroy it?

If not already possible, can you add that as a method or advise how I would go about it? Would removing all the bespoke type classes from the specific area of the DOM suffice?

Don't activate first slide if slide is already active

Do not attempt to activate the first slide (slide 0) after calling the plugins if a slide is already activated. This allows a plugin, such as bespoke-hash, to activate the first slide.

Additionally, when the first slide is activated, the deactivate event should not be called since there is no slide to deactivate.

Javascript animation & browser support...

Hi there!
I'm really curious on this framework.
I can't make the example page work in IE9 and OP12.
Does this mean that Bespoke itself actually work but the CSS used in the example page isn't supported in these browsers?

I'm also curious if you can & if you can how to use javascript for animation instead of CSS-animation.
I've had a look in the documentation & read about events & that looks interesting but haven't had the chance to try it out...

Best, Niklas

Disable keypress support

I think bespoke is a great plugin but I need to disable keyboard support as it is not firing the on activate event. If I explicitly call next or prev on the deck it works fine and the event fires but when using both, the key presses do not fire the event. Currently I've edited the source to disable the key presses but I think there should be a boolean property to easily disable key presses without editing the source.

Thanks

Event type

When wiring up events, the action triggering the event would be awesome to have in the event object:

{
    slide: [some slide]
    , index: [number]
    , type: [keypress(left|right|spacebar)|slide|prev|next|whatever]
}

As it is, it's very hard to wire up things like history state when you can't discern between a popstate and a keypress. Maybe the option to pass in an additional param to the slide() method?

 deck.slide(index, myEventParams);

I know you're trying to keep byte size down, but I feel like the utility introduced by this would make this library exponentially more powerful. If nothing else, the ability to add custom values to the event object would be a huge improvement.

IE11, slides not centered

I used generator-bespoke to generate a presentation, accepting all the defaults. The presentation looks great under Chrome and Firefox, but under IE11, the slides are not centered.

Maybe it's got to do with bespoke-scale? It looks like the top and left margins on the

are not correct.

It's not a problem for me, as I'll be showing my slides using Chrome, but I will also be publishing my slides, and there will definitely be some IE users out there ...

Wrong viewport zoom

Hey,

I have a little problem with the viewport on Safari (desktop and iPad). They both zoom very far into the slide. You can see this in your demo on the 1., 2. 3. slides.

Is there a way to fix this? It's probably not a bespoke.js issue, but I can't find a solution. The usual way

meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"

doesn't seem to work either.

Regards,
Oliver

Add infrastructure for help text

While it's not the responsibility of bespoke.js core to provide a help view, it would be nice if core could maintain and expose help metadata so that this information can be collected and displayed.

One possible way is simply define a contract (in the README) that any plugin that contributes keybindings should fire and event with metadata for a help plugin.

deck.fire('help', [{type: 'key', value: 'f', action: 'Toggles fullscreen'}]);

Another way would be to expose methods that can be used to register and retrieve help metadata.

The focus is to figure out what foundation is necessary to make it possible to write a help plugin. The main decision is to work out the structure of the metadata. Next, we need to figure out how to get that metadata to the help plugin.

step.bind() framework does not work on iOs5

Hello,
I've read the this topic #2 where you say the issue is in the site not in the framework.

I’m using your original bespoke.js file and trying to add buttons to make the desk’s cards slide but on iOs5 bespoke.next(); breaks the js at step.bind() (into bespoke.js).

If you could fix it fast it would be great :) there are still many devices using iOs5…
Thanks

Yeoman problem

Hi,
When I install "npm install -g generator-bespoke"
I have a lot of warning and the debug wrote this:

node --debug which yo bespoke
debugger listening on port 5858
Error bespoke

You don't seem to have a generator with the name bespoke installed.
You can see available generators with npm search yeoman-generator and then install them with npm install [name].
To see the 7 registered generators run yo with the --help option.

Events don't chain

One is unable to chain events on an instance:

var deck = bespoke.horizontal('article');
deck.on('next', myfunc).on('prev', myfunc).on('slide', myfunc);

This code will fail.

Should have a way to select children (by class)

The reason I mention this, is because at the moment it's assumed that all the children of the node are slides, but that might not be the case. For example, ember inserts script tags around bound values, and this interferes with bespoke.

Adding the class name as an option would be nice.

Must order bespoke-classes before bespoke-scale

When using the bower versions of bespoke plugins, the order of plugins becomes important. If you specify bespoke-scale before bespoke-classes scaling won't work. e.g.

bespoke.from('article', [
    bespoke.plugins.bullets('li, .bullet'),
    bespoke.plugins.backdrop(),
    bespoke.plugins.scale(),
    bespoke.plugins.hash(),
    bespoke.plugins.progress(),
    bespoke.plugins.classes(),
    bespoke.plugins.state(),
    bespoke.plugins.keys(),
    bespoke.plugins.touch()
]);

won't work but this will:

bespoke.from('article', [
    bespoke.plugins.classes(),
    bespoke.plugins.bullets('li, .bullet'),
    bespoke.plugins.backdrop(),
    bespoke.plugins.scale(),
    bespoke.plugins.hash(),
    bespoke.plugins.progress(),
    bespoke.plugins.state(),
    bespoke.plugins.keys(),
    bespoke.plugins.touch()
]);

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.