@media-quest/builder 0.0.39 → 0.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/public-api.d.ts +82 -99
- package/dist/public-api.js +36 -101
- package/dist/public-api.js.map +1 -1
- package/package.json +29 -29
- package/src/{theme → ARKIV}/button-bar/button-text-utils.ts +233 -233
- package/src/{theme → ARKIV}/button-bar/text-utils.spec.ts +105 -105
- package/src/Builder-option.ts +78 -62
- package/src/Builder-question.ts +98 -98
- package/src/Builder-schema.spec.ts +348 -348
- package/src/Builder-schema.ts +308 -306
- package/src/builder-compiler.ts +14 -20
- package/src/code-book/codebook-variable.ts +27 -27
- package/src/code-book/codebook.ts +89 -89
- package/src/media-files.ts +28 -32
- package/src/page/Builder-page-collection.spec.ts +219 -219
- package/src/page/Builder-page-collection.ts +129 -129
- package/src/page/Builder-page.spec.ts +177 -177
- package/src/page/Builder-page.ts +250 -250
- package/src/primitives/ID.ts +135 -135
- package/src/public-api.ts +29 -30
- package/src/rulebuilder/RuleAction.ts +105 -105
- package/src/schema-config.ts +25 -26
- package/src/sum-score/sum-score-variable-collection.spec.ts +68 -68
- package/src/sum-score/sum-score-variable-collection.ts +101 -101
- package/src/sum-score/sum-score-variable.ts +0 -1
- package/src/sum-score/sum-score.ts +166 -167
- package/src/tag/BuilderTag.ts +45 -45
- package/src/tag/Tag-Collection.ts +53 -53
- package/src/theme/Default-theme.ts +173 -188
- package/src/theme/IDefault-theme.ts +125 -125
- package/src/theme/ThemeCompiler.ts +10 -11
- package/src/theme/default-theme-compiler.spec.ts +31 -31
- package/src/theme/default-theme-compiler.ts +655 -652
- package/src/theme/icon-urls.ts +29 -29
- package/src/theme/icons.ts +117 -117
- package/src/theme/theme-utils.spec.ts +52 -52
- package/src/theme/theme-utils.ts +56 -56
- package/src/theme/theme2.ts +388 -386
- package/tsconfig.json +19 -19
- package/src/Builder-schema-dto.spec.ts +0 -155
- package/src/Builder-schema-dto.ts +0 -86
package/src/theme/theme2.ts
CHANGED
|
@@ -1,386 +1,388 @@
|
|
|
1
|
-
// import { IconUrls } from "./icon-urls";
|
|
2
|
-
import { BuilderOptionTheme, IDefaultTheme } from "./IDefault-theme";
|
|
3
|
-
import { CssTheme } from "./css-theme";
|
|
4
|
-
import { PStyle } from "@media-quest/engine";
|
|
5
|
-
import { THEME_2_ICONS } from "./icons";
|
|
6
|
-
|
|
7
|
-
const translate = (pos: { x?: number; y?: number }) => {
|
|
8
|
-
const x = pos.x || 0;
|
|
9
|
-
const y = pos.y || 0;
|
|
10
|
-
return `translate(${x}%, ${y}%)`;
|
|
11
|
-
};
|
|
12
|
-
export const translateY50 = translate({ y: 50 });
|
|
13
|
-
export const translateX50 = translate({ x: -50 });
|
|
14
|
-
const translateX50Y50 = translate({ x: -50, y: 50 });
|
|
15
|
-
|
|
16
|
-
const Colors = {
|
|
17
|
-
primary: "#164AC4",
|
|
18
|
-
secondary: "#E8F0FE",
|
|
19
|
-
text: "#0D1E45",
|
|
20
|
-
white: "#ffffff",
|
|
21
|
-
backgroundGray: "#F0F0F0",
|
|
22
|
-
backgroundWhite: "white",
|
|
23
|
-
// progressBackGround: "#164AC4",
|
|
24
|
-
// progressForGround: "#F5F5F5",
|
|
25
|
-
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
const AUDIO_ICON_HEIGHT = AUDIO_ICON_WIDTH * fraction;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
const
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
...
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
...
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
css:
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
}
|
|
1
|
+
// import { IconUrls } from "./icon-urls";
|
|
2
|
+
import { BuilderOptionTheme, IDefaultTheme } from "./IDefault-theme";
|
|
3
|
+
import { CssTheme } from "./css-theme";
|
|
4
|
+
import { PStyle } from "@media-quest/engine";
|
|
5
|
+
import { THEME_2_ICONS } from "./icons";
|
|
6
|
+
|
|
7
|
+
const translate = (pos: { x?: number; y?: number }) => {
|
|
8
|
+
const x = pos.x || 0;
|
|
9
|
+
const y = pos.y || 0;
|
|
10
|
+
return `translate(${x}%, ${y}%)`;
|
|
11
|
+
};
|
|
12
|
+
export const translateY50 = translate({ y: 50 });
|
|
13
|
+
export const translateX50 = translate({ x: -50 });
|
|
14
|
+
const translateX50Y50 = translate({ x: -50, y: 50 });
|
|
15
|
+
|
|
16
|
+
const Colors = {
|
|
17
|
+
primary: "#164AC4",
|
|
18
|
+
secondary: "#E8F0FE",
|
|
19
|
+
text: "#0D1E45",
|
|
20
|
+
white: "#ffffff",
|
|
21
|
+
backgroundGray: "#F0F0F0",
|
|
22
|
+
backgroundWhite: "white",
|
|
23
|
+
// progressBackGround: "#164AC4",
|
|
24
|
+
// progressForGround: "#F5F5F5",
|
|
25
|
+
// red: "red",
|
|
26
|
+
// yellow: "yellow",
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const MAIN_TEXT_FONT_SIZE = 35;
|
|
30
|
+
const MAIN_TEXT_LINE_HEIGHT = 1.2;
|
|
31
|
+
const fraction = 472.6 / 600;
|
|
32
|
+
|
|
33
|
+
const LAYER_0 = 0;
|
|
34
|
+
const LAYER_1 = 1;
|
|
35
|
+
const LAYER_2 = 2;
|
|
36
|
+
const LAYER_3 = 3;
|
|
37
|
+
const LAYER_4 = 4;
|
|
38
|
+
const LAYER_5 = 5;
|
|
39
|
+
const W_M1 = 6;
|
|
40
|
+
const W_M2 = 4.5;
|
|
41
|
+
const W_M3 = 3;
|
|
42
|
+
|
|
43
|
+
const W_M4 = 1.5;
|
|
44
|
+
|
|
45
|
+
const H_M1 = 5;
|
|
46
|
+
const H_M2 = 3.75;
|
|
47
|
+
const H_M3 = 2.5;
|
|
48
|
+
|
|
49
|
+
const H_M4 = 1.25;
|
|
50
|
+
|
|
51
|
+
const W_MAX = 100 - W_M1 * 2;
|
|
52
|
+
|
|
53
|
+
const PROGRESS_BAR_HEIGHT = 2;
|
|
54
|
+
|
|
55
|
+
const AUDIO_ICON_WIDTH = 10;
|
|
56
|
+
const AUDIO_ICON_HEIGHT = AUDIO_ICON_WIDTH * fraction;
|
|
57
|
+
// const AUDIO_ICON_HEIGHT = AUDIO_ICON_WIDTH * fraction;
|
|
58
|
+
const AUDIO_ICON_LEFT = W_M1 + W_M2 + W_M3;
|
|
59
|
+
|
|
60
|
+
const Q_AREA_HEIGHT = 32;
|
|
61
|
+
const Q_AREA_BOTTOM = 2 * H_M1 + H_M2;
|
|
62
|
+
const Q_AREA_LEFT = W_M1 + W_M2;
|
|
63
|
+
const Q_AREA_WIDTH = W_MAX - W_M2 - W_M2;
|
|
64
|
+
const Q_AREA_TOP = 100 - Q_AREA_HEIGHT - Q_AREA_BOTTOM;
|
|
65
|
+
|
|
66
|
+
const MEDIA_HEIGHT = 34;
|
|
67
|
+
// const MEDIA_WIDTH = 100 - 2 * W_M1 - 2 * W_M2;
|
|
68
|
+
const MEDIA_TOP = H_M1 + H_M2;
|
|
69
|
+
const MEDIA_BOTTOM = MEDIA_TOP + MEDIA_HEIGHT;
|
|
70
|
+
|
|
71
|
+
const MEDIA_LEFT = W_M1 + W_M2;
|
|
72
|
+
|
|
73
|
+
const VIDEO_BUTTONS_WIDTH = 8;
|
|
74
|
+
const VIDEO_BUTTONS_HEIGHT = VIDEO_BUTTONS_WIDTH * fraction;
|
|
75
|
+
const VIDEO_CONTROLS_WIDTH = VIDEO_BUTTONS_WIDTH * 2 + 4 * W_M4;
|
|
76
|
+
const VIDEO_CONTROLS_HEIGHT = VIDEO_BUTTONS_HEIGHT + 2 * H_M4 + 2;
|
|
77
|
+
const VIDEO_CONTROLS_LEFT = 50 - VIDEO_CONTROLS_WIDTH / 2;
|
|
78
|
+
const VIDEO_CONTROLS_RIGHT = 50 - VIDEO_CONTROLS_WIDTH / 2;
|
|
79
|
+
const VIDEO_CONTROLS_TOP = MEDIA_BOTTOM - 1;
|
|
80
|
+
const VIDEO_CONTROLS_BOTTOM = 100 - VIDEO_CONTROLS_HEIGHT - VIDEO_CONTROLS_TOP;
|
|
81
|
+
|
|
82
|
+
const PAGE_BACKGROUND_BOTTOM = H_M1 + H_M1;
|
|
83
|
+
const PAGE_BACKGROUND_HEIGHT = 100 - PAGE_BACKGROUND_BOTTOM - H_M1;
|
|
84
|
+
const BUTTON_BAR_WIDTH = Q_AREA_WIDTH - 2 * W_M3;
|
|
85
|
+
const MAIN_TEXT_WIDE = Q_AREA_WIDTH - 2 * W_M3;
|
|
86
|
+
const MAIN_TEXT_NARROW = MAIN_TEXT_WIDE - AUDIO_ICON_WIDTH - W_M3;
|
|
87
|
+
|
|
88
|
+
const btnTextBase: PStyle = {
|
|
89
|
+
fontSize: { _unit: "px", value: 25 },
|
|
90
|
+
bottom: VIDEO_CONTROLS_BOTTOM + 1.2,
|
|
91
|
+
zIndex: LAYER_5,
|
|
92
|
+
width: VIDEO_CONTROLS_WIDTH / 2,
|
|
93
|
+
textAlign: "center",
|
|
94
|
+
visibility: "hidden",
|
|
95
|
+
margin: { _unit: "px", value: 0 },
|
|
96
|
+
// backgroundColor: Colors.yellow,
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const muteUnmuteText: PStyle = { ...btnTextBase, right: VIDEO_CONTROLS_RIGHT };
|
|
100
|
+
const playPauseText: PStyle = { ...btnTextBase, left: VIDEO_CONTROLS_LEFT };
|
|
101
|
+
const replayText: PStyle = {
|
|
102
|
+
...btnTextBase,
|
|
103
|
+
width: VIDEO_CONTROLS_WIDTH,
|
|
104
|
+
left: VIDEO_CONTROLS_LEFT,
|
|
105
|
+
// backgroundColor: Colors.yellow,
|
|
106
|
+
visibility: "hidden",
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const playPauseBase: { css: PStyle; cssDisabled: PStyle; cssEnabled: PStyle } = {
|
|
110
|
+
css: {
|
|
111
|
+
width: VIDEO_BUTTONS_WIDTH,
|
|
112
|
+
height: VIDEO_BUTTONS_HEIGHT,
|
|
113
|
+
top: MEDIA_BOTTOM,
|
|
114
|
+
left: VIDEO_CONTROLS_LEFT + W_M4,
|
|
115
|
+
zIndex: LAYER_5,
|
|
116
|
+
visibility: "hidden",
|
|
117
|
+
},
|
|
118
|
+
cssDisabled: { opacity: 0.3, cursor: "not-allowed" },
|
|
119
|
+
cssEnabled: { opacity: 0.8, cursor: "pointer" },
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const replayButtonStyles: PStyle = {
|
|
123
|
+
width: VIDEO_BUTTONS_WIDTH,
|
|
124
|
+
height: VIDEO_BUTTONS_HEIGHT,
|
|
125
|
+
top: MEDIA_BOTTOM,
|
|
126
|
+
// backgroundColor: "red",
|
|
127
|
+
left: VIDEO_CONTROLS_LEFT + VIDEO_CONTROLS_WIDTH / 2,
|
|
128
|
+
transform: translateX50,
|
|
129
|
+
zIndex: LAYER_5,
|
|
130
|
+
visibility: "hidden",
|
|
131
|
+
cursor: "pointer",
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const muteUnMuteStyles: { css: PStyle; cssDisabled: PStyle; cssEnabled: PStyle } = {
|
|
135
|
+
css: {
|
|
136
|
+
width: VIDEO_BUTTONS_WIDTH,
|
|
137
|
+
height: VIDEO_BUTTONS_HEIGHT,
|
|
138
|
+
top: MEDIA_BOTTOM,
|
|
139
|
+
right: VIDEO_CONTROLS_RIGHT + W_M4,
|
|
140
|
+
zIndex: LAYER_5,
|
|
141
|
+
cursor: "pointer",
|
|
142
|
+
// transform: "translateX: 100%",
|
|
143
|
+
},
|
|
144
|
+
cssDisabled: { opacity: 0.3, cursor: "not-allowed" },
|
|
145
|
+
cssEnabled: { opacity: 0.8, cursor: "pointer" },
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const FONT_QUESTION = 20;
|
|
149
|
+
const FONT_ = 20;
|
|
150
|
+
const responseButtonBaseCss = (): CssTheme => ({
|
|
151
|
+
css: {
|
|
152
|
+
backgroundColor: Colors.primary,
|
|
153
|
+
borderColor: Colors.primary,
|
|
154
|
+
textColor: Colors.white,
|
|
155
|
+
fontWeight: 600,
|
|
156
|
+
fontSize: { _unit: "px", value: 28 },
|
|
157
|
+
lineHeight: 1.1,
|
|
158
|
+
|
|
159
|
+
// TODO Denne angir knappens max-bredde. Default bør være 25.
|
|
160
|
+
maxWidth: 25,
|
|
161
|
+
minWidth: 12,
|
|
162
|
+
// width: 20,
|
|
163
|
+
// flex: "0 0 auto",
|
|
164
|
+
paddingLeft: { _unit: "px", value: 10 },
|
|
165
|
+
paddingTop: { _unit: "px", value: 5 },
|
|
166
|
+
paddingBottom: { _unit: "px", value: 5 },
|
|
167
|
+
paddingRight: { _unit: "px", value: 10 },
|
|
168
|
+
borderRadius: { _unit: "px", value: 20 },
|
|
169
|
+
borderStyle: "solid",
|
|
170
|
+
boxShadow: "3px 3px gray",
|
|
171
|
+
position: "relative",
|
|
172
|
+
display: "block",
|
|
173
|
+
cursor: "pointer",
|
|
174
|
+
// maxWidth: { _unit: "percent", value: 10 },
|
|
175
|
+
},
|
|
176
|
+
cssDisabled: { opacity: 0.3, cursor: "not-allowed" },
|
|
177
|
+
cssEnabled: { opacity: 1, cursor: "pointer" },
|
|
178
|
+
});
|
|
179
|
+
export const primaryButton = (overridesCss: PStyle): BuilderOptionTheme => {
|
|
180
|
+
const base = responseButtonBaseCss();
|
|
181
|
+
const optionTheme: BuilderOptionTheme = {
|
|
182
|
+
name: "primary-button",
|
|
183
|
+
normal: {
|
|
184
|
+
btn: {
|
|
185
|
+
css: {
|
|
186
|
+
...base.css,
|
|
187
|
+
...overridesCss,
|
|
188
|
+
backgroundColor: Colors.primary,
|
|
189
|
+
borderColor: Colors.primary,
|
|
190
|
+
textColor: Colors.white,
|
|
191
|
+
},
|
|
192
|
+
cssDisabled: base.cssDisabled,
|
|
193
|
+
cssEnabled: base.cssEnabled,
|
|
194
|
+
},
|
|
195
|
+
divider: {},
|
|
196
|
+
text1: {},
|
|
197
|
+
text2: {},
|
|
198
|
+
},
|
|
199
|
+
|
|
200
|
+
dontKnow: {
|
|
201
|
+
btn: {
|
|
202
|
+
css: {
|
|
203
|
+
...base.css,
|
|
204
|
+
...overridesCss,
|
|
205
|
+
backgroundColor: Colors.secondary,
|
|
206
|
+
borderColor: Colors.secondary,
|
|
207
|
+
textColor: Colors.primary,
|
|
208
|
+
},
|
|
209
|
+
cssEnabled: base.cssEnabled,
|
|
210
|
+
cssDisabled: base.cssDisabled,
|
|
211
|
+
},
|
|
212
|
+
text1: {},
|
|
213
|
+
text2: {},
|
|
214
|
+
divider: {},
|
|
215
|
+
},
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
return optionTheme;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export const Theme2: IDefaultTheme = {
|
|
222
|
+
name: "theme2",
|
|
223
|
+
schemaBackgroundColor: Colors.white,
|
|
224
|
+
dimensions: { baseHeight: 1300, baseWidth: 1024 },
|
|
225
|
+
pageBackGround: {
|
|
226
|
+
style: {
|
|
227
|
+
height: PAGE_BACKGROUND_HEIGHT,
|
|
228
|
+
width: W_MAX,
|
|
229
|
+
bottom: PAGE_BACKGROUND_BOTTOM,
|
|
230
|
+
left: W_M1,
|
|
231
|
+
backgroundColor: Colors.backgroundGray,
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
backGroundArea1: {
|
|
235
|
+
style: {
|
|
236
|
+
height: Q_AREA_HEIGHT,
|
|
237
|
+
width: Q_AREA_WIDTH,
|
|
238
|
+
left: Q_AREA_LEFT,
|
|
239
|
+
bottom: Q_AREA_BOTTOM,
|
|
240
|
+
backgroundColor: Colors.white,
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
progressBar: {
|
|
244
|
+
width: W_MAX,
|
|
245
|
+
height: PROGRESS_BAR_HEIGHT,
|
|
246
|
+
bottom: H_M1,
|
|
247
|
+
left: W_M1,
|
|
248
|
+
backgroundStyles: {
|
|
249
|
+
backgroundColor: Colors.backgroundGray,
|
|
250
|
+
borderRadius: { _unit: "px", value: 10 },
|
|
251
|
+
},
|
|
252
|
+
progressStyles: {
|
|
253
|
+
backgroundColor: Colors.primary,
|
|
254
|
+
borderRadius: { _unit: "px", value: 10 },
|
|
255
|
+
},
|
|
256
|
+
text: {
|
|
257
|
+
textType: "page-progress",
|
|
258
|
+
style: { fontSize: { _unit: "px", value: 20 }, x: 81.5, y: 2.5 },
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
videoPlayer: {
|
|
262
|
+
playButton: {
|
|
263
|
+
text: { text: "Spill av", css: { ...playPauseText } },
|
|
264
|
+
iconUrl: THEME_2_ICONS.videoPlay.dataUrl,
|
|
265
|
+
...playPauseBase,
|
|
266
|
+
},
|
|
267
|
+
pauseButton: {
|
|
268
|
+
text: { text: "Pause", css: { ...playPauseText } },
|
|
269
|
+
iconUrl: THEME_2_ICONS.videoPause.dataUrl,
|
|
270
|
+
...playPauseBase,
|
|
271
|
+
},
|
|
272
|
+
buttonBar: {
|
|
273
|
+
width: VIDEO_CONTROLS_WIDTH,
|
|
274
|
+
zIndex: LAYER_4,
|
|
275
|
+
top: VIDEO_CONTROLS_TOP,
|
|
276
|
+
left: VIDEO_CONTROLS_LEFT,
|
|
277
|
+
backgroundColor: Colors.white,
|
|
278
|
+
height: VIDEO_CONTROLS_HEIGHT,
|
|
279
|
+
borderRadius: { _unit: "px", value: 16 },
|
|
280
|
+
},
|
|
281
|
+
muteButton: {
|
|
282
|
+
text: { text: "Lyd av", css: { ...muteUnmuteText } },
|
|
283
|
+
iconUrl: THEME_2_ICONS.mute.dataUrl,
|
|
284
|
+
css: muteUnMuteStyles.css,
|
|
285
|
+
},
|
|
286
|
+
|
|
287
|
+
unMuteButton: {
|
|
288
|
+
iconUrl: THEME_2_ICONS.unMute.dataUrl,
|
|
289
|
+
css: muteUnMuteStyles.css,
|
|
290
|
+
text: { text: "Lyd på", css: { ...muteUnmuteText } },
|
|
291
|
+
},
|
|
292
|
+
|
|
293
|
+
replayButton: {
|
|
294
|
+
css: replayButtonStyles,
|
|
295
|
+
cssDisabled: {},
|
|
296
|
+
cssEnabled: {},
|
|
297
|
+
iconUrl: THEME_2_ICONS.videoReplay.dataUrl,
|
|
298
|
+
text: { text: "Spill av på nytt", css: replayText },
|
|
299
|
+
},
|
|
300
|
+
|
|
301
|
+
videoElement: {
|
|
302
|
+
css: {
|
|
303
|
+
height: MEDIA_HEIGHT,
|
|
304
|
+
top: MEDIA_TOP,
|
|
305
|
+
transform: translateX50,
|
|
306
|
+
left: 50,
|
|
307
|
+
width: 100,
|
|
308
|
+
zIndex: LAYER_2,
|
|
309
|
+
visibility: "visible",
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
image: {
|
|
314
|
+
style: {
|
|
315
|
+
height: MEDIA_HEIGHT,
|
|
316
|
+
// Center image, with dynamic width.
|
|
317
|
+
left: 50,
|
|
318
|
+
transform: translateX50,
|
|
319
|
+
top: MEDIA_TOP,
|
|
320
|
+
boxShadow: "3px 3px",
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
|
|
324
|
+
mainText: {
|
|
325
|
+
base: {
|
|
326
|
+
text: {
|
|
327
|
+
width: MAIN_TEXT_WIDE,
|
|
328
|
+
left: W_M1 + W_M2 + W_M3,
|
|
329
|
+
top: Q_AREA_TOP + H_M3,
|
|
330
|
+
backgroundColor: Colors.white,
|
|
331
|
+
textAlign: "left",
|
|
332
|
+
textColor: "black",
|
|
333
|
+
fontSize: { _unit: "px", value: 35 },
|
|
334
|
+
lineHeight: 1.2,
|
|
335
|
+
},
|
|
336
|
+
audio: {
|
|
337
|
+
iconUrl: THEME_2_ICONS.audioPlay.dataUrl,
|
|
338
|
+
css: {
|
|
339
|
+
height: AUDIO_ICON_HEIGHT,
|
|
340
|
+
width: AUDIO_ICON_WIDTH,
|
|
341
|
+
top: Q_AREA_TOP + H_M3,
|
|
342
|
+
left: W_M1 + W_M2 + W_M3,
|
|
343
|
+
cursor: "pointer",
|
|
344
|
+
// transform: "translateY(100%)",
|
|
345
|
+
opacity: 0.8,
|
|
346
|
+
visibility: "visible",
|
|
347
|
+
// backgroundColor: "green",
|
|
348
|
+
},
|
|
349
|
+
cssDisabled: { opacity: 0.3, cursor: "not-allowed" },
|
|
350
|
+
cssEnabled: { opacity: 0.8, cursor: "pointer" },
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
notMediaHasAudio: {
|
|
354
|
+
text: { width: MAIN_TEXT_NARROW, left: W_M1 + W_M2 + W_M3 + AUDIO_ICON_WIDTH + W_M3 },
|
|
355
|
+
audio: {},
|
|
356
|
+
},
|
|
357
|
+
hasMediaHasAudio: {
|
|
358
|
+
text: {
|
|
359
|
+
width: MAIN_TEXT_NARROW,
|
|
360
|
+
left: W_M1 + W_M2 + W_M3 + AUDIO_ICON_WIDTH + W_M3,
|
|
361
|
+
},
|
|
362
|
+
audio: {},
|
|
363
|
+
},
|
|
364
|
+
notMediaNotAudio: { text: {} },
|
|
365
|
+
hasMediaNotAudio: { text: {} },
|
|
366
|
+
},
|
|
367
|
+
buttonBar: {
|
|
368
|
+
vibrateMs: 60,
|
|
369
|
+
container: {
|
|
370
|
+
base: {
|
|
371
|
+
display: "flex",
|
|
372
|
+
justifyContent: "flex-start",
|
|
373
|
+
width: BUTTON_BAR_WIDTH,
|
|
374
|
+
height: 6,
|
|
375
|
+
bottom: Q_AREA_BOTTOM + H_M3,
|
|
376
|
+
left: Q_AREA_LEFT + W_M3,
|
|
377
|
+
// backgroundColor: "green",
|
|
378
|
+
gap: { _unit: "px", value: 40 },
|
|
379
|
+
alignItems: "stretch",
|
|
380
|
+
},
|
|
381
|
+
whenSingle: { justifyContent: "center" },
|
|
382
|
+
whenMany: { justifyContent: "flex-start" },
|
|
383
|
+
},
|
|
384
|
+
|
|
385
|
+
nextButtonTheme: primaryButton({}),
|
|
386
|
+
responseButtons: primaryButton({}),
|
|
387
|
+
},
|
|
388
|
+
};
|