index.html 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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
  8. href="https://releases.transloadit.com/uppy/v4.0.1/uppy.min.css"
  9. rel="stylesheet"
  10. />
  11. </head>
  12. <body>
  13. <button id="uppyModalOpener">Open Modal</button>
  14. <noscript>This web page requires JavaScript to work properly.</noscript>
  15. <script type="module">
  16. import {
  17. Uppy,
  18. Dashboard,
  19. Instagram,
  20. GoogleDrive,
  21. Tus,
  22. } from 'https://releases.transloadit.com/uppy/v4.0.1/uppy.min.mjs'
  23. const uppy = new Uppy({ debug: true, autoProceed: false })
  24. .use(Dashboard, { trigger: '#uppyModalOpener' })
  25. .use(Instagram, {
  26. target: Dashboard,
  27. companionUrl: 'http://localhost:3020',
  28. })
  29. .use(GoogleDrive, {
  30. target: Dashboard,
  31. companionUrl: 'http://localhost:3020',
  32. })
  33. .use(Tus, { endpoint: 'https://tusd.tusdemo.net/files/' })
  34. uppy.on('success', (fileCount) => {
  35. console.log(`${fileCount} files uploaded`)
  36. })
  37. </script>
  38. </body>
  39. </html>