styles.css 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. /* Constants */
  2. :root {
  3. --icon-size: 24px;
  4. --primary-color: #4285f4;
  5. --peer-width: 120px;
  6. }
  7. /* Layout */
  8. html {
  9. height: 100%;
  10. }
  11. html,
  12. body {
  13. margin: 0;
  14. display: flex;
  15. flex-direction: column;
  16. width: 100%;
  17. overflow-x: hidden;
  18. }
  19. body {
  20. flex-grow: 1;
  21. align-items: center;
  22. justify-content: center;
  23. overflow-y: hidden;
  24. }
  25. .row-reverse {
  26. display: flex;
  27. flex-direction: row-reverse;
  28. }
  29. .row {
  30. display: flex;
  31. flex-direction: row;
  32. }
  33. .column {
  34. display: flex;
  35. flex-direction: column;
  36. }
  37. .center {
  38. display: flex;
  39. align-items: center;
  40. justify-content: center;
  41. }
  42. .full {
  43. position: absolute;
  44. top: 0;
  45. left: 0;
  46. right: 0;
  47. bottom: 0;
  48. }
  49. header {
  50. position: absolute;
  51. top: 0;
  52. left: 0;
  53. right: 0;
  54. height: 56px;
  55. align-items: center;
  56. padding: 16px;
  57. box-sizing: border-box;
  58. }
  59. [hidden] {
  60. display: none !important;
  61. }
  62. /* Typography */
  63. body {
  64. background: #fafafa;
  65. font-family: -apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  66. color: #333;
  67. -webkit-font-smoothing: antialiased;
  68. -moz-osx-font-smoothing: grayscale;
  69. }
  70. h1 {
  71. font-size: 34px;
  72. font-weight: 400;
  73. letter-spacing: -.01em;
  74. line-height: 40px;
  75. margin: 8px 0 0;
  76. }
  77. h2 {
  78. font-size: 24px;
  79. font-weight: 400;
  80. letter-spacing: -.012em;
  81. line-height: 32px;
  82. }
  83. h3 {
  84. font-size: 20px;
  85. font-weight: 500;
  86. margin: 16px 0;
  87. }
  88. .font-subheading {
  89. font-size: 16px;
  90. font-weight: 400;
  91. line-height: 24px;
  92. }
  93. .font-body1,
  94. body {
  95. font-size: 14px;
  96. font-weight: 400;
  97. line-height: 20px;
  98. }
  99. .font-body2 {
  100. font-size: 12px;
  101. line-height: 18px;
  102. }
  103. a {
  104. text-decoration: none;
  105. color: currentColor;
  106. cursor: pointer;
  107. }
  108. /* Icons */
  109. .icon {
  110. width: var(--icon-size);
  111. height: var(--icon-size);
  112. fill: currentColor;
  113. }
  114. /* Shadows */
  115. [shadow="1"] {
  116. box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.14),
  117. 0 1px 8px 0 rgba(0, 0, 0, 0.12),
  118. 0 3px 3px -2px rgba(0, 0, 0, 0.4);
  119. }
  120. [shadow="2"] {
  121. box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14),
  122. 0 1px 10px 0 rgba(0, 0, 0, 0.12),
  123. 0 2px 4px -1px rgba(0, 0, 0, 0.4);
  124. }
  125. /* Animations */
  126. @keyframes fade-in {
  127. 0% {
  128. opacity: 0;
  129. }
  130. }
  131. /* Main Header */
  132. body>header a {
  133. margin-left: 8px;
  134. }
  135. /* Peers List */
  136. x-peers {
  137. width: 100%;
  138. overflow: hidden;
  139. flex-flow: row wrap;
  140. z-index: 2;
  141. }
  142. /* Empty Peers List */
  143. x-no-peers {
  144. padding: 8px;
  145. text-align: center;
  146. /* prevent flickering on load */
  147. animation: fade-in 300ms;
  148. animation-delay: 500ms;
  149. animation-fill-mode: backwards;
  150. }
  151. x-no-peers h2,
  152. x-no-peers a {
  153. color: var(--primary-color);
  154. }
  155. x-peers:not(:empty)+x-no-peers {
  156. display: none;
  157. }
  158. /* Peer */
  159. x-peer {
  160. -webkit-user-select: none;
  161. user-select: none;
  162. }
  163. x-peer label {
  164. width: var(--peer-width);
  165. padding: 8px;
  166. cursor: pointer;
  167. touch-action: manipulation;
  168. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  169. position: relative;
  170. }
  171. x-peer .name {
  172. width: var(--peer-width);
  173. white-space: nowrap;
  174. overflow: hidden;
  175. text-overflow: ellipsis;
  176. text-align: center;
  177. }
  178. input[type="file"] {
  179. visibility: hidden;
  180. position: absolute;
  181. }
  182. x-peer x-icon {
  183. --icon-size: 40px;
  184. width: var(--icon-size);
  185. padding: 12px;
  186. border-radius: 50%;
  187. background: var(--primary-color);
  188. color: white;
  189. display: flex;
  190. margin-bottom: 8px;
  191. transition: transform 150ms;
  192. will-change: transform;
  193. }
  194. x-peer:not([transfer]):hover x-icon,
  195. x-peer:not([transfer]):focus x-icon {
  196. transform: scale(1.05);
  197. }
  198. x-peer[transfer] x-icon {
  199. box-shadow: none;
  200. opacity: 0.8;
  201. transform: scale(1);
  202. }
  203. .status {
  204. height: 18px;
  205. opacity: 0.7;
  206. }
  207. x-peer[transfer] .status:before {
  208. content: 'Transferring...';
  209. }
  210. x-peer x-icon {
  211. animation: pop 600ms ease-out 1;
  212. }
  213. @keyframes pop {
  214. 0% {
  215. transform: scale(0.7);
  216. }
  217. 40% {
  218. transform: scale(1.2);
  219. }
  220. }
  221. x-peer[drop] x-icon {
  222. transform: scale(1.1);
  223. }
  224. /* Footer */
  225. footer {
  226. position: absolute;
  227. bottom: 0;
  228. left: 0;
  229. right: 0;
  230. align-items: center;
  231. padding: 0 0 16px 0;
  232. }
  233. footer .logo {
  234. --icon-size: 80px;
  235. margin-bottom: 8px;
  236. color: var(--primary-color);
  237. }
  238. footer .font-body2 {
  239. color: var(--primary-color);
  240. }
  241. @media (min-height: 800px) {
  242. footer {
  243. margin-bottom: 16px;
  244. }
  245. }
  246. /* Dialog */
  247. x-dialog x-background {
  248. background: rgba(0, 0, 0, 0.61);
  249. z-index: 10;
  250. transition: opacity 300ms;
  251. will-change: opacity;
  252. padding: 16px;
  253. }
  254. x-dialog x-paper {
  255. z-index: 3;
  256. background: white;
  257. border-radius: 8px;
  258. padding: 16px 24px;
  259. width: 100%;
  260. max-width: 400px;
  261. box-sizing: border-box;
  262. transition: transform 300ms;
  263. will-change: transform;
  264. }
  265. x-dialog:not([show]) {
  266. pointer-events: none;
  267. }
  268. x-dialog:not([show]) x-paper {
  269. transform: scale(0.1);
  270. }
  271. x-dialog:not([show]) x-background {
  272. opacity: 0;
  273. }
  274. x-dialog .row-reverse>.button {
  275. margin-top: 16px;
  276. margin-left: 8px;
  277. }
  278. x-dialog a{
  279. color: var(--primary-color);
  280. }
  281. /* Receive Dialog */
  282. #receiveTextDialog #text {
  283. width: 100%;
  284. word-break: break-all;
  285. max-height: 300px;
  286. overflow-x: hidden;
  287. overflow-y: auto;
  288. -webkit-user-select: all;
  289. -moz-user-select: all;
  290. user-select: all;
  291. }
  292. /* Button */
  293. .button {
  294. padding: 0 16px;
  295. box-sizing: border-box;
  296. min-height: 36px;
  297. min-width: 100px;
  298. font-size: 14px;
  299. line-height: 24px;
  300. font-weight: 700;
  301. letter-spacing: 0.12em;
  302. text-transform: uppercase;
  303. white-space: nowrap;
  304. cursor: pointer;
  305. user-select: none;
  306. background: inherit;
  307. color: var(--primary-color);
  308. }
  309. .button,
  310. .icon-button {
  311. position: relative;
  312. display: flex;
  313. align-items: center;
  314. justify-content: center;
  315. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  316. touch-action: manipulation;
  317. border: none;
  318. outline: none;
  319. }
  320. .button:before,
  321. .icon-button:before {
  322. content: '';
  323. position: absolute;
  324. top: 0;
  325. left: 0;
  326. right: 0;
  327. bottom: 0;
  328. background: currentColor;
  329. opacity: 0;
  330. transition: opacity 300ms;
  331. }
  332. .button:hover:before,
  333. .icon-button:hover:before {
  334. opacity: 0.1;
  335. }
  336. .button:before {
  337. border-radius: 8px;
  338. }
  339. .button:focus:before,
  340. .icon-button:focus:before {
  341. opacity: 0.2;
  342. }
  343. button::-moz-focus-inner {
  344. border: 0;
  345. }
  346. /* Icon Button */
  347. .icon-button {
  348. width: 40px;
  349. height: 40px;
  350. }
  351. .icon-button:before {
  352. border-radius: 50%;
  353. }
  354. /* Text Input */
  355. input {
  356. width: 100%;
  357. box-sizing: border-box;
  358. border: none;
  359. outline: none;
  360. padding: 16px 24px;
  361. background: #f1f3f4;
  362. border-radius: 50px;
  363. margin: 8px 0;
  364. line-height: 16px;
  365. font-size: 14px;
  366. }
  367. /* Info Animation */
  368. #about {
  369. color: white;
  370. z-index: 11;
  371. overflow: hidden;
  372. pointer-events: none;
  373. text-align: center;
  374. }
  375. #about .fade-in {
  376. transition: opacity 300ms;
  377. will-change: opacity;
  378. transition-delay: 300ms;
  379. z-index: 11;
  380. pointer-events: all;
  381. }
  382. #about:not(:target) .fade-in {
  383. opacity: 0;
  384. pointer-events: none;
  385. transition-delay: 0;
  386. }
  387. #about .logo {
  388. --icon-size: 96px;
  389. }
  390. #about x-background {
  391. position: absolute;
  392. top: calc(32px - 200px);
  393. right: calc(32px - 200px);
  394. width: 400px;
  395. height: 400px;
  396. border-radius: 50%;
  397. background: var(--primary-color);
  398. transform: scale(0);
  399. z-index: -1;
  400. }
  401. /* Hack such that initial scale(0) isn't animated */
  402. #about x-background{
  403. will-change: transform;
  404. transition: transform 800ms cubic-bezier(0.77, 0, 0.175, 1);
  405. }
  406. #about:target x-background {
  407. transform: scale(10);
  408. }
  409. #about .row a {
  410. margin: 8px 8px -16px;
  411. }
  412. /* Loading Indicator */
  413. .progress {
  414. width: 80px;
  415. height: 80px;
  416. position: absolute;
  417. top: 0px;
  418. clip: rect(0px, 80px, 80px, 40px);
  419. --progress: rotate(0deg);
  420. transition: transform 200ms;
  421. }
  422. .circle {
  423. width: 72px;
  424. height: 72px;
  425. border: 4px solid var(--primary-color);
  426. border-radius: 40px;
  427. position: absolute;
  428. clip: rect(0px, 40px, 80px, 0px);
  429. will-change: transform;
  430. transform: var(--progress);
  431. }
  432. .over50 {
  433. clip: rect(auto, auto, auto, auto);
  434. }
  435. .over50 .circle.right {
  436. transform: rotate(180deg);
  437. }
  438. /* Toast */
  439. .toast-container {
  440. padding: 0 8px 24px;
  441. overflow: hidden;
  442. pointer-events: none;
  443. }
  444. x-toast {
  445. position: absolute;
  446. min-height: 48px;
  447. bottom: 24px;
  448. width: 100%;
  449. max-width: 344px;
  450. background-color: #323232;
  451. color: rgba(255, 255, 255, 0.95);
  452. align-items: center;
  453. box-sizing: border-box;
  454. padding: 8px 24px;
  455. z-index: 20;
  456. transition: opacity 200ms, transform 300ms ease-out;
  457. cursor: default;
  458. line-height: 24px;
  459. border-radius: 8px;
  460. pointer-events: all;
  461. }
  462. x-toast:not([show]):not(:hover) {
  463. opacity: 0;
  464. transform: translateY(100px);
  465. }
  466. /* Instructions */
  467. x-instructions {
  468. position: absolute;
  469. top: 120px;
  470. opacity: 0.5;
  471. transition: opacity 300ms;
  472. z-index: -1;
  473. }
  474. x-instructions:before {
  475. content: attr(mobile);
  476. }
  477. x-peers:empty~x-instructions {
  478. opacity: 0;
  479. }
  480. /* Responsive Styles */
  481. @media (min-height: 800px) {
  482. footer {
  483. margin-bottom: 16px;
  484. }
  485. }
  486. @media screen and (min-height: 800px),
  487. screen and (min-width: 1100px) {
  488. x-instructions:before {
  489. content: attr(desktop);
  490. }
  491. }
  492. @media (max-height: 420px) {
  493. x-instructions {
  494. top: 24px;
  495. }
  496. footer .logo {
  497. --icon-size: 40px;
  498. }
  499. }
  500. @supports (-webkit-overflow-scrolling: touch) {
  501. /* CSS specific to iOS devices */
  502. html {
  503. position: fixed;
  504. }
  505. x-instructions:before {
  506. content: attr(mobile);
  507. }
  508. }