Welcome to mirror list, hosted at ThFree Co, Russian Federation.

getting-started.html « docs - github.com/twbs/ratchet.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 606dda11f05f21f2985e10c4b39812615e6a676a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
---
layout: default
title: Getting started · Ratchet
---

<div class="docs-sub-header">
  {% include masthead.html %}
  <div class="container">
    <div class="column-group">
      <div class="column units-2">
        <div class="docs-sub-content">
          <h2 class="page-title">Getting started</h2>
          <p class="page-description">Once you've downloaded Ratchet, here's what to do next.</p>
        </div>
      </div>
    </div>
    {% include ad.html %}
  </div>
</div>

<div class="container">
  <div class="column-group">
    <div class="column units-2 lg-units-8">
      <ol class="docs-steps">
        <li class="step">
          <h3 class="step-title">1. Create your pages</h3>
          <p class="step-description">Use the <a href="/components" data-ignore="push">documentation</a> as a reference for all the available components and piece together the pages of your app. Be sure to look at the <a href="#pageLayout">basic page template</a> and <a href="/examples" data-ignore="push">example applications</a>. Make sure to add <code>ratchet-theme-ios.css</code> or <code>ratchet-theme-android.css</code> to your app's <code>&lt;head&gt;</code> if you have a specific platform in mind.</p>
        </li>
        <li class="step">
          <h3 class="step-title">2. Connect pages with push.js</h3>
          <p class="step-description">Read about <a href="/components/#push" data-ignore="push">push.js</a> then start connecting your pages. Push.js allows you to create a prototype that feels like a real app when you save it to your phone. (Need to have a server running).</p>
        </li>
        <li class="step">
          <h3 class="step-title">3. Save the prototype to your phone</h3>
          <p class="step-description">There are <a href="https://groups.google.com/forum/#!topic/goratchet/IboE6SCMAyw" data-ignore="push">a few ways to do this</a>, but the simplest is to run a local server on your computer, point Safari on your iPhone to your computer, then click the <span class="icon icon-share"></span> button and "Add to Home Screen". For Android, check out <a href="https://developers.google.com/chrome/mobile/docs/installtohomescreen" data-ignore="push">this guide</a>.</p>
        </li>
      </ol>

      <hr> 

      <h2 class="section-heading">Page setup</h2>
      <p class="section-lead">Three simple rules for structuring your Ratchet pages</p>
      <ol class="docs-steps">
        <li class="step">
          <h3 class="step-title">1. Fixed bars come first</h3>
          <p class="step-description">All fixed bars (<code>.bar</code>) should always be the first thing in the <code>&lt;body&gt;</code> of the page. This is really important!</p>
        </li>
        <li class="step">
          <h3 class="step-title">2. Everything else goes in <code>.content</code></h3>
          <p class="step-description">Anything that's not a <code>.bar</code> should be put in a div with the class <code>.content</code>. Put this div after the bars in the <code>&lt;body&gt;</code> tag. The <code>.content</code> div is what actually scrolls in a Ratchet prototype.</p>
        </li>
        <li class="step">
          <h3 class="step-title">3. Don't forget your meta tags</h3>
          <p class="step-description">They're included in the template.html page included in the download, but make sure they stay in the page. They are important to Ratchet working just right.</p>
        </li>
      </ol>


      <hr> 

      <h2 id="pageLayout" class="section-heading">Basic template</h2>
      <p class="section-lead">Use this basic template to get your app started.</p>
{% highlight html %}
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Ratchet template page</title>

    <!-- Sets initial viewport load and disables zooming  -->
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">

    <!-- Makes your prototype chrome-less once bookmarked to your phone's home screen -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <!-- Include the compiled Ratchet CSS -->
    <link href="ratchet.css" rel="stylesheet">

    <!-- Include the compiled Ratchet JS -->
    <script src="ratchet.js"></script>

  </head>
  <body>

    <!-- Make sure all your bars are the first things in your <body> -->
    <header class="bar bar-nav">
      <h1 class="title">Ratchet</h1>
    </header>

    <!-- Wrap all non-bar HTML in the .content div (this is actually what scrolls) -->
    <div class="content">
      <p class="content-padded">Thanks for downloading Ratchet. This is an example HTML page that's linked up to compiled Ratchet CSS and JS, has the proper meta tags and the HTML structure. Need some more help before you start filling this with your own content? Check out some Ratchet resources:</p>
      <div class="card">
        <ul class="table-view">
          <li class="table-view-cell">
            <a class="push-right" href="http://goratchet.com">
              <strong>Ratchet documentation</strong>
            </a>
          </li>
          <li class="table-view-cell">
            <a class="push-right" href="https://www.github.com/twbs/ratchet/">
              <strong>Ratchet on Github</strong>
            </a>
          </li>
          <li class="table-view-cell">
            <a class="push-right" href="https://groups.google.com/forum/#!forum/goratchet">
              <strong>Ratchet Google group</strong>
            </a>
          </li>
          <li class="table-view-cell">
            <a class="push-right" href="http://www.twitter.com/GoRatchet">
              <strong>Ratchet on Twitter</strong>
            </a>
          </li>
        </ul>
      </div>
    </div>

  </body>
</html>
{% endhighlight %}
    </div>

    <div class="column units-2 lg-units-4">
      {% include download-module.html %}
    </div>
  </div>

  <div class="column units-2">
    <!-- Footer -->
    {% include footer.html %}
  </div>
</div>