0.2.0 • Published 8 years ago

bomobile v0.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

bo

a small (1.6k gzipped) mvv framework for authoring mobile apps with native-like performance. full unit test coverage.

screenshot

demo

http://eighttrackmind.github.io/bo/demo/

what?

  • barebones mvv (fully tested)
  • smooth paging and sliding animation

usage

html

  • <div bo-pane="foo">...</div> - set a pane's ID to foo (works with any tag, not just div)
  • <a bo-trigger="foo">...</div> - slide to the pane with ID foo when clicked/tapped (works with any tag, not just a)

coffee (or js if you prefer)

see https://github.com/eighttrackmind/bo/tree/master/coffee

usage

Put your pages into a single HTML file. Each pane ("screen") should have a unique data-bo-pane attribute. To trigger another pane when clicked/tapped, give the trigger a data-bo-trigger-pane attribute.

<div bo-pane="paneId">
	<button bo-trigger="anotherPaneId">Next</button>
</div>

Link to bo.css in your <head>:

...
<head>
	<link rel="stylesheet" href="bo.css" />
...

Then install dependencies:

npm install

Finally, link to dependencies followed by bo.js at the bottom of your <body>:

	...
	<script src="node_modules/izzy/izzy.js"></script>
	<script src="node_modules/umodel/umodel.js"></script>
	<script src="bo.js"></script>
</body>

api

# create a new Bo instance
bo = new Bo
MethodArgumentsDescriptionExample
on"event1...", handlerAttach a DOM event listenerbo.on "mousedown touchstart", (event) -> ...
registerDOMElementRegister a DOM Element as a Bo panebo.register document.querySelector "#id"
hideAll-Hide all Bo panesdo bo.hideAll
show"id"Show pane with the given IDbo.show "myPaneId"

options

# create a new Bo instance, passing in a custom options dictionary
new Bo options
OptionTypeDefaultDescription
paneAttributeString"bo-pane"Attribute indicating that an element is a Bo panepaneTriggerAttributeString"bo-trigger"Attribute indicating that an element should trigger a bo pane
changeFunction(PaneInstance) ->Callback fired when a Bo pane is shown

building it yourself

npm install
grunt
0.2.0

8 years ago

0.1.11

9 years ago

0.1.10

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago