index.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <!-- Web App Config -->
  7. <title>Snapdrop</title>
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
  9. <meta name="theme-color" content="#3367d6">
  10. <meta name="color-scheme" content="dark light">
  11. <meta name="apple-mobile-web-app-capable" content="no">
  12. <meta name="apple-mobile-web-app-title" content="Snapdrop">
  13. <!-- Descriptions -->
  14. <meta name="description" content="Instantly share images, videos, PDFs, and links with people nearby. Peer2Peer and Open Source. No Setup, No Signup.">
  15. <meta name="keywords" content="File, Transfer, Share, Peer2Peer">
  16. <meta name="author" content="RobinLinus">
  17. <meta property="og:title" content="Snapdrop">
  18. <meta property="og:type" content="article">
  19. <meta property="og:url" content="https://snapdrop.net/">
  20. <meta property="og:author" content="https://facebook.com/RobinLinus">
  21. <meta name="twitter:author" content="@RobinLinus">
  22. <meta name="twitter:card" content="summary_large_image">
  23. <meta name="twitter:description" content="Instantly share images, videos, PDFs, and links with people nearby. Peer2Peer and Open Source. No Setup, No Signup.">
  24. <meta name="og:description" content="Instantly share images, videos, PDFs, and links with people nearby. Peer2Peer and Open Source. No Setup, No Signup.">
  25. <!-- Icons -->
  26. <link rel="icon" sizes="96x96" href="images/favicon-96x96.png">
  27. <link rel="shortcut icon" href="images/favicon-96x96.png">
  28. <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
  29. <meta name="msapplication-TileImage" content="images/mstile-150x150.png">
  30. <link rel="fluid-icon" type="image/png" href="images/android-chrome-192x192.png">
  31. <meta name="twitter:image" content="https://snapdrop.net/images/twitter-stream.jpg">
  32. <meta property="og:image" content="https://snapdrop.net/images/twitter-stream.jpg">
  33. <!-- Resources -->
  34. <link rel="stylesheet" type="text/css" href="styles.css">
  35. <link rel="manifest" href="manifest.json">
  36. </head>
  37. <body translate="no">
  38. <header class="row-reverse">
  39. <a href="#about" class="icon-button" title="About Snapdrop">
  40. <svg class="icon">
  41. <use xlink:href="#info-outline" />
  42. </svg>
  43. </a>
  44. <a href="#" id="theme" class="icon-button" title="Switch Darkmode/Lightmode" >
  45. <svg class="icon">
  46. <use xlink:href="#icon-theme" />
  47. </svg>
  48. </a>
  49. <a href="#" id="notification" class="icon-button" title="Enable Notifications" hidden>
  50. <svg class="icon">
  51. <use xlink:href="#notifications" />
  52. </svg>
  53. </a>
  54. <a href="#" id="install" class="icon-button" title="Install Snapdrop" hidden>
  55. <svg class="icon">
  56. <use xlink:href="#homescreen" />
  57. </svg>
  58. </a>
  59. </header>
  60. <!-- Peers -->
  61. <x-peers class="center"></x-peers>
  62. <x-no-peers>
  63. <h2>Open Snapdrop on other devices to send files</h2>
  64. </x-no-peers>
  65. <x-instructions desktop="Click to send files or right click to send a message" mobile="Tap to send files or long tap to send a message"></x-instructions>
  66. <!-- Footer -->
  67. <footer class="column">
  68. <svg class="icon logo">
  69. <use xlink:href="#wifi-tethering" />
  70. </svg>
  71. <div id="displayName" placeholder="The easiest way to transfer data across devices"></div>
  72. <div class="font-body2">You can be discovered by everyone on this network</div>
  73. </footer>
  74. <!-- Receive Dialog -->
  75. <x-dialog id="receiveDialog">
  76. <x-background class="full center">
  77. <x-paper shadow="2">
  78. <h3>File Received</h3>
  79. <div class="font-subheading" id="fileName">Filename</div>
  80. <div class="font-body2" id="fileSize"></div>
  81. <div class="row">
  82. <label for="autoDownload" class="grow">Ask to save each file before downloading</label>
  83. <input type="checkbox" id="autoDownload" checked="">
  84. </div>
  85. <div class="row-reverse">
  86. <a class="button" close id="download" title="Download File" autofocus>Save</a>
  87. <button class="button" close>Ignore</button>
  88. </div>
  89. </x-paper>
  90. </x-background>
  91. </x-dialog>
  92. <!-- Send Text Dialog -->
  93. <x-dialog id="sendTextDialog">
  94. <form action="#">
  95. <x-background class="full center">
  96. <x-paper shadow="2">
  97. <h3>Send a Message</h3>
  98. <div id="textInput" class="textarea" role="textbox" placeholder="Send a message" autocomplete="off" autofocus contenteditable></div>
  99. <div class="row-reverse">
  100. <button class="button" type="submit" close>Send</button>
  101. <a class="button" close>Cancel</a>
  102. </div>
  103. </x-paper>
  104. </x-background>
  105. </form>
  106. </x-dialog>
  107. <!-- Receive Text Dialog -->
  108. <x-dialog id="receiveTextDialog">
  109. <x-background class="full center">
  110. <x-paper shadow="2">
  111. <h3>Message Received</h3>
  112. <div class="font-subheading" id="text"></div>
  113. <div class="row-reverse">
  114. <button class="button" id="copy" close autofocus>Copy</button>
  115. <button class="button" close>Close</button>
  116. </div>
  117. </x-paper>
  118. </x-background>
  119. </x-dialog>
  120. <!-- Toast -->
  121. <div class="toast-container full center">
  122. <x-toast class="row" shadow="1" id="toast">File Transfer Completed</x-toast>
  123. </div>
  124. <!-- About Page -->
  125. <x-about id="about" class="full center column">
  126. <section class="center column fade-in">
  127. <header class="row-reverse">
  128. <a href="#" class="close icon-button">
  129. <svg class="icon">
  130. <use xlink:href="#close" />
  131. </svg>
  132. </a>
  133. </header>
  134. <svg class="icon logo">
  135. <use xlink:href="#wifi-tethering" />
  136. </svg>
  137. <h1>Snapdrop</h1>
  138. <div class="font-subheading">The easiest way to transfer files across devices</div>
  139. <div class="row">
  140. <a class="icon-button" target="_blank" href="https://github.com/RobinLinus/snapdrop" title="Snapdrop on Github" rel="noreferrer">
  141. <svg class="icon">
  142. <use xlink:href="#github" />
  143. </svg>
  144. </a>
  145. <a class="icon-button" target="_blank" href="https://www.paypal.com/donate?hosted_button_id=FTP9DXUR7LA7Q" title="Help cover the server costs!" rel="noreferrer">
  146. <svg class="icon">
  147. <use xlink:href="#monetarization" />
  148. </svg>
  149. </a>
  150. <a class="icon-button" target="_blank" href="https://twitter.com/intent/tweet?text=https://snapdrop.net%20by%20@robin_linus%20&" title="Tweet about Snapdrop" rel="noreferrer">
  151. <svg class="icon">
  152. <use xlink:href="#twitter" />
  153. </svg>
  154. </a>
  155. <a class="icon-button" target="_blank" href="https://github.com/RobinLinus/snapdrop/blob/master/docs/faq.md" title="Frequently asked questions" rel="noreferrer">
  156. <svg class="icon">
  157. <use xlink:href="#help-outline" />
  158. </svg>
  159. </a>
  160. </div>
  161. </section>
  162. <x-background></x-background>
  163. </x-about>
  164. <!-- SVG Icon Library -->
  165. <svg style="display: none;">
  166. <symbol id=wifi-tethering viewBox="0 0 24 24">
  167. <path d="M12 11c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 2c0-3.31-2.69-6-6-6s-6 2.69-6 6c0 2.22 1.21 4.15 3 5.19l1-1.74c-1.19-.7-2-1.97-2-3.45 0-2.21 1.79-4 4-4s4 1.79 4 4c0 1.48-.81 2.75-2 3.45l1 1.74c1.79-1.04 3-2.97 3-5.19zM12 3C6.48 3 2 7.48 2 13c0 3.7 2.01 6.92 4.99 8.65l1-1.73C5.61 18.53 4 15.96 4 13c0-4.42 3.58-8 8-8s8 3.58 8 8c0 2.96-1.61 5.53-4 6.92l1 1.73c2.99-1.73 5-4.95 5-8.65 0-5.52-4.48-10-10-10z"></path>
  168. </symbol>
  169. <symbol id=desktop-mac viewBox="0 0 24 24">
  170. <path d="M21 2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h7l-2 3v1h8v-1l-2-3h7c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 12H3V4h18v10z"></path>
  171. </symbol>
  172. <symbol id=phone-iphone viewBox="0 0 24 24">
  173. <path d="M15.5 1h-8C6.12 1 5 2.12 5 3.5v17C5 21.88 6.12 23 7.5 23h8c1.38 0 2.5-1.12 2.5-2.5v-17C18 2.12 16.88 1 15.5 1zm-4 21c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm4.5-4H7V4h9v14z"></path>
  174. </symbol>
  175. <symbol id=tablet-mac viewBox="0 0 24 24">
  176. <path d="M18.5 0h-14C3.12 0 2 1.12 2 2.5v19C2 22.88 3.12 24 4.5 24h14c1.38 0 2.5-1.12 2.5-2.5v-19C21 1.12 19.88 0 18.5 0zm-7 23c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm7.5-4H4V3h15v16z"></path>
  177. </symbol>
  178. <symbol id=info-outline viewBox="0 0 24 24">
  179. <path d="M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 9h2V7h-2v2z"></path>
  180. </symbol>
  181. <symbol id=close viewBox="0 0 24 24">
  182. <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path>
  183. </symbol>
  184. <symbol id=help-outline viewBox="0 0 24 24">
  185. <path d="M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"></path>
  186. </symbol>
  187. <symbol id="twitter">
  188. <path d="M23.954 4.569c-.885.389-1.83.654-2.825.775 1.014-.611 1.794-1.574 2.163-2.723-.951.555-2.005.959-3.127 1.184-.896-.959-2.173-1.559-3.591-1.559-2.717 0-4.92 2.203-4.92 4.917 0 .39.045.765.127 1.124C7.691 8.094 4.066 6.13 1.64 3.161c-.427.722-.666 1.561-.666 2.475 0 1.71.87 3.213 2.188 4.096-.807-.026-1.566-.248-2.228-.616v.061c0 2.385 1.693 4.374 3.946 4.827-.413.111-.849.171-1.296.171-.314 0-.615-.03-.916-.086.631 1.953 2.445 3.377 4.604 3.417-1.68 1.319-3.809 2.105-6.102 2.105-.39 0-.779-.023-1.17-.067 2.189 1.394 4.768 2.209 7.557 2.209 9.054 0 13.999-7.496 13.999-13.986 0-.209 0-.42-.015-.63.961-.689 1.8-1.56 2.46-2.548l-.047-.02z" />
  189. </symbol>
  190. <symbol id="github">
  191. <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
  192. </symbol>
  193. <g id="notifications">
  194. <path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z" />
  195. </g>
  196. <symbol id="homescreen">
  197. <path fill="none" d="M0 0h24v24H0V0z" />
  198. <path d="M18 1.01L8 1c-1.1 0-2 .9-2 2v3h2V5h10v14H8v-1H6v3c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99zM10 15h2V8H5v2h3.59L3 15.59 4.41 17 10 11.41z" />
  199. <path fill="none" d="M0 0h24v24H0V0z" />
  200. </symbol>
  201. <symbol id="monetarization">
  202. <path d="M0 0h24v24H0z" fill="none" />
  203. <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1.41 16.09V20h-2.67v-1.93c-1.71-.36-3.16-1.46-3.27-3.4h1.96c.1 1.05.82 1.87 2.65 1.87 1.96 0 2.4-.98 2.4-1.59 0-.83-.44-1.61-2.67-2.14-2.48-.6-4.18-1.62-4.18-3.67 0-1.72 1.39-2.84 3.11-3.21V4h2.67v1.95c1.86.45 2.79 1.86 2.85 3.39H14.3c-.05-1.11-.64-1.87-2.22-1.87-1.5 0-2.4.68-2.4 1.64 0 .84.65 1.39 2.67 1.91s4.18 1.39 4.18 3.91c-.01 1.83-1.38 2.83-3.12 3.16z" />
  204. </symbol>
  205. <symbol id="icon-theme" viewBox="0 0 24 24">
  206. <rect fill="none" height="24" width="24"/><path d="M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36c-0.98,1.37-2.58,2.26-4.4,2.26 c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"/>
  207. </symbol>
  208. </svg>
  209. <!-- Scripts -->
  210. <script src="scripts/network.js"></script>
  211. <script src="scripts/ui.js"></script>
  212. <script src="scripts/theme.js" async></script>
  213. <script src="scripts/clipboard.js" async></script>
  214. <!-- Sounds -->
  215. <audio id="blop" autobuffer="true">
  216. <source src="/sounds/blop.mp3" type="audio/mpeg">
  217. <source src="/sounds/blop.ogg" type="audio/ogg">
  218. </audio>
  219. <!-- no script -->
  220. <noscript>
  221. <x-noscript class="full center column">
  222. <h1>Enable Javascript</h1>
  223. <h3>Snapdrop works only with Javascript</h3>
  224. </x-noscript>
  225. <style>
  226. x-noscript {
  227. background: #599cfc;
  228. color: white;
  229. z-index: 2;
  230. }
  231. a[href="#info"] {
  232. color: white;
  233. }
  234. </style>
  235. </noscript>
  236. </body>