Ratchet
Build mobile apps with simple HTML, CSS, and JS components.
Table of contents
Getting started
- Clone the repo with
git clone https://github.com/twbs/ratchet.git
or just download the bundled CSS and JS - Read the docs to learn about the components and how to get a prototype on your phone
- Check out examples
Take note that our master branch is our active, unstable development branch and that if you're looking to download a stable copy of the repo, check the tagged downloads.
What's included
Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this:
ratchet/
├── css/
│ ├── ratchet.css
│ ├── ratchet.min.css
│ ├── ratchet-theme-android.css
│ ├── ratchet-theme-android.min.css
│ ├── ratchet-theme-ios.css
│ └── ratchet-theme-ios.min.css
├── js/
│ ├── ratchet.js
│ └── ratchet.min.js
└── fonts/
├── ratchicons.eot
├── ratchicons.svg
├── ratchicons.ttf
└── ratchicons.woff
We provide compiled CSS and JS (ratchet.*
), as well as compiled and minified CSS and JS (ratchet.min.*
). The Ratchicon fonts are included, as are the optional Android and iOS platform themes.
Documentation
Ratchet's documentation is built with Jekyll and publicly hosted on GitHub Pages at http://goratchet.com. The docs may also be run locally.
Running documentation locally
- If necessary, install Jekyll (requires v3.0.x).
- Windows users: Read this unofficial guide to get Jekyll up and running without problems.
- Install the Ruby-based syntax highlighter, Rouge, with
gem install rouge
. - From the root
/ratchet
directory, runjekyll serve
in the command line. - Open http://localhost:4000 in your browser, and boom!
Learn more about using Jekyll by reading its documentation.
Documentation for previous releases
Documentation for v1.0.2 has been made available for the time being at http://goratchet.com/1.0.2/ while folks transition to Ratchet 2.
Previous releases and their documentation are also available for download.
Support
Questions or discussions about Ratchet should happen in the Google group or hit us up on Twitter @GoRatchet.
Contributing
Please file a GitHub issue to report a bug. When reporting a bug, be sure to follow the contributor guidelines.
Troubleshooting
A small list of "gotchas" is provided below for designers and developers starting to work with Ratchet.
- Ratchet is designed to respond to touch events from a mobile device. In order to use mouse click events (for desktop browsing and testing), you have a few options:
- Enable touch event emulation in Chrome (found in the overrides tab in the web inspector preferences)
- Use a JavaScript library like fingerblast.js to emulate touch events (ideally only loaded from desktop devices)
- Script tags containing JavaScript will not be executed on pages that are loaded with push.js. If you would like to attach event handlers to elements on other pages, document-level event delegation is a common solution.
- Ratchet uses XHR requests to fetch additional pages inside the application. Due to security concerns, modern browsers prevent XHR requests when opening files locally (aka using the
file://
protocol); consequently, Ratchet does not work when opened directly as a file.- A common solution to this is to simply serve the files from a local server. One convenient way to achieve this is to run
python -m SimpleHTTPServer <port>
to serve up the files in the current directory tohttp://localhost:<port>
- A common solution to this is to simply serve the files from a local server. One convenient way to achieve this is to run
Versioning
For transparency into our release cycle and in striving to maintain backward compatibility, Ratchet is maintained under the Semantic Versioning guidelines. Sometimes we screw up, but we'll adhere to these rules whenever possible.
Releases will be numbered with the following format:
<major>.<minor>.<patch>
And constructed with the following guidelines:
- Breaking backward compatibility bumps the major while resetting minor and patch
- New additions without breaking backward compatibility bumps the minor while resetting the patch
- Bug fixes and misc changes bumps only the patch
For more information on SemVer, please visit http://semver.org/.
Maintainers
Connor Sears
Created by Connor Sears, Dave Gamache, and Jacob Thornton.
License
Ratchet is licensed under the MIT License.
Support for other browsers
I think that Ratchet could be a good alternative for jQuery mobile — not just for apps, but also as mobile websites framework. Personally I like that Ratchet is small and bloat-free. But mobile sites need to support different mobile browsers: Opera mobile, IE (Windows Phone) and Firefox mobile too. Maybe full support for all browsers is difficult task (for example, animation and other things), but I'm sure that even correct vendor prefixes for CSS (not only -webkit-, but -o-, -moz- and -ms-) could make first step in right direction. What do you think?
WIP: Ratchet 2
The initial launch of Ratchet aimed to provide the simplest way to prototype iPhone apps in HTML, CSS, and JavaScript. It's been pretty quiet around here ever since that initial release but this pull request should give some insight into the upcoming 2.0 release.
This pull request doesn't reflect the final feature set or todo list for version 2.0. We'll be updating the pr with new features and todos as we continue development. Think of this as a living document.
General
CSS
With 2.0, Ratchet is going to be rewritten in SASS. Among other things, this will allow for greater flexibility in theming the look a feel of your prototypes. We'll also be pruning the CSS to remove unneeded code.
Nav bars
.bar-nav
..content
now uses padding-top and padding-bottom to allow content to bleed through the nav bar.Tab bars
Standard bars
.footer-secondary
and.footer-secondary-tab
Segmented controllers
.active
classTable views
.table-view
.:active
.Buttons
button
element..btn
Badges
.badge
instead of.count
Popovers
.bar-nav
Forms
Toggles
Push
Headings & body copy
Ratchicons
With 2.0 we'll be introducing Ratchicons, custom designed icons for Ratchet. We'll be adding a base set and continuing to expand as we go.
Themes
Fix for issue #261, removed carets from Android list view
LMK if this needs any revisions, hopefully this is good enough to :ship:
Sorry if the commits seem a little messy, I kept pulling from the upstream master to keep my local copy updated.
Screenshot: https://www.dropbox.com/s/99mktsg8bwutxr8/Screen%20Shot%202014-02-26%20at%2011.48.59%20PM.png
:hand:
Added modal window feature
Added a slide up from the bottom modal window that could be used to:
test/components/modals.html
for a working demo.Any queries? @fat @dhgamache @connors ?
Yes, that is tribe.
Specify modal selector in data attribute
Fixes #682.
Instead of hijacking the
href
attribute of an anchor tag to indicate a selector of a modal that we'd like to display on it being clicked. We can rather make use of adata-modal
attribute to indicate the selector of the desired modal.Add unit test to Ratchet
Hi,
We talked about to add unit test to Ratchet (https://github.com/twbs/ratchet/issues/723). This is why I made this PR.
I chose to use Jasmine. It's the beginning I'll add more unit tests if it's ok.
/CC @cvrebert
Add JSHint support and enable strict mode
Fixes #280. Fixes #285.
TODO:
global
directivesbitwise
and ~~immed
~~, removeboss
/CC @connor @connors @cvrebert @mdo
IE 8 JS errors
I sort of worked around this but I don't like my way
Integrate `grunt-contrib-connect` for easier local development
Integrate grunt-contrib-connect, grunt-open, add a task watch docs, run build and do live reload. After run
$ grunt server
, open docs in alocalhost:8000
and run watch task.Fixes #539: Integrate grunt-scss-lint
Fixes #539: Integrate grunt-scss-lint: I integrated grunt-scss-lint just because it looks good. Then, there were some warning by scss-lint so I've fixed that.
JS fixes
This is totally a WIP, but it works for me in both Firefox and Chome without any
TypeError
s./CC @connor @connors @fat
Any suggestions are welcome.
PS. IE is broken after #446
readAsArraybuffer issue
Can you help me please with this problem? i want to store files on firebase . i have all files with the same size in storage firebase (16 B ),and when i open them there are no content.
`import { Component } from '@angular/core'; import { File} from '@ionic-native/file/ngx'; import { FileChooser } from '@ionic-native/file-chooser/ngx'; import { FilePath } from '@ionic-native/file-path/ngx'; import { FireBaseService } from '../services/firebase-service.service'
@Component({ selector: 'app-home', templateUrl: 'home.page.html', styleUrls: ['home.page.scss'],
}) export class HomePage {
fileforSending ; fileUri :string; filePath :string; fileName :string; fileType :string; buffer ; entry;
constructor( private fireService:FireBaseService, private fileChooser:FileChooser, private file :File, private pathConverter :FilePath) { }
choose(){ this.fileChooser.open() .then(uri => { //getting URI of a choosen file this.fileUri = uri; return this.file.resolveLocalFilesystemUrl(this.fileUri);
} } `
import { Injectable } from '@angular/core'; import {AngularFireDatabase} from "@angular/fire/database";
import {AngularFireStorage} from "@angular/fire/storage";
@Injectable({ providedIn: 'root' }) export class FireBaseService {
}
export { FireBaseService as ExportedClass };
Is this project dead?
Sorry to use an issue for this question, but couldn't find a community. I've seen there hasn't been any movement since 2016, however there's no notice on the README.md nor the goratchet.com page that says anything about it going down/deprecated/closed/whatever.
Does someone know what happened to this project?
Comeback Ratchet!
I have a web project only target to mobile users, kind of PWA. So I don't need mobile-first or responsive CSS library.
since yesterday I try to find simple css/js library that target only mobile browser, surprisingly I couldn’t find even a single one, most library are for both mobile and desktop. I found some mobile only framework like framewrok7, ionic, onsen.io but they are full featured framework that might overkill me.
after spent several hours on google finally I found Ratchet, I'm very glad because it match my need, the exact library I want, but sadly there are some small bugs and the last commit is 2 years ago.
My point is Ratchet is unique library on the market and I believe many developers have situation to need Ratchet
Ratchet's icon cant display
I am using cordova and ratchet to build a mobile application but my icon cant display correctly. Is there any solution Phone:Redmi note3
My code `