camera.css 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. :host {
  2. --header-height: 4em;
  3. --footer-height: 9em;
  4. --header-height-landscape: 3em;
  5. --footer-height-landscape: 6em;
  6. --shutter-size: 6em;
  7. --icon-size-header: 1.5em;
  8. --icon-size-footer: 2.5em;
  9. --margin-size-header: 1.5em;
  10. --margin-size-footer: 2.0em;
  11. font-family: -apple-system, BlinkMacSystemFont,
  12. “Segoe UI”, “Roboto”, “Droid Sans”, “Helvetica Neue”, sans-serif;
  13. display: block;
  14. width: 100%;
  15. height: 100%;
  16. }
  17. .items {
  18. box-sizing: border-box;
  19. display: flex;
  20. width: 100%;
  21. height: 100%;
  22. align-items: center;
  23. justify-content: center;
  24. }
  25. .items .item {
  26. flex: 1;
  27. text-align: center;
  28. }
  29. .items .item:first-child {
  30. text-align: left;
  31. }
  32. .items .item:last-child {
  33. text-align: right;
  34. }
  35. .camera-wrapper {
  36. position: relative;
  37. display: flex;
  38. flex-direction: column;
  39. width: 100%;
  40. height: 100%;
  41. }
  42. .camera-header {
  43. color: white;
  44. background-color: black;
  45. height: var(--header-height);
  46. }
  47. .camera-header .items {
  48. padding: var(--margin-size-header);
  49. }
  50. .camera-footer {
  51. position: relative;
  52. color: white;
  53. background-color: black;
  54. height: var(--footer-height);
  55. }
  56. .camera-footer .items {
  57. padding: var(--margin-size-footer);
  58. }
  59. @media (max-height: 375px) {
  60. .camera-header {
  61. --header-height: var(--header-height-landscape);
  62. }
  63. .camera-footer {
  64. --footer-height: var(--footer-height-landscape);
  65. }
  66. .camera-footer .shutter {
  67. --shutter-size: 4em;
  68. }
  69. }
  70. .camera-video {
  71. position: relative;
  72. flex: 1;
  73. overflow: hidden;
  74. background-color: black;
  75. }
  76. video {
  77. width: 100%;
  78. height: 100%;
  79. max-height: 100%;
  80. min-height: 100%;
  81. object-fit: cover;
  82. background-color: black;
  83. }
  84. .pick-image {
  85. display: flex;
  86. align-items: center;
  87. position: absolute;
  88. left: var(--margin-size-footer);
  89. top: 0;
  90. height: 100%;
  91. width: var(--icon-size-footer);
  92. color: white;
  93. }
  94. .pick-image input {
  95. visibility: hidden;
  96. }
  97. .pick-image svg {
  98. cursor: pointer;
  99. fill: white;
  100. width: var(--icon-size-footer);
  101. height: var(--icon-size-footer);
  102. }
  103. .shutter {
  104. position: absolute;
  105. left: 50%;
  106. top: 50%;
  107. width: var(--shutter-size);
  108. height: var(--shutter-size);
  109. margin-top: calc(var(--shutter-size) / -2);
  110. margin-left: calc(var(--shutter-size) / -2);
  111. border-radius: 100%;
  112. background-color: #c6cdd8;
  113. padding: 12px;
  114. box-sizing: border-box;
  115. }
  116. .shutter:active .shutter-button {
  117. background-color: #9da9bb;
  118. }
  119. .shutter-button {
  120. background-color: white;
  121. border-radius: 100%;
  122. width: 100%;
  123. height: 100%;
  124. }
  125. .rotate {
  126. display: flex;
  127. align-items: center;
  128. position: absolute;
  129. right: var(--margin-size-footer);
  130. top: 0;
  131. height: 100%;
  132. width: var(--icon-size-footer);
  133. color: white;
  134. }
  135. .rotate img {
  136. width: var(--icon-size-footer);
  137. height: var(--icon-size-footer);
  138. }
  139. .shutter-overlay {
  140. z-index: 5;
  141. position: absolute;
  142. width: 100%;
  143. height: 100%;
  144. background-color: black;
  145. }
  146. .error {
  147. width: 100%;
  148. height: 100%;
  149. color: white;
  150. display: flex;
  151. justify-content: center;
  152. align-items: center;
  153. }
  154. .no-device {
  155. background-color: black;
  156. flex: 1;
  157. display: flex;
  158. flex-direction: column;
  159. align-items: center;
  160. justify-content: center;
  161. color: white;
  162. }
  163. .no-device label {
  164. cursor: pointer;
  165. background: #fff;
  166. border-radius: 6px;
  167. padding: 6px 8px;
  168. color: black;
  169. }
  170. .no-device input {
  171. visibility: hidden;
  172. height: 0;
  173. margin-top: 16px;
  174. }
  175. .accept {
  176. background-color: black;
  177. flex: 1;
  178. overflow: hidden;
  179. }
  180. .accept .accept-image {
  181. width: 100%;
  182. height: 100%;
  183. max-height: 100%;
  184. background-position: center center;
  185. background-size: cover;
  186. background-repeat: no-repeat;
  187. }
  188. .close img {
  189. cursor: pointer;
  190. width: var(--icon-size-header);
  191. height: var(--icon-size-header);
  192. }
  193. .flash img {
  194. width: var(--icon-size-header);
  195. height: var(--icon-size-header);
  196. }
  197. .accept-use img {
  198. width: var(--icon-size-footer);
  199. height: var(--icon-size-footer);
  200. }
  201. .accept-cancel img {
  202. width: var(--icon-size-footer);
  203. height: var(--icon-size-footer);
  204. }
  205. .offscreen-image-render {
  206. top: 0;
  207. left: 0;
  208. visibility: hidden;
  209. pointer-events: none;
  210. width: 100%;
  211. height: 100%;
  212. }