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.

692 lines
21 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. ---
  2. layout : 'default'
  3. css : 'card'
  4. element : 'card'
  5. elementType : 'view'
  6. title : 'Card'
  7. description : 'A card displays site content in a manner similar to a playing card'
  8. type : 'UI View'
  9. themes : ['Default', 'Basic', 'GitHub']
  10. ---
  11. <%- @partial('header') %>
  12. <link rel="stylesheet/less" type="text/css" href="/build/less/definitions/views/card.less" />
  13. <script src="/javascript/card.js"></script>
  14. <div class="main container">
  15. <h2 class="ui dividing header">Types</h2>
  16. <div class="example">
  17. <h4 class="ui header">Card</h4>
  18. <p>A single card.</p>
  19. <div class="ui card">
  20. <div class="image">
  21. <img src="/images/avatar/large/stevie.jpg">
  22. </div>
  23. <div class="content">
  24. <a class="header">Stevie Feliciano</a>
  25. <div class="meta">
  26. <span class="date">Joined in 2014</span>
  27. </div>
  28. <div class="description">
  29. Stevie Feliciano is a library scientist living in New York City. She likes to spend her time reading, running, and writing.
  30. </div>
  31. </div>
  32. <div class="extra content">
  33. <a>
  34. <i class="user icon"></i>
  35. 22 Friends
  36. </a>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="even example">
  41. <h4 class="ui header">Cards</h4>
  42. <p>A group of cards. </p>
  43. <div class="ui info message">
  44. <h3 class="header">Customizing your views</h3>
  45. <p>Cards are designed to be flexible to your content. Meta content can include custom elements related to your content. Each child element inside the <code>extra content</code> or <code>meta</code> group will be automatically formatted to be spaced appropriately.</p>
  46. <p>This example includes a category group, a sign-up date, and a friend count which are arbitrary class names used to format users as cards.</p>
  47. </div>
  48. <div class="ui cards">
  49. <div class="card">
  50. <div class="image">
  51. <img src="/images/avatar/large/elliot.jpg">
  52. </div>
  53. <div class="content">
  54. <div class="header">Elliot Fu</div>
  55. <div class="meta">
  56. <a class="group">Friends</a>
  57. </div>
  58. <div class="description">
  59. Elliot Fu is a film-maker from New York.
  60. </div>
  61. </div>
  62. <div class="extra content">
  63. <a class="right floated created">
  64. Joined in 2011
  65. </a>
  66. <a class="friends">
  67. <i class="user icon"></i>
  68. 22 Friends
  69. </a>
  70. </div>
  71. </div>
  72. <div class="card">
  73. <div class="image">
  74. <img src="/images/avatar/large/helen.jpg">
  75. </div>
  76. <div class="content">
  77. <div class="header">Helen Troy</div>
  78. <div class="meta">
  79. <a class="group">Friends</a>
  80. </div>
  81. <div class="description">
  82. Helen Troy is an archivist living in New York, who enjoys cooking, fine art, and gardening.
  83. </div>
  84. </div>
  85. <div class="extra content">
  86. <a class="right floated created">
  87. Joined in 2013
  88. </a>
  89. <a class="friends">
  90. <i class="user icon"></i>
  91. 22 Friends
  92. </a>
  93. </div>
  94. </div>
  95. <div class="card">
  96. <div class="image">
  97. <img src="/images/avatar/large/jenny.jpg">
  98. </div>
  99. <div class="content">
  100. <div class="header">Jenny Hess</div>
  101. <div class="meta">
  102. <a class="group">Friends</a>
  103. </div>
  104. <div class="description">
  105. Jenny is a student studying Media Management at the New School.
  106. </div>
  107. </div>
  108. <div class="extra content">
  109. <a class="right floated created">
  110. Joined in 2012
  111. </a>
  112. <a class="friends">
  113. <i class="user icon"></i>
  114. 22 Friends
  115. </a>
  116. </div>
  117. </div>
  118. <div class="card">
  119. <div class="image">
  120. <img src="/images/avatar/large/veronika.jpg">
  121. </div>
  122. <div class="content">
  123. <div class="header">Veronika Ossi</div>
  124. <div class="meta">
  125. <a class="group">Friends</a>
  126. </div>
  127. <div class="description">
  128. Veronika Ossi is a set designer living in New York who enjoys kittens, music, and partying.
  129. </div>
  130. </div>
  131. <div class="extra content">
  132. <a class="right floated created">
  133. Joined in 2013
  134. </a>
  135. <a class="friends">
  136. <i class="user icon"></i>
  137. 22 Friends
  138. </a>
  139. </div>
  140. </div>
  141. <div class="card">
  142. <div class="image">
  143. <img src="/images/avatar/large/stevie.jpg">
  144. </div>
  145. <div class="content">
  146. <a class="header">Stevie Feliciano</a>
  147. <div class="meta">
  148. <span class="date">Joined in 2014</span>
  149. </div>
  150. <div class="description">
  151. Stevie Feliciano is a library scientist living in New York City.
  152. </div>
  153. </div>
  154. <div class="extra content">
  155. <a>
  156. <i class="user icon"></i>
  157. 22 Friends
  158. </a>
  159. </div>
  160. </div>
  161. <div class="card">
  162. <div class="image">
  163. <img src="/images/avatar/large/steve.jpg">
  164. </div>
  165. <div class="content">
  166. <div class="header">Steve Jobes</div>
  167. <div class="meta">
  168. <a class="group">Acquaintances</a>
  169. </div>
  170. <div class="description">
  171. Steve Jobes is a fictional character designed to resemble someone familiar to readers.
  172. </div>
  173. </div>
  174. <div class="extra content">
  175. <a class="right floated created">
  176. Joined in 2014
  177. </a>
  178. <a class="friends">
  179. <i class="user icon"></i>
  180. 22 Friends
  181. </a>
  182. </div>
  183. </div>
  184. </div>
  185. </div>
  186. <h2 class="ui dividing header">Content</h2>
  187. <div class="example">
  188. <h4 class="ui header">Image</h4>
  189. <p>A card can contain an image</p>
  190. <div class="ui info message">Cards can use <a href="/elements/reveal.html">reveal</a> or <a href="/modules/dimmer.html">dimmers</a> to easily show additional content, or options on hover</div>
  191. <div class="ui card">
  192. <div class="ui slide masked reveal image">
  193. <img src="/images/avatar/large/jenny.jpg" class="visible content">
  194. <img src="/images/avatar/large/elliot.jpg" class="hidden content">
  195. </div>
  196. <div class="content">
  197. <a class="header">Team Fu & Hess</a>
  198. <div class="meta">
  199. <span class="date">Create in Sep 2014</span>
  200. </div>
  201. </div>
  202. <div class="extra content">
  203. <a>
  204. <i class="users icon"></i>
  205. 2 Members
  206. </a>
  207. </div>
  208. </div>
  209. </div>
  210. <div class="another example">
  211. <div class="evaluated code" data-type="javascript">
  212. $('.special.cards .image').dimmer({
  213. on: 'hover'
  214. });
  215. </div>
  216. <div class="ui special cards">
  217. <div class="card">
  218. <div class="dimmable image">
  219. <div class="ui dimmer">
  220. <div class="content">
  221. <div class="center">
  222. <div class="ui inverted button">Add Friend</div>
  223. </div>
  224. </div>
  225. </div>
  226. <img src="/images/avatar/large/elliot.jpg">
  227. </div>
  228. <div class="content">
  229. <a class="header">Team Fu</a>
  230. <div class="meta">
  231. <span class="date">Create in Sep 2014</span>
  232. </div>
  233. </div>
  234. <div class="extra content">
  235. <a>
  236. <i class="users icon"></i>
  237. 2 Members
  238. </a>
  239. </div>
  240. </div>
  241. <div class="card">
  242. <div class="dimmable image">
  243. <div class="ui inverted dimmer">
  244. <div class="content">
  245. <div class="center">
  246. <div class="ui primary button">Add Friend</div>
  247. </div>
  248. </div>
  249. </div>
  250. <img src="/images/avatar/large/jenny.jpg">
  251. </div>
  252. <div class="content">
  253. <a class="header">Team Hess</a>
  254. <div class="meta">
  255. <span class="date">Create in Aug 2014</span>
  256. </div>
  257. </div>
  258. <div class="extra content">
  259. <a>
  260. <i class="users icon"></i>
  261. 2 Members
  262. </a>
  263. </div>
  264. </div>
  265. </div>
  266. </div>
  267. <div class="even example">
  268. <h4 class="ui header">Header</h4>
  269. <p>A card can contain a header</p>
  270. <div class="ignored yellow ui message">
  271. <div class="header">
  272. <i class="info icon"></i>
  273. Equal Size Cards
  274. </div>
  275. <p>If your cards have content that vary in length you must set a <code>min-height</code> for that content area, or the whole card.</p>
  276. <p>For example:</p>
  277. <div class="code" data-type="css">
  278. /* Sets card height to about two lines of description */
  279. #my-container .card .description {
  280. min-height: 35px;
  281. }
  282. </div>
  283. </div>
  284. <div class="ui cards">
  285. <div class="card">
  286. <div class="content">
  287. <div class="header">Elliot Fu</div>
  288. <div class="meta">Friend</div>
  289. <div class="description">
  290. Elliot Fu is a film-maker from New York.
  291. </div>
  292. </div>
  293. </div>
  294. <div class="card">
  295. <div class="content">
  296. <div class="header">Veronika Ossi</div>
  297. <div class="meta">Friend</div>
  298. <div class="description">
  299. Veronika Ossi is a set designer living in New York who enjoys kittens, music, and partying.
  300. </div>
  301. </div>
  302. </div>
  303. <div class="card">
  304. <div class="content">
  305. <div class="header">Jenny Hess</div>
  306. <div class="meta">Friend</div>
  307. <div class="description">
  308. Jenny is a student studying Media Management at the New School
  309. </div>
  310. </div>
  311. </div>
  312. </div>
  313. </div>
  314. <div class="example">
  315. <h4 class="ui header">Metadata</h4>
  316. <p>A card can contain content metadata</p>
  317. <div class="ui info message">
  318. <i class="info icon"></i>
  319. You can include an arbitrary amount of metadata using your own class conventions, all child elements will automatically be spaced
  320. </div>
  321. <div class="ui card">
  322. <div class="content">
  323. <div class="header">Cute Dog</div>
  324. <div class="meta">
  325. <span class="time">2 days ago</span>
  326. <span class="category">Animals</span>
  327. </div>
  328. </div>
  329. </div>
  330. </div>
  331. <div class="example">
  332. <h4 class="ui header">Link</h4>
  333. <p>A card can contain contain links as images, headers, or inside content</p>
  334. <div class="ui yellow message">To make the entire content of a card link, check out the link variation below
  335. </div>
  336. <div class="ui card">
  337. <a class="image" href="#">
  338. <img src="/images/avatar/large/steve.jpg">
  339. </a>
  340. <div class="content">
  341. <a class="header" href="#">Steve Jobes</a>
  342. <div class="meta">
  343. <a class="time">Last Seen 2 days ago</a>
  344. </div>
  345. </div>
  346. </div>
  347. </div>
  348. <div class="even example">
  349. <h4 class="ui header">Buttons</h4>
  350. <p>A card can contain buttons</p>
  351. <div class="ui cards">
  352. <div class="card">
  353. <div class="content">
  354. <div class="header">Elliot Fu</div>
  355. <div class="description">
  356. Elliot Fu is a film-maker from New York.
  357. </div>
  358. </div>
  359. <div class="ui bottom attached button">
  360. <i class="add icon"></i>
  361. Add Friend
  362. </div>
  363. </div>
  364. <div class="card">
  365. <div class="content">
  366. <div class="header">Veronika Ossi</div>
  367. <div class="description">
  368. Veronika Ossi is a set designer living in New York who enjoys kittens, music, and partying.
  369. </div>
  370. </div>
  371. <div class="ui bottom attached button">
  372. <i class="add icon"></i>
  373. Add Friend
  374. </div>
  375. </div>
  376. <div class="card">
  377. <div class="content">
  378. <div class="header">Jenny Hess</div>
  379. <div class="description">
  380. Jenny is a student studying Media Management at the New School
  381. </div>
  382. </div>
  383. <div class="ui bottom attached button">
  384. <i class="add icon"></i>
  385. Add Friend
  386. </div>
  387. </div>
  388. </div>
  389. </div>
  390. <div class="example">
  391. <h4 class="ui header">Actions</h4>
  392. <p>A card can contain common actions</p>
  393. <div class="ui info message">
  394. Common actions may contain special formatting, like "star" or "heart". To attach events, on a user action, please check out the <a href="#">state behavior</a>.
  395. </div>
  396. <div class="ui card">
  397. <div class="content">
  398. <i class="right floated like icon"></i>
  399. <i class="right floated star icon"></i>
  400. <div class="header">Cute Dog</div>
  401. <div class="extra content">
  402. <span class="like">
  403. <i class="like icon"></i>
  404. Like
  405. </span>
  406. <span class="star">Favorite
  407. </span>
  408. </div>
  409. </div>
  410. </div>
  411. </div>
  412. <div class="example">
  413. <h4 class="ui header">Description</h4>
  414. <p>A card can contain a description with a single or multiple paragraphs</p>
  415. <div class="ui card">
  416. <div class="content">
  417. <div class="header">Cute Dog</div>
  418. <div class="meta">2 days ago</div>
  419. <div class="description">
  420. <p>Cute dogs come in a variety of shapes and sizes. Some cute dogs are cute for their adorable faces, others for their tiny stature, and even others for their massive size.</p>
  421. <p>Many people also have their own barometers for what makes a cute dog.</p>
  422. </div>
  423. </div>
  424. </div>
  425. </div>
  426. <div class="example">
  427. <h4 class="ui header">Extra Content</h4>
  428. <p>A card can contain extra content meant to be formatted separately from the main content</p>
  429. <div class="ui card">
  430. <div class="content">
  431. <div class="header">Cute Dog</div>
  432. <div class="meta">2 days ago</div>
  433. <div class="description">
  434. <p>Cute dogs come in a variety of shapes and sizes. Some cute dogs are cute for their adorable faces, others for their tiny stature, and even others for their massive size.</p>
  435. <p>Many people also have their own barometers for what makes a cute dog.</p>
  436. </div>
  437. </div>
  438. <div class="extra content">
  439. <i class="check icon"></i>
  440. 121 Votes
  441. </div>
  442. </div>
  443. </div>
  444. <h2 class="ui dividing header">Variations</h2>
  445. <div class="example">
  446. <h4 class="ui header">Fluid Card</h4>
  447. <p>A fluid card takes up the width of its container</p>
  448. <div class="ui two column grid">
  449. <div class="column">
  450. <div class="ui fluid card">
  451. <div class="image">
  452. <img src="/images/avatar/large/helen.jpg">
  453. </div>
  454. <div class="content">
  455. <a class="header">Helen Troy</a>
  456. </div>
  457. </div>
  458. </div>
  459. <div class="column">
  460. <div class="ui fluid card">
  461. <div class="image">
  462. <img src="/images/avatar/large/elliot.jpg">
  463. </div>
  464. <div class="content">
  465. <a class="header">Elliot Fu</a>
  466. </div>
  467. </div>
  468. </div>
  469. </div>
  470. </div>
  471. <div class="example">
  472. <h4 class="ui header">Link Card</h4>
  473. <p>A card can be formatted so that the entire contents link to another page</p>
  474. <a class="ui card" href="http://www.dog.com">
  475. <div class="content">
  476. <div class="header">Cute Dog</div>
  477. <div class="meta">
  478. <span class="category">Animals</span>
  479. </div>
  480. <div class="description">
  481. Click to view more information about this dog at dog.com
  482. </div>
  483. </div>
  484. <div class="extra content">
  485. <div class="right floated author">
  486. <img class="ui avatar image" src="/images/avatar/small/matt.jpg"> Matt
  487. </div>
  488. </div>
  489. </a>
  490. </div>
  491. <div class="another example">
  492. <div class="ui link card">
  493. <div class="content">
  494. <div class="header">Cute Dog</div>
  495. <div class="meta">
  496. <span class="category">Animals</span>
  497. </div>
  498. <div class="description">
  499. This card simulates a link without using the A tag for use with javascript links.
  500. </div>
  501. </div>
  502. <div class="extra content">
  503. <div class="right floated author">
  504. <img class="ui avatar image" src="/images/avatar/small/matt.jpg"> Matt
  505. </div>
  506. </div>
  507. </div>
  508. </div>
  509. <div class="example">
  510. <h4 class="ui header">Floated Content</h4>
  511. <p>Any content element can be floated left or right</p>
  512. <div class="ui info message">
  513. <i class="info icon"></i>
  514. You can include an arbitrary amount of metadata using your own class conventions, all child elements will automatically be spaced
  515. </div>
  516. <div class="ui card">
  517. <div class="content">
  518. <div class="header">Cute Dog</div>
  519. <div class="meta">
  520. <span class="right floated time">2 days ago</span>
  521. <span class="category">Animals</span>
  522. </div>
  523. <div class="description">
  524. Here's a description of a cute dog.
  525. </div>
  526. </div>
  527. <div class="extra content">
  528. <div class="right floated author">
  529. <img class="ui avatar image" src="/images/avatar/small/matt.jpg"> Matt
  530. </div>
  531. </div>
  532. </div>
  533. </div>
  534. <div class="even example">
  535. <h4 class="ui header">Column count</h4>
  536. <p>A group of cards can set how many cards should exist in a row</p>
  537. <div class="ui four cards">
  538. <div class="card">
  539. <div class="image">
  540. <img src="/images/movies/12years.jpg">
  541. </div>
  542. <div class="extra">
  543. Rating:
  544. <div class="ui star rating" data-rating="4"></div>
  545. </div>
  546. </div>
  547. <div class="card">
  548. <div class="image">
  549. <img src="/images/movies/totoro.jpg">
  550. </div>
  551. <div class="extra">
  552. Rating:
  553. <div class="ui star rating" data-rating="2"></div>
  554. </div>
  555. </div>
  556. <div class="card">
  557. <div class="image">
  558. <img src="/images/movies/watchmen.jpg">
  559. </div>
  560. <div class="extra">
  561. Rating:
  562. <div class="ui star rating" data-rating="3"></div>
  563. </div>
  564. </div>
  565. <div class="card">
  566. <div class="image">
  567. <img src="/images/movies/happiness.jpg">
  568. </div>
  569. <div class="extra">
  570. Rating:
  571. <div class="ui star rating" data-rating="4"></div>
  572. </div>
  573. </div>
  574. <div class="card">
  575. <div class="image">
  576. <img src="/images/movies/adaptation.jpg">
  577. </div>
  578. <div class="extra">
  579. Rating:
  580. <div class="ui star rating" data-rating="3"></div>
  581. </div>
  582. </div>
  583. <div class="card">
  584. <div class="image">
  585. <img src="/images/movies/sherlock.jpg">
  586. </div>
  587. <div class="extra">
  588. Rating:
  589. <div class="ui star rating" data-rating="3"></div>
  590. </div>
  591. </div>
  592. <div class="card">
  593. <div class="image">
  594. <img src="/images/movies/hemingway.jpg">
  595. </div>
  596. <div class="extra">
  597. Rating:
  598. <div class="ui star rating" data-rating="4"></div>
  599. </div>
  600. </div>
  601. <div class="card">
  602. <div class="image">
  603. <img src="/images/movies/1942.jpg">
  604. </div>
  605. <div class="extra">
  606. Rating:
  607. <div class="ui star rating" data-rating="4"></div>
  608. </div>
  609. </div>
  610. </div>
  611. </div>
  612. <div class="even example">
  613. <h4 class="ui header">Doubling</h4>
  614. <p>A group of cards can double its column width for mobile</p>
  615. <div class="ui ignored warning message">Resize your browser to a smaller size to see the cards stack after reaching mobile breakpoints</div>
  616. <div class="ui six doubling cards">
  617. <div class="card">
  618. <div class="image">
  619. <img src="/images/avatar/large/elliot.jpg">
  620. </div>
  621. <div class="content">
  622. <a class="header">Elliot Fu</a>
  623. </div>
  624. </div>
  625. <div class="card">
  626. <div class="image">
  627. <img src="/images/avatar/large/helen.jpg">
  628. </div>
  629. <div class="content">
  630. <a class="header">Helen Troy</a>
  631. </div>
  632. </div>
  633. <div class="card">
  634. <div class="image">
  635. <img src="/images/avatar/large/jenny.jpg">
  636. </div>
  637. <div class="content">
  638. <a class="header">Jenny Hess</a>
  639. </div>
  640. </div>
  641. <div class="card">
  642. <div class="image">
  643. <img src="/images/avatar/large/veronika.jpg">
  644. </div>
  645. <div class="content">
  646. <a class="header">Veronika Ossi</a>
  647. </div>
  648. </div>
  649. <div class="card">
  650. <div class="image">
  651. <img src="/images/avatar/large/stevie.jpg">
  652. </div>
  653. <div class="content">
  654. <a class="header">Stevie Feliciano</a>
  655. </div>
  656. </div>
  657. <div class="card">
  658. <div class="image">
  659. <img src="/images/avatar/large/steve.jpg">
  660. </div>
  661. <div class="content">
  662. <a class="header">Steve Jobes</a>
  663. </div>
  664. </div>
  665. </div>
  666. </div>
  667. </div>