index.html 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title></title>
  5. <meta charset="UTF-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link href="https://unpkg.com/uppy/dist/uppy.min.css" rel="stylesheet">
  8. </head>
  9. <body>
  10. <button id="uppyModalOpener">Open Modal</button>
  11. <script src="https://unpkg.com/uppy/dist/uppy.min.js"></script>
  12. <script>
  13. const Dashboard = Uppy.Dashboard
  14. const Webcam = Uppy.Webcam
  15. const Tus10 = Uppy.Tus10
  16. const Informer = Uppy.Informer
  17. const uppy = Uppy.Core({debug: true, autoProceed: false})
  18. .use(Uppy.Dashboard, {
  19. trigger: '#uppyModalOpener',
  20. target: 'body'
  21. })
  22. .use(Webcam, {target: Dashboard})
  23. .use(Tus10, {endpoint: 'http://master.tus.io/files/', resume: true})
  24. .use(Informer, {target: Dashboard})
  25. uppy.run()
  26. uppy.on('core:success', (fileCount) => {
  27. console.log(`${fileCount} files uploaded`)
  28. })
  29. document.querySelector('#uppyModalOpener').click()
  30. </script>
  31. </body>
  32. </html>