index.html 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. ---
  2. layout: cordova
  3. permalink: /
  4. priority: 1.0
  5. change_frequency: monthly
  6. ---
  7. <!-- Main jumbotron for a primary marketing message or call to action -->
  8. <div id="hero">
  9. <div class="container vertical-center-parent">
  10. <div id="hero_section" class="row vertical-center-child">
  11. <div class="col-xs-12 col-sm-5 cordova-bot">
  12. <img src="{{ site.baseurl }}/static/img/cordova_bot.png" />
  13. </div>
  14. <div class="col-xs-12 col-sm-7 hero_content">
  15. <img class="hero_logo hidden-xs" src="{{ site.baseurl }}/static/img/cordova-logo-newbrand-textonly.svg" />
  16. <!-- <img class="hero_logo visible-xs" src="{{ site.baseurl }}/static/img/logo_full_2.svg" /> -->
  17. <p>使用<em>HTML</em>, <em>CSS</em> &amp; <em>JS</em>进行移动App开发</p>
  18. <p>多平台<em>共用一套代码</em></p>
  19. <p>免费<em>开源</em></p>
  20. <p>Cordova中文网QQ交流群:<em>1036846871</em></p>
  21. <div class="hero_supported_platforms">
  22. <img src="{{ site.baseurl }}/static/img/platform-logos.svg" width="140px" />
  23. </div>
  24. <div class="hero_buttons">
  25. <a href="#getstarted" class="col-xs-12 col-sm-5 btn btn-lg btn-primary">
  26. 入门
  27. </a>
  28. <a href="{{ site.baseurl }}/docs/zh-cn/{{ site.default_linked_docs_version }}/" class="col-xs-12 col-sm-6 btn btn-lg btn-primary">
  29. 文档
  30. </a>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. <div id="hero_bottom_strip">
  37. <div class="container">
  38. <div class="row">
  39. <div class="col-xs-4">
  40. <div class="row">
  41. <div class="col-sm-4 col-md-3"><div class="sprite_img" id="sprite_shared_code"></div></div>
  42. <div class="col-sm-8 col-md-9"><div class="value_prop"><p>跨平台重用代码</p></div></div>
  43. </div>
  44. </div>
  45. <div class="col-xs-4">
  46. <div class="row">
  47. <div class="col-sm-4 col-md-3"><div class="sprite_img" id="sprite_offline"></div></div>
  48. <div class="col-sm-8 col-md-9"><div class="value_prop"><p>支持离线场景应用</p></div></div>
  49. </div>
  50. </div>
  51. <div class="col-xs-4">
  52. <div class="row">
  53. <div class="col-sm-4 col-md-3"><div class="sprite_img" id="sprite_apis"></div></div>
  54. <div class="col-sm-8 col-md-9"><div class="value_prop"><p>访问设备原生API</p></div></div>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="blue-divider"></div>
  61. <div class="container get-started-section">
  62. <!-- Example row of columns -->
  63. <div class="row">
  64. <div class="col-md-12 text-center">
  65. <a id="getstarted" name="getstarted" class="fragment-anchor"></a>
  66. <h1>快速入门</h1>
  67. </div>
  68. </div>
  69. <!-- GETTING STARTED -->
  70. <div class="row">
  71. <div class="col-md-1 col-xs-2">
  72. <div class="number_circle">1</div>
  73. </div>
  74. <div class="col-md-7 col-xs-10">
  75. <h2>安装Cordova</h2>
  76. <p>Cordova的命令行运行在 <a target="_blank" href="http://nodejs.org/">Node.js</a> 上面并且可以通过
  77. <a target="_blank" href="https://npmjs.org/package/cordova">NPM</a>.
  78. 安装。 根据 <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/index.html#develop-for-platforms">平台具体指导</a>
  79. 安装相应平台的依赖。打开命令提示符或终端,然后键入 <code>npm install -g cordova</code>.</p>
  80. </div>
  81. <div class="col-md-4 col-xs-12">
  82. <div class="well_code">
  83. <div>
  84. <button type="button" class="btn btn btn-primary pull-right btn-copy" data-clipboard-target="copy-npm-install-text">Copy</button>
  85. </div>
  86. $ npm install -g cordova
  87. <div id="copy-npm-install-text" class="copy-text">npm install -g cordova</div>
  88. </div>
  89. </div>
  90. </div>
  91. <div class="row">
  92. <div class="col-md-1 col-xs-2">
  93. <div class="number_circle">2</div>
  94. </div>
  95. <div class="col-md-7 col-xs-10">
  96. <h2>创建一个项目</h2>
  97. <p>使用命令行创建一个空的Cordova项目。导航到你希望创建项目的目录,然后键入 <code>cordova create &lt;path&gt;</code>.</p>
  98. <p>要知道这个命令完整的选项,键入 <code>cordova help create</code>.</p>
  99. </div>
  100. <div class="col-md-4 col-xs-12">
  101. <div class="well_code">
  102. <div>
  103. <button type="button" class="btn btn btn-primary pull-right btn-copy" data-clipboard-target="copy-cordova-create-text">Copy</button>
  104. </div>
  105. $ cordova create MyApp
  106. <div id="copy-cordova-create-text" class="copy-text">cordova create MyApp</div>
  107. </div>
  108. </div>
  109. </div>
  110. <div class="row">
  111. <div class="col-md-1 col-xs-2">
  112. <div class="number_circle">3</div>
  113. </div>
  114. <div class="col-md-7 col-xs-10">
  115. <h2>添加一个平台</h2>
  116. <p>在创建完一个Cordova项目后,导航到项目目录。在项目目录中,你需要添加你想构建app的平台</p>
  117. <p>为了添加平台, 键入 <code>cordova platform add &lt;platform name&gt;</code>.</p>
  118. <p>为了知道你可以添加的平台,你可以运行 <code>cordova platform</code>.</p>
  119. </div>
  120. <div class="col-md-4 col-xs-12">
  121. <div class="well_code">
  122. <div>
  123. <button type="button" class="btn btn btn-primary pull-right btn-copy" data-clipboard-target="copy-cordova-platform-add-text">Copy</button>
  124. </div>
  125. <p>$ cd MyApp</p>
  126. <p>$ cordova platform add browser</p>
  127. <div id="copy-cordova-platform-add-text" class="copy-text">cd MyApp&#10;cordova platform add browser</div>
  128. </div>
  129. </div>
  130. </div>
  131. <div class="row">
  132. <div class="col-md-1 col-xs-2">
  133. <div class="number_circle">4</div>
  134. </div>
  135. <div class="col-md-7 col-xs-10">
  136. <h2>运行App</h2>
  137. <p>在命令中,键入 <code>cordova run &lt;platform name&gt;</code>.</p>
  138. </div>
  139. <div class="col-md-4 col-xs-12">
  140. <div class="well_code">
  141. <div>
  142. <button type="button" class="btn btn btn-primary pull-right btn-copy" data-clipboard-target="copy-cordova-run-text">Copy</button>
  143. </div>
  144. $ cordova run browser
  145. <div id="copy-cordova-run-text" class="copy-text">cordova run browser</div>
  146. </div>
  147. </div>
  148. </div>
  149. <div class="row">
  150. <div class="col-md-1 col-xs-2">
  151. <div class="number_circle">5</div>
  152. </div>
  153. <div class="col-md-7 col-xs-10">
  154. <h2>通常的下一步</h2>
  155. <ul class="nav">
  156. <li>
  157. <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/guide/overview/">阅读文档</a>
  158. </li>
  159. <li>
  160. <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/guide/cli/#add-plugins">添加插件</a>
  161. </li>
  162. <li>
  163. <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/config_ref/images.html">自定义App ICON</a>
  164. </li>
  165. <li>
  166. <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/config_ref/">配置你的App</a>
  167. </li>
  168. </ul>
  169. </div>
  170. <div class="col-md-4 col-xs-12">
  171. </div>
  172. </div>
  173. </div>
  174. <!-- /container -->
  175. <div class="blue-divider"></div>
  176. <div class="container-fluid dark vertical-aligned-columns">
  177. <div class="container">
  178. <div class="row showcase_section_intro" id="supported_platforms_section">
  179. <div class="col-md-12 text-center">
  180. <h1>支持平台</h1>
  181. <h2>查看每个平台
  182. <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/guide/support/index.html">支持特性</a> 列表</h2>
  183. <p>
  184. Cordova包装你的HTML/JavaScript app到原生app容器中,可以让你访问每个平台设备的功能。这些功能通过统一的JavaScript API提供,让你轻松的编写一组代码运行在几乎市面上的所有手机和平板上,并可以发布到相应的app商城中。
  185. </p>
  186. </div>
  187. </div>
  188. </div><!-- /container -->
  189. <div class="container-fluid supported_platforms vertical-aligned-columns">
  190. <div class="container">
  191. <div class="row">
  192. <div class="col-md-12">
  193. <ul class="platform_logos">
  194. <li><img src="{{ site.baseurl }}/static/img/3rdparty_logo_sprite.svg"/></li>
  195. </ul>
  196. </div>
  197. </div>
  198. </div>
  199. </div>
  200. {% include tools_and_showcase.html %}
  201. </div><!-- /container-fluid -->