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.

302 lines
10 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
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="library/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/semantic.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 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')
  168. .shape({
  169. moduleName: 'Godzilla'
  170. })
  171. ;</div>
  172. </li>
  173. <li>Default settings for the module can be overridden by modifying $.fn.shape.settings.
  174. <br><div class="code">$.fn.shape.settings.moduleName = 'Godzilla';</div>
  175. </li>
  176. <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.
  177. <br><div class="code">$('.foo').shape('setting', 'moduleName', 'Godzilla');</div>
  178. </li>
  179. </ol>
  180. <h3>Reading Settings</h3>
  181. <p>Settings can also be read programmatically: <div class="code">$('.foo').shape('setting', 'moduleName');</div>
  182. <h3>Defaults</h3>
  183. <table class="ui grid settings table">
  184. <thead>
  185. <th>Setting</th>
  186. <th>Default</th>
  187. <th>Description</th>
  188. </thead>
  189. <tbody>
  190. <tr>
  191. <td>useCSS</td>
  192. <td>True</td>
  193. <td>Not currently supported. Will allow for use of javascript requestAnimationFrame transitions instead of css3 transitions.</td>
  194. </tr>
  195. <tr>
  196. <td>duration</td>
  197. <td>1000ms</td>
  198. <td>Duration of animation (javascript only). To modify animation duration for css simply modify the css property transition-duration.</td>
  199. </tr>
  200. <tr>
  201. <td>easing</td>
  202. <td>easeInOutQuad</td>
  203. <td>Easing equation for animation (javascript only). To modify the easing for css simply modify the css property transition-easing</td>
  204. </tr>
  205. <tr>
  206. <td>selector</td>
  207. <td>
  208. <div class="code" data-type="css">{
  209. shape : '.shape',
  210. side : '.side'
  211. }</div>
  212. </td>
  213. <td>Object containing selectors used by module.</td>
  214. </tr>
  215. <tr>
  216. <td>className</td>
  217. <td>
  218. <div class="code">{
  219. css : 'css',
  220. animating : 'animating',
  221. hidden : 'hidden',
  222. active : 'active'
  223. }</div>
  224. </td>
  225. <td>Object containing class names used by module.</td>
  226. </tr>
  227. <tr class="emphasis">
  228. <td colspan="3">Callbacks</td>
  229. </tr>
  230. <tr>
  231. <td>beforeChange</td>
  232. <td>None</td>
  233. <td>Callback before side is changed. This context is the new side.</td>
  234. </tr>
  235. <tr>
  236. <td>onChange</td>
  237. <td>None</td>
  238. <td>Callback after side is changed. This context is new side.</td>
  239. </tr>
  240. <tr class="emphasis">
  241. <td colspan="3">Standard</td>
  242. </tr>
  243. <tr>
  244. <td>moduleName</td>
  245. <td>Shape</td>
  246. <td>Name used in debug logs</td>
  247. </tr>
  248. <tr>
  249. <td>debug</td>
  250. <td>True</td>
  251. <td>Provides standard debug output to console</td>
  252. </tr>
  253. <tr>
  254. <td>performance</td>
  255. <td>False</td>
  256. <td>Provides standard debug output to console</td>
  257. </tr>
  258. <tr>
  259. <td>verbose</td>
  260. <td>False</td>
  261. <td>Provides ancillary debug output to console</td>
  262. </tr>
  263. <tr>
  264. <td>namespace</td>
  265. <td>shape</td>
  266. <td>Event namespace. Makes sure module teardown does not effect other events attached to an element.</td>
  267. </tr>
  268. <tr>
  269. <td>errors</td>
  270. <td colspan="2">
  271. <div class="code">{
  272. side : 'You tried to switch to a side that does not exist.',
  273. method : 'The method you called is not defined'
  274. }</div>
  275. </td>
  276. </tr>
  277. </tbody>
  278. </table>
  279. </div>
  280. </body>
  281. </html>