No Description

index.ts 934B

12345678910111213141516171819202122232425262728
  1. import { EventHub } from './../src/event/EventHub';
  2. import { Whiteboard } from './../src/board/Whiteboard/index';
  3. const eventHub = new EventHub();
  4. eventHub.on('sync', (changeEv: SyncEvent) => {});
  5. const images = [
  6. 'https://upload-images.jianshu.io/upload_images/1647496-6bede989c09af527.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240',
  7. 'http://upload-images.jianshu.io/upload_images/1647496-d281090a702045e5.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240',
  8. 'http://upload-images.jianshu.io/upload_images/1647496-611a416be07d7ca3.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240'
  9. ];
  10. const whiteboard = new Whiteboard(document.getElementById('root') as HTMLDivElement, {
  11. sources: images,
  12. eventHub
  13. });
  14. whiteboard.open();
  15. const mirrorWhiteboard = new Whiteboard(document.getElementById('root-mirror') as HTMLDivElement, {
  16. sources: images,
  17. eventHub,
  18. mode: 'mirror'
  19. });
  20. mirrorWhiteboard.open();