styles.css 10 KB

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