styles.css 9.9 KB

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