Recent stolen bikes & search widget
Alert people to recent thefts! Add a convenient way to search for stolen bikes right on your page.
All you need to do is include this HTML snippet where you would like the widget to appear:
And add this to the header of your page:
A few options for customization and configuration:
|property||what it does||default|
||Find stolen bikes near this location first (address, city, state or lat/long)||Shows recent stolen near ip geolocation|
||max-height for the widget in pixels||400px|
||Boolean - whether or not it should fetch recent stolen bikes (it starts just as a search widget)||false|
||Don't store recent results in localstorage. For development purposes||false|
Set the options by adding the attributes and value to the
div you add to your page. For example:
<div id="binx_stolen_widget" data-location="Portland, OR" data-height="1000"></div>
(This sets the initial search to Portland, OR and makes the widget a max of 1000px high.)
Under the hood
Saves the response from the Bike Index API in localStorage for 3 hours.
Requires jQuery. Sorry.
You can use it however you want (MIT license for those who care)
To run it locally
bundle installand run
jekyll serve. Open the url that is printed out on your console.
This site is deployed using github pages and cloudflare universal ssl. You can access it at https://widget.bikeindex.org
Made with all the