index.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import React from 'react';
  2. import { DraggerLayout } from '../App';
  3. var Words = [{ content: 'You can do anything, but not everything.', img: 'http://pic.sc.chinaz.com/files/pic/pic9/201303/xpic10472.jpg' }, { content: 'Those who dare to fail miserably can achieve greatly.', img: 'https://img00.deviantart.net/1163/i/2013/059/d/7/irish_views_by_ssquared_photography-d5wjnsk.jpg' }, { content: 'You miss 100 percent of the shots you never take.', img: 'http://www.landsendhotel.co.uk/uploads/gallery/gallery/coastal_scenery_seascapes_6.jpg' }, { content: 'Those who believe in telekinetics, raise my hand.', img: 'https://tctechcrunch2011.files.wordpress.com/2017/10/26099344353_18cd6fabb8_k.jpg?w=738' }, { content: 'I’d rather live with a good question than a bad answer.', img: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQVa26cLzh6PYUwY4LMpwbHyDHFmWi_w2JuqDzeOdm1IIEbBZO0Vg' }];
  4. var Card = function Card(_ref) {
  5. var item = _ref.item;
  6. return React.createElement(
  7. 'div',
  8. null,
  9. React.createElement(
  10. 'div',
  11. { className: 'layout-item' },
  12. React.createElement('img', { src: item.img, style: { width: '100%' }, draggable: false, alt: 'card' }),
  13. React.createElement(
  14. 'div',
  15. { style: { padding: 5, textAlign: 'center', color: '#595959' } },
  16. item.content
  17. )
  18. )
  19. );
  20. };
  21. export var LayoutDemo = function LayoutDemo() {
  22. return React.createElement(
  23. 'div',
  24. { style: { display: 'flex', justifyContent: 'center' } },
  25. React.createElement(
  26. 'div',
  27. null,
  28. React.createElement(
  29. 'h1',
  30. { style: { textAlign: 'center' } },
  31. 'Normal Layout Demo'
  32. ),
  33. React.createElement(
  34. DraggerLayout,
  35. { width: 800, col: 12, rowHeight: 800 / 12, margin: [5, 5], className: 'normal-layout' },
  36. Words.map(function (el, index) {
  37. return React.createElement(Card, { item: el, key: index, 'data-set': { GridX: index * 3 % 12, GridY: index * 2, w: 3, h: 3 } });
  38. })
  39. )
  40. )
  41. );
  42. };
  43. ;
  44. var _temp = function () {
  45. if (typeof __REACT_HOT_LOADER__ === 'undefined') {
  46. return;
  47. }
  48. __REACT_HOT_LOADER__.register(Words, 'Words', 'app/src/NormalLayout/index.js');
  49. __REACT_HOT_LOADER__.register(Card, 'Card', 'app/src/NormalLayout/index.js');
  50. __REACT_HOT_LOADER__.register(LayoutDemo, 'LayoutDemo', 'app/src/NormalLayout/index.js');
  51. }();
  52. ;