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.

298 lines
10 KiB

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