styles.css 10 KB

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