UNPKG

4.97 kBSCSSView Raw
1$scandit-blue: #7ed9e2;
2$radial-circle-size: 224px;
3$radial-circle-border-size: 4px;
4
5.scandit {
6 &.scandit-container {
7 width: 100%;
8 height: 100%;
9 display: flex;
10 justify-content: center;
11 align-items: center;
12 overflow: hidden;
13 }
14
15 &.scandit-barcode-picker {
16 position: relative;
17 width: 100%;
18 height: 100%;
19 background-color: #000;
20 }
21
22 .scandit-video {
23 width: 100%;
24 height: 100%;
25 position: relative;
26 display: block;
27
28 &.mirrored {
29 transform: scale(-1, 1);
30 }
31 }
32
33 .scandit-logo {
34 position: absolute;
35 bottom: 5%;
36 right: 5%;
37 max-width: 35%;
38 max-height: 12.5%;
39 pointer-events: none;
40 transform: translateZ(0);
41 }
42
43 .scandit-laser {
44 z-index: 10;
45 position: absolute;
46 box-sizing: border-box;
47 top: -9999px;
48 pointer-events: none;
49 transform: translateZ(0);
50 display: flex;
51 align-items: center;
52
53 img {
54 position: absolute;
55 width: 100%;
56 max-height: 47px;
57 transition: opacity 0.25s ease;
58 animation-duration: 0.25s;
59 }
60 }
61
62 .scandit-viewfinder {
63 z-index: 10;
64 position: absolute;
65 box-sizing: border-box;
66 border: 2px #fff solid;
67 border-radius: 10px;
68 top: -9999px;
69 animation-duration: 0.25s;
70 transition: opacity 0.25s ease;
71 pointer-events: none;
72 transform: translateZ(0);
73
74 &.paused {
75 opacity: 0.4;
76 }
77 }
78
79 .scandit-camera-switcher,
80 .scandit-torch-toggle {
81 -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
82 position: absolute;
83 top: 5%;
84 max-width: 15%;
85 max-height: 15%;
86 z-index: 10;
87 cursor: pointer;
88 filter: drop-shadow(0 2px 0 #808080);
89 transform: translateZ(0);
90 }
91
92 .scandit-camera-switcher {
93 left: 5%;
94 }
95
96 .scandit-torch-toggle {
97 right: 5%;
98 }
99
100 .scandit-camera-upload {
101 -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
102 display: flex;
103 flex-direction: column;
104 justify-content: center;
105 align-items: center;
106 width: 100%;
107 height: 100%;
108 z-index: 5;
109
110 label {
111 cursor: pointer;
112 text-align: center;
113 width: $radial-circle-size;
114 height: $radial-circle-size;
115 min-width: $radial-circle-size;
116 min-height: $radial-circle-size;
117 z-index: 10;
118 margin: $radial-circle-border-size;
119 padding: 20px;
120 box-sizing: border-box;
121 border-radius: 50%;
122 filter: drop-shadow(0 0 0.15rem #000);
123
124 input[type="file"] {
125 position: absolute;
126 top: -9999px;
127 }
128
129 img {
130 width: 60%;
131 height: 60%;
132 }
133
134 div {
135 font-family: sans-serif;
136 color: #fff;
137 font-size: 16pt;
138 }
139 }
140 }
141
142 .radial-progress {
143 width: $radial-circle-size;
144 height: $radial-circle-size;
145 background-color: rgba(0, 0, 0, 0);
146 border-width: $radial-circle-border-size;
147 border-color: rgba(255, 255, 255, 1);
148 border-style: solid;
149 border-radius: 50%;
150 position: absolute;
151 transition: opacity 1s ease, border-color 0.5s;
152 animation-duration: 0.25s;
153 z-index: 7;
154 box-shadow: 0 0 0.3rem #000, 0 0 0.3rem #000 inset;
155
156 $increment: 0.8 / 20;
157
158 @for $i from 0 through 20 {
159 &[data-progress="#{$i * 5}"] {
160 border-color: rgba(255, 255, 255, 0.2 + $increment * $i);
161 }
162 }
163 }
164
165 .scandit-flash-color {
166 animation-name: scandit-flash-color;
167 }
168
169 .scandit-flash-white {
170 animation-name: scandit-flash-white;
171 }
172
173 .scandit-flash-white-inset {
174 animation-name: scandit-flash-white-inset;
175 }
176
177 .scandit-opacity-pulse {
178 animation-duration: 0.333s, 1s;
179 animation-iteration-count: 1, infinite;
180 animation-delay: 0s, 0.333s;
181 animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1), cubic-bezier(0.645, 0.045, 0.355, 1);
182 animation-name: scandit-opacity-pulse-before, scandit-opacity-pulse;
183 }
184
185 .scandit-hidden-opacity {
186 opacity: 0;
187 }
188}
189
190.scandit-hidden {
191 display: none !important; /* stylelint-disable-line declaration-no-important */
192}
193
194@keyframes scandit-flash-color {
195 0% {
196 filter: none;
197 }
198
199 50% {
200 filter: drop-shadow(0 0 0.75rem #fff) drop-shadow(0 0 2.5rem $scandit-blue);
201 }
202
203 100% {
204 filter: none;
205 }
206}
207
208@keyframes scandit-flash-white {
209 0% {
210 filter: none;
211 }
212
213 50% {
214 filter: drop-shadow(0 0 0.5rem #fff) drop-shadow(0 0 1rem #fff) drop-shadow(0 0 2.5rem #fff);
215 }
216
217 100% {
218 filter: none;
219 }
220}
221
222@keyframes scandit-flash-white-inset {
223 0% {
224 box-shadow: none;
225 }
226
227 50% {
228 box-shadow: 0 0 0.5rem #fff inset, 0 0 1rem #fff inset, 0 0 2.5rem #fff inset;
229 }
230
231 100% {
232 box-shadow: none;
233 }
234}
235
236@keyframes scandit-opacity-pulse-before {
237 0% {
238 opacity: 1;
239 }
240
241 100% {
242 opacity: 0.4;
243 }
244}
245
246@keyframes scandit-opacity-pulse {
247 0% {
248 opacity: 0.4;
249 }
250
251 50% {
252 opacity: 0.6;
253 }
254
255 100% {
256 opacity: 0.4;
257 }
258}
259
260@keyframes scandit-opacity-pulse-after {
261 0% {
262 opacity: 0.5;
263 }
264
265 100% {
266 opacity: 1;
267 }
268}