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