You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

312 lines
9.9 KiB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <title>Shape Examples</title>
  6. <link rel="stylesheet" href="../src/ui/flat/panel.css" type="text/css" media="screen" />
  7. <link rel="stylesheet" href="../src/ui/flat/button.css" type="text/css" media="screen" />
  8. <link rel="stylesheet" href="../src/ui/flat/menu.css" type="text/css" media="screen" />
  9. <link rel="stylesheet" href="../src/ui/flat/form.css" type="text/css" media="screen" />
  10. <link rel="stylesheet" href="../src/ui/flat/icons.css" type="text/css" media="screen" />
  11. <link rel="stylesheet" href="../src/ui/flat/table.css" type="text/css" media="screen" />
  12. <link rel="stylesheet" href="../src/modules/ui/shape.css" type="text/css" media="screen" />
  13. <link rel="stylesheet" href="library/sidr.css" type="text/css" media="screen" />
  14. <link rel="stylesheet" href="stylesheets/example.css" type="text/css" media="screen" />
  15. <link rel="stylesheet" href="stylesheets/shape.css" type="text/css" media="screen" />
  16. <script src="../dependencies/jquery.js" type="text/javascript"></script>
  17. <script src="../src/modules/ui/shape.js" type="text/javascript"></script>
  18. <script src="../src/modules/behavior/state.js" type="text/javascript"></script>
  19. <script src="library/sidr.js" type="text/javascript"></script>
  20. <script src="library/waypoints.js" type="text/javascript"></script>
  21. <script src="javascript/example.js" type="text/javascript"></script>
  22. <script src="javascript/shape.js" type="text/javascript"></script>
  23. </head>
  24. <body id="example">
  25. <div class="sidr" id="menu">
  26. <ul>
  27. <li class="active"><a href="module.html">Introduction</a></li>
  28. <li><a>Download</a></li>
  29. <li><a href="#">UI</a>
  30. <ul>
  31. <li><a href="button.html">Button</a></li>
  32. <li><a>Text</a></li>
  33. <li><a>Headers</a></li>
  34. <li><a>Columns</a></li>
  35. <li><a>Elements (Grid System)</a></li>
  36. <li><a>Tags</a></li>
  37. <li><a>Items (Lists of Content)</a></li>
  38. <li><a>Panels (Type of Menu)</a></li>
  39. <li><a>Forms</a></li>
  40. <li><a>Fields</a></li>
  41. <li><a>Checkboxes</a></li>
  42. <li><a>Icons</a></li>
  43. <li><a>Dividers</a></li>
  44. </ul>
  45. </li>
  46. <li><a href="#">UI Modules</a>
  47. <ul>
  48. <li><a>Accordion</a></li>
  49. <li><a>Chat Room</a></li>
  50. <li><a>Modal</a></li>
  51. <li><a>Nag</a></li>
  52. <li><a>Popup</a></li>
  53. <li><a>Search</a></li>
  54. <li><a>Star Rating</a></li>
  55. <li><a>Tabs</a></li>
  56. </ul>
  57. </li>
  58. <li><a href="#">Behavioral Modules</a>
  59. <ul>
  60. <li><a>API</a></li>
  61. <li><a>Animation</a></li>
  62. <li><a>Form Validation</a></li>
  63. <li><a>Placeholder Text</a></li>
  64. <li><a class="shape.html">Shape</a></li>
  65. <li><a>State</a></li>
  66. </ul>
  67. </li>
  68. </ul>
  69. </div>
  70. <div class="ui large fixed transparent black menu">
  71. <div class="container">
  72. <div class="title item">
  73. Behavior Module: Shape
  74. </div>
  75. <div class="icon previous link item">
  76. <i class="icon left-open"></i>
  77. </div>
  78. <div class="section dropdown item">
  79. 1 of 5
  80. <div class="menu">
  81. <div class="active item">1. Introduction</div>
  82. <div class="item">2. Download</div>
  83. <div class="item">3. UI Library</div>
  84. <div class="item">4. UI Modules</div>
  85. <div class="item">5. Behavioral Modules</div>
  86. </div>
  87. </div>
  88. <div class="icon next link item">
  89. <i class="icon right-open"></i>
  90. </div>
  91. <div class="right item">
  92. <a class="icon github"></a>
  93. </div>
  94. </div>
  95. </div>
  96. <div class="ui huge left attached vertical side buttons">
  97. <div class="ui menu blue button"><i class="icon th-list"></i> Menu</div>
  98. </div>
  99. <div class="segment">
  100. <div class="container">
  101. <h1>Shape</h1>
  102. <p>Shape is a plugin for 3D transitioning elements.</p>
  103. </div>
  104. </div>
  105. <div class="main container">
  106. <div class="ui large vertical pointing panel peek">
  107. <li class="active">Examples</li>
  108. <li>Usage</li>
  109. <li>Settings</li>
  110. </div>
  111. <p>Shapes makes creating 3D tweens easier by taking care of the dirty business of calculating translations based on content sizing, which can be a confusing, frustrating task.</p>
  112. <p>The module uses 3D transformations which are currently only supported in modern versions of Chrome, Safari, and Firefox.</p>
  113. <p>Shapes is written using the semantic module specification. Semantic is a standard pattern for writing Javascript modules which intends to make understanding new code less confusing, and debugging errors less frustrating, by making coding decisions less arbitrary and more semantic. <a href="module.html">
  114. <p>Click here to read more</a> about Semantic spec, and the upcoming library.</p>
  115. <h2>Examples</h2>
  116. <h3>Regular Shape</h3>
  117. <div class="demo square shape module">
  118. <div class="shape">
  119. <div class="active jira side">
  120. <img src="images/shape/jira.png">
  121. </div>
  122. <div class="heroku side">
  123. <img src="images/shape/heroku.png">
  124. </div>
  125. <div class="quirky side">
  126. <img src="images/shape/quirky.png">
  127. </div>
  128. </div>
  129. </div>
  130. <h3>Shape</h3>
  131. <div class="ui shape buttons">
  132. <div class="active ui button" data-shape="square">Square</div>
  133. <div class="ui button" data-shape="rectangle">Rectangle</div>
  134. <div class="ui button" data-shape="irregular">Irregular</div>
  135. </div>
  136. <h3>Flip</h3>
  137. <div class="ui direction buttons">
  138. <div class="ui button" data-animation="flip" data-direction="left">Left</div>
  139. <div class="ui button" data-animation="flip" data-direction="right">Right</div>
  140. <div class="ui button" data-animation="flip" data-direction="up">Up</div>
  141. <div class="ui button" data-animation="flip" data-direction="down">Down</div>
  142. <div class="ui button" data-animation="flip" data-direction="over">Over</div>
  143. </div>
  144. <h2>Usage</h2>
  145. The plugin must be initialized once before methods can be accessed
  146. <pre>
  147. <code>
  148. $('.shape')
  149. .shape()
  150. ;
  151. </code>
  152. </pre>
  153. Transitions automatically assume next side is the next sibling (or first if last element)
  154. <pre>
  155. <code>
  156. $('.shape')
  157. .shape('flip.up')
  158. ;
  159. </code>
  160. </pre>
  161. To manually set the next side to appear use a selector or jQuery object
  162. <pre>
  163. <code>
  164. $('.shape')
  165. .shape('set.nextSide', '.second')
  166. .shape('flip.up')
  167. ;
  168. </code>
  169. </pre>
  170. Any internal method can be invoked programmatically
  171. <pre>
  172. <code>
  173. $('.shape')
  174. .shape('repaint')
  175. ;
  176. </code>
  177. </pre>
  178. <h2>Settings</h2>
  179. <p>Settings can be modified in three different ways.
  180. <ol>
  181. <li>A settings object can be passed in when initializing the plugin
  182. <br> <code>$('.foo').shape({ moduleName: 'Godzilla'});</code>
  183. </li>
  184. <li>Default settings for the module can be overridden by modifying $.fn.shape.settings.
  185. <br><code>$.fn.shape.settings.moduleName = 'Godzilla';</code>
  186. </li>
  187. <li>Settings can be changed after a module is initialized by calling the 'settings' method on the module with either a settings object or a name, value pair.
  188. <br><code>$('.foo').shape('setting', 'moduleName', 'Godzilla');</code>
  189. </li>
  190. </ol>
  191. <p>Settings can also be read programmatically: <code>$('.foo').shape('setting', 'moduleName');</code>
  192. <table class="ui grid settings table">
  193. <thead>
  194. <th>Setting</th>
  195. <th>Default</th>
  196. <th>Description</th>
  197. </thead>
  198. <tbody>
  199. <tr>
  200. <td>useCSS</td>
  201. <td>True</td>
  202. <td>Not currently supported. Will allow for use of javascript requestAnimationFrame transitions instead of css3 transitions.</td>
  203. </tr>
  204. <tr>
  205. <td>duration</td>
  206. <td>1000ms</td>
  207. <td>Duration of animation (javascript only). To modify animation duration for css simply modify the css property transition-duration.</td>
  208. </tr>
  209. <tr>
  210. <td>easing</td>
  211. <td>easeInOutQuad</td>
  212. <td>Easing equation for animation (javascript only). To modify the easing for css simply modify the css property transition-easing</td>
  213. </tr>
  214. <tr>
  215. <td>selector</td>
  216. <td>
  217. <pre>{
  218. shape : '.shape',
  219. side : '.side'
  220. }</pre>
  221. </td>
  222. <td>Object containing selectors used by module.</td>
  223. </tr>
  224. <tr>
  225. <td>className</td>
  226. <td>
  227. <pre>{
  228. css : 'css',
  229. animating : 'animating',
  230. hidden : 'hidden',
  231. active : 'active'
  232. }</pre>
  233. </td>
  234. <td>Object containing class names used by module.</td>
  235. </tr>
  236. <tr class="emphasis">
  237. <td colspan="3">Callbacks</td>
  238. </tr>
  239. <tr>
  240. <td>beforeChange</td>
  241. <td>None</td>
  242. <td>Callback before side is changed. This context is the new side.</td>
  243. </tr>
  244. <tr>
  245. <td>onChange</td>
  246. <td>None</td>
  247. <td>Callback after side is changed. This context is new side.</td>
  248. </tr>
  249. <tr class="emphasis">
  250. <td colspan="3">Standard</td>
  251. </tr>
  252. <tr>
  253. <td>moduleName</td>
  254. <td>Shape</td>
  255. <td>Name used in debug logs</td>
  256. </tr>
  257. <tr>
  258. <td>debug</td>
  259. <td>True</td>
  260. <td>Provides standard debug output to console</td>
  261. </tr>
  262. <tr>
  263. <td>performance</td>
  264. <td>False</td>
  265. <td>Provides standard debug output to console</td>
  266. </tr>
  267. <tr>
  268. <td>verbose</td>
  269. <td>False</td>
  270. <td>Provides ancillary debug output to console</td>
  271. </tr>
  272. <tr>
  273. <td>namespace</td>
  274. <td>shape</td>
  275. <td>Event namespace. Makes sure module teardown does not effect other events attached to an element.</td>
  276. </tr>
  277. <tr>
  278. <td>errors</td>
  279. <td>
  280. {
  281. side : 'You tried to switch to a side that does not exist.',
  282. method : 'The method you called is not defined'
  283. }
  284. </td>
  285. <td>Object containing localized error messages.</td>
  286. </tr>
  287. </tbody>
  288. </table>
  289. </div>
  290. </body>
  291. </html>