styles.css 9.6 KB

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