@windward/games 0.0.10 → 0.1.0
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/components/content/CrudTable.vue +2 -2
- package/components/content/blocks/crosswordPuzzle/CrosswordClues.vue +4 -2
- package/components/content/blocks/crosswordPuzzle/CrosswordPuzzle.vue +14 -12
- package/components/content/blocks/dragDrop/BucketGame.vue +14 -15
- package/components/content/blocks/dragDrop/SortingGame.vue +4 -4
- package/components/content/blocks/flashcards/CardFace.vue +38 -39
- package/components/content/blocks/flashcards/Flashcard.vue +109 -28
- package/components/content/blocks/flashcards/FlashcardSlides.vue +1 -2
- package/components/content/blocks/matchingGame/MatchingGame.vue +15 -14
- package/components/content/blocks/multipleChoice/MultipleChoice.vue +186 -225
- package/components/content/blocks/multipleChoice/QuestionDialog.vue +7 -7
- package/components/content/blocks/quizshowGame/AnswerPanel.vue +9 -9
- package/components/content/blocks/quizshowGame/Gridview.vue +20 -24
- package/components/content/blocks/quizshowGame/QuizShow.vue +6 -6
- package/components/content/blocks/quizshowGame/feedbackIcons.vue +4 -2
- package/components/content/blocks/sevenStrikes/SevenStikes.vue +153 -108
- package/components/content/blocks/sevenStrikes/keyboard.vue +9 -2
- package/components/content/blocks/slideshow/SlideShow.vue +3 -3
- package/components/content/blocks/wordJumble/Jumble.vue +0 -2
- package/components/content/blocks/wordJumble/WordJumble.vue +117 -60
- package/components/settings/BucketGameSettingsManager.vue +20 -20
- package/components/settings/CrosswordPuzzleSettingsManager.vue +114 -181
- package/components/settings/FlashCardSlidesManager.vue +46 -63
- package/components/settings/MatchingGameManager.vue +19 -19
- package/components/settings/MultipleChoiceSettingsManager.vue +130 -140
- package/components/settings/QuizShowSettingsManager.vue +17 -17
- package/components/settings/SevenStrikesSettingsManager.vue +131 -193
- package/components/settings/SlideShowManager.vue +9 -9
- package/components/settings/SortingGameSettingsManager.vue +11 -11
- package/components/settings/WordJumbleSettingsManager.vue +40 -12
- package/i18n/en-US/components/content/blocks/flashcard.ts +1 -0
- package/i18n/en-US/components/content/blocks/word_jumble.ts +2 -0
- package/i18n/en-US/components/settings/bucket_game.ts +3 -2
- package/i18n/en-US/components/settings/flashcard.ts +1 -0
- package/i18n/en-US/components/settings/seven_strikes.ts +1 -1
- package/i18n/en-US/index.ts +2 -1
- package/i18n/es-ES/components/content/blocks/flashcard.ts +1 -0
- package/i18n/es-ES/components/content/blocks/word_jumble.ts +2 -0
- package/i18n/es-ES/components/settings/bucket_game.ts +3 -2
- package/i18n/es-ES/components/settings/flashcard.ts +1 -0
- package/i18n/es-ES/components/settings/seven_strikes.ts +2 -2
- package/i18n/es-ES/index.ts +2 -1
- package/i18n/index.ts +11 -0
- package/i18n/sv-SE/components/content/blocks/flashcard.ts +1 -0
- package/i18n/sv-SE/components/content/blocks/word_jumble.ts +2 -0
- package/i18n/sv-SE/components/settings/bucket_game.ts +2 -2
- package/i18n/sv-SE/components/settings/flashcard.ts +1 -0
- package/i18n/sv-SE/components/settings/seven_strikes.ts +1 -1
- package/i18n/sv-SE/index.ts +2 -1
- package/package.json +1 -1
- package/plugin.js +33 -34
- package/test/Feature/LocaleKeys.spec.js +11 -0
- package/test/__mocks__/componentsMock.js +12 -0
- package/test/__mocks__/fileMock.js +1 -0
- package/test/__mocks__/modelMock.js +88 -0
- package/test/__mocks__/styleMock.js +1 -0
- package/test/blocks/crossword/CrosswordPuzzle.spec.js +1 -1
- package/test/blocks/dragDrop/BucketGame.spec.js +1 -1
- package/test/blocks/dragDrop/SortingGame.spec.js +1 -1
- package/test/blocks/flashcards/CardFace.spec.js +1 -1
- package/test/blocks/flashcards/FlashCardSlides.spec.js +1 -1
- package/test/blocks/flashcards/Flashcard.spec.js +1 -1
- package/test/blocks/matchingGame/MatchingGame.spec.js +1 -1
- package/test/blocks/multipleChoice/MultipleChoice.spec.js +1 -1
- package/test/blocks/multipleChoice/QuestionDialog.spec.js +1 -1
- package/test/blocks/quizShow/quizShow.spec.js +1 -1
- package/test/blocks/sevenStrikes/sevenStrikes.spec.js +1 -1
- package/test/blocks/slideshow/slideshow.spec.js +1 -1
- package/test/blocks/wordJumble/Jumble.spec.js +1 -1
- package/test/blocks/wordJumble/WordJumble.spec.js +1 -1
- package/test/mocks.js +8 -2
- package/test/settings/BucketGameManager.spec.js +4 -4
- package/test/settings/CrosswordPuzzleManager.spec.js +6 -11
- package/test/settings/FlashCardSlidesManager.spec.js +1 -1
- package/test/settings/MatchingGameManager.spec.js +1 -1
- package/test/settings/MultipleChoiceGameManager.spec.js +1 -1
- package/test/settings/SevenStrikesManager.spec.js +1 -1
- package/test/settings/SlideShowManager.spec.js +1 -1
- package/test/settings/SortingGameManager.spec.js +1 -1
- package/test/settings/WordJumbleManager.spec.js +1 -4
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<v-btn color="primary" dark class="mb-2" @click="addNew">
|
|
15
15
|
{{
|
|
16
16
|
$t(
|
|
17
|
-
'
|
|
17
|
+
'windward.games.components.content.crud_table.add_row'
|
|
18
18
|
)
|
|
19
19
|
}}
|
|
20
20
|
</v-btn>
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
>
|
|
35
35
|
{{
|
|
36
36
|
$t(
|
|
37
|
-
'
|
|
37
|
+
'windward.games.components.content.crud_table.new_item'
|
|
38
38
|
)
|
|
39
39
|
}}
|
|
40
40
|
</v-btn>
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
>
|
|
8
8
|
<h3 class="crossword-clues__list-title">
|
|
9
9
|
{{
|
|
10
|
-
$t(
|
|
10
|
+
$t(
|
|
11
|
+
`windward.games.components.content.blocks.crossword.down`
|
|
12
|
+
)
|
|
11
13
|
}}
|
|
12
14
|
</h3>
|
|
13
15
|
<v-list dense>
|
|
@@ -33,7 +35,7 @@
|
|
|
33
35
|
<h3 class="crossword-clues__list-title">
|
|
34
36
|
{{
|
|
35
37
|
$t(
|
|
36
|
-
`
|
|
38
|
+
`windward.games.components.content.blocks.crossword.across`
|
|
37
39
|
)
|
|
38
40
|
}}
|
|
39
41
|
</h3>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-container>
|
|
3
3
|
<div>
|
|
4
|
-
<
|
|
4
|
+
<h3>{{ block.metadata.config.title }}</h3>
|
|
5
5
|
<p>{{ block.metadata.config.instructions }}</p>
|
|
6
6
|
</div>
|
|
7
7
|
<v-alert v-if="wordMap.length === 0" type="info" class="text-center">
|
|
8
8
|
<p>
|
|
9
9
|
{{
|
|
10
10
|
$t(
|
|
11
|
-
'
|
|
11
|
+
'windward.games.components.content.blocks.crossword.initial_setup'
|
|
12
12
|
)
|
|
13
13
|
}}
|
|
14
14
|
</p>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<p>
|
|
22
22
|
{{
|
|
23
23
|
$t(
|
|
24
|
-
'
|
|
24
|
+
'windward.games.components.content.blocks.crossword.validation_error'
|
|
25
25
|
)
|
|
26
26
|
}}
|
|
27
27
|
</p>
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
>
|
|
92
92
|
{{
|
|
93
93
|
$t(
|
|
94
|
-
'
|
|
94
|
+
'windward.games.components.content.blocks.crossword.play_again'
|
|
95
95
|
)
|
|
96
96
|
}}
|
|
97
97
|
</v-btn>
|
|
@@ -126,7 +126,9 @@ export default {
|
|
|
126
126
|
this.block.metadata.config = {}
|
|
127
127
|
}
|
|
128
128
|
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
129
|
-
this.block.metadata.config.title =
|
|
129
|
+
this.block.metadata.config.title = this.$t(
|
|
130
|
+
'windward.games.components.content.blocks.crossword.crossword'
|
|
131
|
+
)
|
|
130
132
|
}
|
|
131
133
|
if (_.isEmpty(this.block.metadata.config.instructions)) {
|
|
132
134
|
this.block.metadata.config.instructions = ''
|
|
@@ -249,7 +251,7 @@ export default {
|
|
|
249
251
|
|
|
250
252
|
if (_.isEmpty(this.wordMap)) {
|
|
251
253
|
this.error = this.$t(
|
|
252
|
-
'
|
|
254
|
+
'windward.games.components.content.blocks.crossword.error.min_words'
|
|
253
255
|
)
|
|
254
256
|
} else {
|
|
255
257
|
// checks if there are any words that don't share letters with any others
|
|
@@ -257,22 +259,22 @@ export default {
|
|
|
257
259
|
|
|
258
260
|
if (this.wordMap.length < 2) {
|
|
259
261
|
this.error = this.$t(
|
|
260
|
-
'
|
|
262
|
+
'windward.games.components.content.blocks.crossword.error.min_words'
|
|
261
263
|
)
|
|
262
264
|
} else if (letterCheck.length > 0) {
|
|
263
265
|
// if a word doesn't share letters load with dummy data and alert the user
|
|
264
266
|
let words = letterCheck.toString()
|
|
265
267
|
this.error = this.$t(
|
|
266
|
-
'
|
|
268
|
+
'windward.games.components.content.blocks.crossword.error.words_no_shared_letters',
|
|
267
269
|
[words]
|
|
268
270
|
)
|
|
269
271
|
} else if (!this.validateWordMaxLength(this.wordMap)) {
|
|
270
272
|
this.error = this.$t(
|
|
271
|
-
'
|
|
273
|
+
'windward.games.components.content.blocks.crossword.error.word_length_max_limit'
|
|
272
274
|
)
|
|
273
275
|
} else if (!this.validateWordMinLength(this.wordMap)) {
|
|
274
276
|
this.error = this.$t(
|
|
275
|
-
'
|
|
277
|
+
'windward.games.components.content.blocks.crossword.error.word_length_min_limit'
|
|
276
278
|
)
|
|
277
279
|
}
|
|
278
280
|
}
|
|
@@ -435,14 +437,14 @@ export default {
|
|
|
435
437
|
|
|
436
438
|
if (grid.length > MATRIX_LENGTH) {
|
|
437
439
|
this.error = this.$t(
|
|
438
|
-
'
|
|
440
|
+
'windward.games.components.content.blocks.crossword.error.could_not_generate'
|
|
439
441
|
)
|
|
440
442
|
return false
|
|
441
443
|
}
|
|
442
444
|
|
|
443
445
|
if (_.isEmpty(grid)) {
|
|
444
446
|
this.error = this.$t(
|
|
445
|
-
'
|
|
447
|
+
'windward.games.components.content.blocks.crossword.error.unknown'
|
|
446
448
|
)
|
|
447
449
|
|
|
448
450
|
return false
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<h3
|
|
5
5
|
:aria-label="
|
|
6
6
|
$t(
|
|
7
|
-
'
|
|
7
|
+
'windward.games.components.content.blocks.bucket_game.aria_title'
|
|
8
8
|
)
|
|
9
9
|
"
|
|
10
10
|
tabindex="0"
|
|
@@ -18,19 +18,18 @@
|
|
|
18
18
|
<h4 v-if="!render" class="d-flex justify-center align-center">
|
|
19
19
|
{{
|
|
20
20
|
$t(
|
|
21
|
-
'
|
|
21
|
+
'windward.games.components.content.blocks.bucket_game.cannot'
|
|
22
22
|
)
|
|
23
23
|
}}
|
|
24
24
|
</h4>
|
|
25
|
-
<v-container fluid :class="status"
|
|
26
|
-
<
|
|
27
|
-
<v-row>
|
|
25
|
+
<v-container fluid :class="status">
|
|
26
|
+
<v-row class="pa-4">
|
|
28
27
|
<v-col></v-col>
|
|
29
|
-
<v-col class="d-flex justify-center">{{
|
|
28
|
+
<v-col class="d-flex justify-center align-center">{{
|
|
30
29
|
feedback
|
|
31
30
|
? feedback
|
|
32
31
|
: $t(
|
|
33
|
-
'
|
|
32
|
+
'windward.games.components.content.blocks.bucket_game.form.feedback.feedback_here'
|
|
34
33
|
)
|
|
35
34
|
}}</v-col>
|
|
36
35
|
<v-col class="d-flex justify-end pl-4">
|
|
@@ -51,7 +50,6 @@
|
|
|
51
50
|
</v-container>
|
|
52
51
|
</v-col>
|
|
53
52
|
</v-row>
|
|
54
|
-
<br />
|
|
55
53
|
</v-container>
|
|
56
54
|
<div v-if="render">
|
|
57
55
|
<v-container>
|
|
@@ -216,7 +214,7 @@
|
|
|
216
214
|
tabindex="0"
|
|
217
215
|
:aria-label="
|
|
218
216
|
$t(
|
|
219
|
-
'
|
|
217
|
+
'windward.games.components.content.blocks.matching_game.of_complete',
|
|
220
218
|
[completedAmount, totalAmountQuestions]
|
|
221
219
|
)
|
|
222
220
|
"
|
|
@@ -224,7 +222,7 @@
|
|
|
224
222
|
<v-col align="end" tabindex="0">
|
|
225
223
|
{{
|
|
226
224
|
$t(
|
|
227
|
-
'
|
|
225
|
+
'windward.games.components.content.blocks.matching_game.of_complete_text_area',
|
|
228
226
|
[completedAmount, totalAmountQuestions]
|
|
229
227
|
)
|
|
230
228
|
}}
|
|
@@ -234,6 +232,7 @@
|
|
|
234
232
|
outlined
|
|
235
233
|
rounded
|
|
236
234
|
height="15"
|
|
235
|
+
style="pointer-events: none"
|
|
237
236
|
></v-progress-linear>
|
|
238
237
|
<br />
|
|
239
238
|
<v-btn color="primary" outlined @click="onReset"
|
|
@@ -268,7 +267,7 @@ export default {
|
|
|
268
267
|
}
|
|
269
268
|
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
270
269
|
this.block.metadata.config.title = this.$t(
|
|
271
|
-
'
|
|
270
|
+
'windward.games.components.content.blocks.bucket_game.game_title'
|
|
272
271
|
)
|
|
273
272
|
}
|
|
274
273
|
if (_.isEmpty(this.block.metadata.config.instructions)) {
|
|
@@ -276,12 +275,12 @@ export default {
|
|
|
276
275
|
}
|
|
277
276
|
if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
|
|
278
277
|
this.block.metadata.config.feedback_correct = this.$t(
|
|
279
|
-
'
|
|
278
|
+
'windward.games.components.settings.bucket_game.form.feedback.correct_default'
|
|
280
279
|
)
|
|
281
280
|
}
|
|
282
281
|
if (_.isEmpty(this.block.metadata.config.feedback_incorrect)) {
|
|
283
282
|
this.block.metadata.config.feedback_incorrect = this.$t(
|
|
284
|
-
'
|
|
283
|
+
'windward.games.components.settings.bucket_game.form.feedback.incorrect_default'
|
|
285
284
|
)
|
|
286
285
|
}
|
|
287
286
|
if (_.isEmpty(this.block.metadata.config.bucket_titles)) {
|
|
@@ -292,7 +291,7 @@ export default {
|
|
|
292
291
|
}
|
|
293
292
|
if (_.isEmpty(this.block.body)) {
|
|
294
293
|
this.block.body = this.$t(
|
|
295
|
-
'
|
|
294
|
+
'windward.games.components.content.blocks.bucket_game.game_title'
|
|
296
295
|
)
|
|
297
296
|
}
|
|
298
297
|
},
|
|
@@ -431,7 +430,7 @@ export default {
|
|
|
431
430
|
this.status = 'successOutline'
|
|
432
431
|
} else if (this.mainAnswer.length === 0) {
|
|
433
432
|
this.feedback = this.$t(
|
|
434
|
-
'
|
|
433
|
+
'windward.games.components.content.blocks.matching_game.congratulations_feedback'
|
|
435
434
|
)
|
|
436
435
|
} else {
|
|
437
436
|
let items = this.items[bucket_index]
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
<v-btn color="primary" elevation="0" @click="checkAnswers">
|
|
84
84
|
{{
|
|
85
85
|
$t(
|
|
86
|
-
'
|
|
86
|
+
'windward.games.components.content.blocks.sorting_game.check_answers'
|
|
87
87
|
)
|
|
88
88
|
}}
|
|
89
89
|
</v-btn>
|
|
@@ -168,17 +168,17 @@ export default {
|
|
|
168
168
|
}
|
|
169
169
|
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
170
170
|
this.block.metadata.config.title = this.$t(
|
|
171
|
-
'
|
|
171
|
+
'windward.games.components.settings.sorting_game.sortable_game'
|
|
172
172
|
)
|
|
173
173
|
}
|
|
174
174
|
if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
|
|
175
175
|
this.block.metadata.config.feedback_correct = this.$t(
|
|
176
|
-
'
|
|
176
|
+
'windward.games.components.settings.bucket_game.form.feedback.correct_default'
|
|
177
177
|
)
|
|
178
178
|
}
|
|
179
179
|
if (_.isEmpty(this.block.metadata.config.feedback_incorrect)) {
|
|
180
180
|
this.block.metadata.config.feedback_incorrect = this.$t(
|
|
181
|
-
'
|
|
181
|
+
'windward.games.components.settings.bucket_game.form.feedback.incorrect_default'
|
|
182
182
|
)
|
|
183
183
|
}
|
|
184
184
|
if (_.isEmpty(this.block.metadata.config.answer)) {
|
|
@@ -1,37 +1,33 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
v-bind:style="{
|
|
4
|
-
color: textColor,
|
|
5
|
-
}"
|
|
6
|
-
>
|
|
7
|
-
<v-row class="card-header" align="center" justify="center">
|
|
8
|
-
<content-viewer v-model="settings.header" />
|
|
9
|
-
</v-row>
|
|
2
|
+
<v-container>
|
|
10
3
|
<br />
|
|
11
4
|
<div class="card-content">
|
|
5
|
+
<v-row align="center" justify="center">
|
|
6
|
+
<content-viewer :class="textClass" v-model="settings.text" />
|
|
7
|
+
</v-row>
|
|
8
|
+
<br />
|
|
12
9
|
<v-row
|
|
13
|
-
|
|
10
|
+
no-gutters
|
|
14
11
|
align="center"
|
|
15
12
|
justify="center"
|
|
13
|
+
v-if="settings.img !== ''"
|
|
16
14
|
>
|
|
17
|
-
<content-viewer :class="textClass" v-model="settings.text" />
|
|
18
|
-
</v-row>
|
|
19
|
-
<v-row align="center" justify="center" v-if="settings.img !== ''">
|
|
20
15
|
<v-img
|
|
21
16
|
contain
|
|
22
17
|
:aspect-ratio="16 / 9"
|
|
23
18
|
:src="settings.img"
|
|
24
19
|
:alt="settings.altText"
|
|
25
|
-
max-height="
|
|
20
|
+
max-height="210"
|
|
26
21
|
max-width="600"
|
|
27
22
|
/>
|
|
28
23
|
</v-row>
|
|
24
|
+
<br />
|
|
29
25
|
</div>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</
|
|
26
|
+
<v-row class="card-footer pt-4" align="center" justify="center">
|
|
27
|
+
{{ settings.footer }}
|
|
28
|
+
<v-icon color="primary">mdi-orbit-variant</v-icon>
|
|
29
|
+
</v-row>
|
|
30
|
+
</v-container>
|
|
35
31
|
</template>
|
|
36
32
|
|
|
37
33
|
<script>
|
|
@@ -42,16 +38,21 @@ export default {
|
|
|
42
38
|
components: { ContentViewer },
|
|
43
39
|
props: {
|
|
44
40
|
settings: { type: Object },
|
|
45
|
-
|
|
41
|
+
side: { type: String },
|
|
46
42
|
},
|
|
47
43
|
computed: {
|
|
48
44
|
textClass() {
|
|
49
45
|
if (
|
|
50
46
|
!this.settings.img &&
|
|
51
47
|
this.settings.text &&
|
|
52
|
-
this.settings.text.length <
|
|
48
|
+
this.settings.text.length < 100 &&
|
|
49
|
+
this.side === 'front'
|
|
53
50
|
) {
|
|
54
|
-
return 'centered'
|
|
51
|
+
return 'text-justify centered card-content--bold'
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (this.side === 'front') {
|
|
55
|
+
return 'text-center card-content--bold'
|
|
55
56
|
}
|
|
56
57
|
if (
|
|
57
58
|
!this.settings.img &&
|
|
@@ -59,38 +60,35 @@ export default {
|
|
|
59
60
|
(MathHelper.containsMathML(this.settings.text.length) ||
|
|
60
61
|
MathHelper.containsLatex(this.settings.text.length))
|
|
61
62
|
) {
|
|
62
|
-
return 'centered'
|
|
63
|
+
return 'text-justify centered'
|
|
63
64
|
}
|
|
64
65
|
|
|
65
|
-
if (
|
|
66
|
-
!this.settings.img &&
|
|
67
|
-
this.settings.text &&
|
|
68
|
-
this.settings.text.length > 100 &&
|
|
69
|
-
!(
|
|
70
|
-
MathHelper.containsMathML(this.settings.text.length) ||
|
|
71
|
-
MathHelper.containsLatex(this.settings.text.length)
|
|
72
|
-
)
|
|
73
|
-
) {
|
|
74
|
-
return 'paragraph'
|
|
75
|
-
}
|
|
76
66
|
|
|
77
|
-
return ''
|
|
67
|
+
return 'px-6 text-justify'
|
|
78
68
|
},
|
|
79
69
|
},
|
|
80
70
|
methods: {},
|
|
81
71
|
}
|
|
82
72
|
</script>
|
|
83
73
|
|
|
84
|
-
<style scoped>
|
|
74
|
+
<style lang="scss" scoped>
|
|
85
75
|
.card-header {
|
|
86
|
-
font-weight: bold;
|
|
87
76
|
}
|
|
88
77
|
.card-content {
|
|
78
|
+
color: var(--v-primary-base);
|
|
79
|
+
font-size: 1rem;
|
|
80
|
+
}
|
|
81
|
+
.card-content--bold {
|
|
89
82
|
font-weight: bold;
|
|
90
|
-
|
|
83
|
+
font-size: 1.5rem;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
p.card-content {
|
|
87
|
+
font-size: 1.5rem !important;
|
|
91
88
|
}
|
|
92
89
|
.card-footer {
|
|
93
90
|
font-weight: bold;
|
|
91
|
+
color: var(--v-primary-base);
|
|
94
92
|
}
|
|
95
93
|
.centered {
|
|
96
94
|
margin: 0;
|
|
@@ -102,11 +100,12 @@ export default {
|
|
|
102
100
|
.card-footer {
|
|
103
101
|
margin: 0;
|
|
104
102
|
position: absolute;
|
|
105
|
-
top:
|
|
103
|
+
top: 90%;
|
|
106
104
|
left: 50%;
|
|
107
105
|
transform: translate(-50%, -50%);
|
|
106
|
+
color: var(--v-primary-base);
|
|
108
107
|
}
|
|
109
108
|
.paragraph {
|
|
110
|
-
margin:
|
|
109
|
+
margin: 5%;
|
|
111
110
|
}
|
|
112
111
|
</style>
|
|
@@ -1,33 +1,31 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-container>
|
|
3
|
-
<v-card
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
max-height="900"
|
|
8
|
-
min-height="460"
|
|
9
|
-
>
|
|
10
|
-
<card-face :settings="frontFace"></card-face>
|
|
2
|
+
<v-container style="height: 100%" class="div-container">
|
|
3
|
+
<v-card outlined @click="toggleCard" v-show="value" :class="cardClass">
|
|
4
|
+
<v-card-text>
|
|
5
|
+
<card-face :settings="frontFace" side="front"></card-face>
|
|
6
|
+
</v-card-text>
|
|
11
7
|
</v-card>
|
|
12
|
-
<v-card
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
<v-card outlined @click="toggleCard" v-show="!value" :class="cardClass">
|
|
9
|
+
<v-card-title class="card-title">
|
|
10
|
+
<v-row align="center" justify="center">{{
|
|
11
|
+
backFace.header
|
|
12
|
+
}}</v-row>
|
|
13
|
+
</v-card-title>
|
|
14
|
+
<v-card-text>
|
|
15
|
+
<cardFace :settings="backFace" side="back"></cardFace>
|
|
16
|
+
</v-card-text>
|
|
20
17
|
</v-card>
|
|
21
18
|
</v-container>
|
|
22
19
|
</template>
|
|
23
20
|
<script>
|
|
24
21
|
import CardFace from './CardFace'
|
|
22
|
+
import _ from 'lodash'
|
|
25
23
|
export default {
|
|
26
24
|
components: { CardFace },
|
|
27
25
|
data() {
|
|
28
26
|
return {
|
|
29
27
|
settings: {},
|
|
30
|
-
|
|
28
|
+
flip: false,
|
|
31
29
|
}
|
|
32
30
|
},
|
|
33
31
|
props: {
|
|
@@ -37,6 +35,22 @@ export default {
|
|
|
37
35
|
},
|
|
38
36
|
|
|
39
37
|
computed: {
|
|
38
|
+
cardClass() {
|
|
39
|
+
let result = 'animated flashcard'
|
|
40
|
+
if (this.flip) {
|
|
41
|
+
result = result + ' flipInY'
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (this.frontFace.img === '' && this.backFace.img === '') {
|
|
45
|
+
result = result + ' flashcard--size-md'
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (this.frontFace.img !== '' || this.backFace.img !== '') {
|
|
49
|
+
result = result + ' flashcard--size-lg'
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return result
|
|
53
|
+
},
|
|
40
54
|
frontFace() {
|
|
41
55
|
return {
|
|
42
56
|
img:
|
|
@@ -49,7 +63,7 @@ export default {
|
|
|
49
63
|
text: this.options.front.text,
|
|
50
64
|
header: this.options.front.header,
|
|
51
65
|
footer: this.$t(
|
|
52
|
-
'
|
|
66
|
+
'windward.games.components.content.blocks.flashcard.flip_card'
|
|
53
67
|
),
|
|
54
68
|
}
|
|
55
69
|
},
|
|
@@ -65,7 +79,7 @@ export default {
|
|
|
65
79
|
text: this.options.back.text,
|
|
66
80
|
header: this.options.back.header,
|
|
67
81
|
footer: this.$t(
|
|
68
|
-
'
|
|
82
|
+
'windward.games.components.content.blocks.flashcard.flip_card'
|
|
69
83
|
),
|
|
70
84
|
}
|
|
71
85
|
},
|
|
@@ -73,29 +87,96 @@ export default {
|
|
|
73
87
|
methods: {
|
|
74
88
|
toggleCard() {
|
|
75
89
|
//only flip card when user click
|
|
76
|
-
this.
|
|
90
|
+
this.flip = true
|
|
91
|
+
//this.cardClass = 'animated flipInY flashcard flashcard--size-md'
|
|
77
92
|
this.$emit('input', !this.value)
|
|
78
93
|
},
|
|
79
94
|
},
|
|
80
95
|
}
|
|
81
96
|
</script>
|
|
82
|
-
<style scoped>
|
|
97
|
+
<style lang="scss" scoped>
|
|
83
98
|
.center {
|
|
84
99
|
text-align: center;
|
|
85
100
|
}
|
|
86
101
|
|
|
102
|
+
.card-title {
|
|
103
|
+
background-color: var(--v-primary-base);
|
|
104
|
+
color: var(--v-background-base);
|
|
105
|
+
}
|
|
87
106
|
.flashcard {
|
|
88
107
|
cursor: pointer;
|
|
89
|
-
border
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
padding: 25px;
|
|
93
|
-
box-shadow: 0 0px 10px rgba(0, 0, 0, 0.4);
|
|
108
|
+
border: 1px solid;
|
|
109
|
+
border-radius: 8px;
|
|
110
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
|
|
94
111
|
text-align: center;
|
|
95
112
|
}
|
|
113
|
+
.div-container {
|
|
114
|
+
container-type: inline-size;
|
|
115
|
+
}
|
|
116
|
+
@container (width >1168px) {
|
|
117
|
+
.flashcard--size-md {
|
|
118
|
+
min-height: 60%;
|
|
119
|
+
width: 90%;
|
|
120
|
+
top: 20%;
|
|
121
|
+
left: 5%;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.flashcard--size-lg {
|
|
125
|
+
min-height: 90%;
|
|
126
|
+
width: 90%;
|
|
127
|
+
top: 5%;
|
|
128
|
+
left: 5%;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
@container (width < 1168px) {
|
|
132
|
+
.flashcard--size-md {
|
|
133
|
+
min-height: 60%;
|
|
134
|
+
width: 88%;
|
|
135
|
+
top: 20%;
|
|
136
|
+
left: 6%;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.flashcard--size-lg {
|
|
140
|
+
min-height: 90%;
|
|
141
|
+
width: 88%;
|
|
142
|
+
top: 5%;
|
|
143
|
+
left: 6%;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
@container (width < 850px) {
|
|
147
|
+
.flashcard--size-md {
|
|
148
|
+
min-height: 60%;
|
|
149
|
+
width: 84%;
|
|
150
|
+
top: 20%;
|
|
151
|
+
left: 8%;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.flashcard--size-lg {
|
|
155
|
+
min-height: 90%;
|
|
156
|
+
width: 84%;
|
|
157
|
+
top: 5%;
|
|
158
|
+
left: 8%;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
@container (width < 650px) {
|
|
162
|
+
.flashcard--size-md {
|
|
163
|
+
min-height: 90%;
|
|
164
|
+
width: 76%;
|
|
165
|
+
top: 5%;
|
|
166
|
+
left: 12%;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.flashcard--size-lg {
|
|
170
|
+
min-height: 90%;
|
|
171
|
+
width: 76%;
|
|
172
|
+
top: 5%;
|
|
173
|
+
left: 12%;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
96
176
|
|
|
97
177
|
.flashcard:hover {
|
|
98
|
-
box-shadow: 0 0px
|
|
178
|
+
box-shadow: 0 0px 12px rgba(0, 0, 0, 0.8);
|
|
179
|
+
background-color: var(--v-background-darken1);
|
|
99
180
|
}
|
|
100
181
|
|
|
101
182
|
.animated {
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
<br />
|
|
11
11
|
<v-carousel
|
|
12
12
|
v-model="block.metadata.config.currentSlide"
|
|
13
|
-
show-arrows-on-hover
|
|
14
13
|
hide-delimiters
|
|
15
14
|
>
|
|
16
15
|
<template #prev="{ on, attrs }">
|
|
@@ -88,7 +87,7 @@ export default {
|
|
|
88
87
|
this.block.metadata.config = {}
|
|
89
88
|
this.block.metadata.config.currentSlide = 0
|
|
90
89
|
this.block.metadata.config.title = this.$t(
|
|
91
|
-
'
|
|
90
|
+
'windward.games.components.content.blocks.flashcard.title'
|
|
92
91
|
)
|
|
93
92
|
this.block.metadata.config.instructions = ''
|
|
94
93
|
}
|