styles.css 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  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: 'Transfering...';
  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. /* Receive Dialog */
  279. #receiveTextDialog #text {
  280. width: 100%;
  281. word-break: break-all;
  282. max-height: 300px;
  283. overflow-x: hidden;
  284. overflow-y: auto;
  285. -webkit-user-select: all;
  286. -moz-user-select: all;
  287. user-select: all;
  288. }
  289. /* Button */
  290. .button {
  291. padding: 0 16px;
  292. box-sizing: border-box;
  293. min-height: 36px;
  294. min-width: 100px;
  295. font-size: 14px;
  296. line-height: 24px;
  297. font-weight: 700;
  298. letter-spacing: 0.12em;
  299. text-transform: uppercase;
  300. white-space: nowrap;
  301. cursor: pointer;
  302. user-select: none;
  303. background: inherit;
  304. color: var(--primary-color);
  305. }
  306. .button,
  307. .icon-button {
  308. position: relative;
  309. display: flex;
  310. align-items: center;
  311. justify-content: center;
  312. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  313. touch-action: manipulation;
  314. border: none;
  315. outline: none;
  316. }
  317. .button:before,
  318. .icon-button:before {
  319. content: '';
  320. position: absolute;
  321. top: 0;
  322. left: 0;
  323. right: 0;
  324. bottom: 0;
  325. background: currentColor;
  326. opacity: 0;
  327. transition: opacity 300ms;
  328. }
  329. .button:hover:before,
  330. .icon-button:hover:before {
  331. opacity: 0.1;
  332. }
  333. .button:before {
  334. border-radius: 8px;
  335. }
  336. .button:focus:before,
  337. .icon-button:focus:before {
  338. opacity: 0.2;
  339. }
  340. button::-moz-focus-inner {
  341. border: 0;
  342. }
  343. /* Icon Button */
  344. .icon-button {
  345. width: 40px;
  346. height: 40px;
  347. }
  348. .icon-button:before {
  349. border-radius: 50%;
  350. }
  351. /* Text Input */
  352. input {
  353. width: 100%;
  354. box-sizing: border-box;
  355. border: none;
  356. outline: none;
  357. padding: 16px 24px;
  358. background: #f1f3f4;
  359. border-radius: 50px;
  360. margin: 8px 0;
  361. line-height: 16px;
  362. font-size: 14px;
  363. }
  364. /* Info Animation */
  365. #about {
  366. color: white;
  367. z-index: 11;
  368. overflow: hidden;
  369. pointer-events: none;
  370. text-align: center;
  371. }
  372. #about .fade-in {
  373. transition: opacity 300ms;
  374. will-change: opacity;
  375. transition-delay: 300ms;
  376. z-index: 11;
  377. pointer-events: all;
  378. }
  379. #about:not(:target) .fade-in {
  380. opacity: 0;
  381. pointer-events: none;
  382. transition-delay: 0;
  383. }
  384. #about .logo {
  385. --icon-size: 96px;
  386. }
  387. #about x-background {
  388. position: absolute;
  389. top: calc(32px - 200px);
  390. right: calc(32px - 200px);
  391. width: 400px;
  392. height: 400px;
  393. border-radius: 50%;
  394. background: var(--primary-color);
  395. transform: scale(0);
  396. z-index: -1;
  397. }
  398. /* Hack such that initial scale(0) isn't animated */
  399. #about x-background{
  400. will-change: transform;
  401. transition: transform 800ms cubic-bezier(0.77, 0, 0.175, 1);
  402. }
  403. #about:target x-background {
  404. transform: scale(10);
  405. }
  406. #about .row a {
  407. margin: 8px 8px -16px;
  408. }
  409. /* Loading Indicator */
  410. .progress {
  411. width: 80px;
  412. height: 80px;
  413. position: absolute;
  414. top: 0px;
  415. clip: rect(0px, 80px, 80px, 40px);
  416. --progress: rotate(0deg);
  417. transition: transform 200ms;
  418. }
  419. .circle {
  420. width: 72px;
  421. height: 72px;
  422. border: 4px solid var(--primary-color);
  423. border-radius: 40px;
  424. position: absolute;
  425. clip: rect(0px, 40px, 80px, 0px);
  426. will-change: transform;
  427. transform: var(--progress);
  428. }
  429. .over50 {
  430. clip: rect(auto, auto, auto, auto);
  431. }
  432. .over50 .circle.right {
  433. transform: rotate(180deg);
  434. }
  435. /* Toast */
  436. .toast-container {
  437. padding: 0 8px 24px;
  438. overflow: hidden;
  439. pointer-events: none;
  440. }
  441. x-toast {
  442. position: absolute;
  443. min-height: 48px;
  444. bottom: 24px;
  445. width: 100%;
  446. max-width: 344px;
  447. background-color: #323232;
  448. color: rgba(255, 255, 255, 0.95);
  449. align-items: center;
  450. box-sizing: border-box;
  451. padding: 8px 24px;
  452. z-index: 20;
  453. transition: opacity 200ms, transform 300ms ease-out;
  454. cursor: default;
  455. line-height: 24px;
  456. border-radius: 8px;
  457. pointer-events: all;
  458. }
  459. x-toast:not([show]):not(:hover) {
  460. opacity: 0;
  461. transform: translateY(100px);
  462. }
  463. /* Instructions */
  464. x-instructions {
  465. position: absolute;
  466. top: 120px;
  467. opacity: 0.5;
  468. transition: opacity 300ms;
  469. z-index: -1;
  470. }
  471. x-instructions:before {
  472. content: attr(mobile);
  473. }
  474. x-peers:empty~x-instructions {
  475. opacity: 0;
  476. }
  477. /* Responsive Styles */
  478. @media (min-height: 800px) {
  479. footer {
  480. margin-bottom: 16px;
  481. }
  482. }
  483. @media screen and (min-height: 800px),
  484. screen and (min-width: 1100px) {
  485. x-instructions:before {
  486. content: attr(desktop);
  487. }
  488. }
  489. @media (max-height: 420px) {
  490. x-instructions {
  491. top: 24px;
  492. }
  493. footer .logo {
  494. --icon-size: 40px;
  495. }
  496. }
  497. @supports (-webkit-overflow-scrolling: touch) {
  498. /* CSS specific to iOS devices */
  499. html {
  500. position: fixed;
  501. }
  502. x-instructions:before {
  503. content: attr(mobile);
  504. }
  505. }