@mundogamernetwork/shared-ui 1.1.37 → 1.1.39

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.
@@ -1,67 +1,255 @@
1
1
  <script setup lang="ts">
2
+ import { ref, onMounted } from "vue";
2
3
  import { storeToRefs } from "pinia";
3
4
 
4
- definePageMeta({ layout: "default" });
5
+ const locale = useNuxtApp().$i18n.locale;
5
6
 
6
7
  const institutionalStore = useInstitutionalStore();
7
- const { magazine } = storeToRefs(institutionalStore);
8
+ const { magazine, language } = institutionalStore;
8
9
  const authStore = useAuthStore();
9
- const { signedIn } = storeToRefs(authStore);
10
+ const { user, signedIn } = storeToRefs(authStore);
10
11
 
11
- const config = useRuntimeConfig();
12
- const systemId = config.public.mgSharedUi?.systemId || import.meta.env.VITE_SYSTEM_ID;
12
+ interface MagazineItem {
13
+ id: string;
14
+ edition_number: number;
15
+ language: {
16
+ id: string;
17
+ };
18
+ }
19
+
20
+ interface LanguageItem {
21
+ id: string;
22
+ localized_name: string;
23
+ name_abrev?: string;
24
+ }
13
25
 
14
26
  const currentPage = ref(1);
15
- const perPage = 12;
16
- const selectedLanguage = ref("");
27
+ const totalPages = ref(1);
28
+ const itemsPerPage = 12;
29
+ const totalItens = ref(0);
17
30
 
18
- async function fetchMagazines() {
31
+ const languages: Ref<LanguageItem[]> = ref([]);
32
+ const languageId = ref("");
33
+
34
+ const queryParams = {
35
+ filter: {
36
+ status: 1,
37
+ platform_id: import.meta.env.VITE_SYSTEM_ID,
38
+ },
39
+ sort: "id",
40
+ order: "desc",
41
+ per_page: itemsPerPage,
42
+ };
43
+
44
+ const {
45
+ public: { apiBaseURL },
46
+ } = useRuntimeConfig();
47
+
48
+ function formatDate(dateString: string): string {
49
+ const date = new Date(dateString);
50
+ let monthNames;
51
+ const languagePtBr = languages.value
52
+ .filter((language) => language?.name_abrev === "pt-BR")
53
+ .map((language) => language.id);
54
+ if (languageId.value === languagePtBr[0]) {
55
+ monthNames = [
56
+ "Janeiro",
57
+ "Fevereiro",
58
+ "Março",
59
+ "Abril",
60
+ "Maio",
61
+ "Junho",
62
+ "Julho",
63
+ "Agosto",
64
+ "Setembro",
65
+ "Outubro",
66
+ "Novembro",
67
+ "Dezembro",
68
+ ];
69
+ } else {
70
+ monthNames = [
71
+ "January",
72
+ "February",
73
+ "March",
74
+ "April",
75
+ "May",
76
+ "June",
77
+ "July",
78
+ "August",
79
+ "September",
80
+ "October",
81
+ "November",
82
+ "December",
83
+ ];
84
+ }
85
+ const month = monthNames[date.getMonth()];
86
+ const year = date.getFullYear().toString().slice(-2);
87
+ return `${month} ${year}`;
88
+ }
89
+
90
+ async function fetchMagazine() {
19
91
  try {
20
- const params: any = {
21
- filter: {
22
- status: 1,
23
- platform_id: systemId,
24
- },
25
- sort: "created_at",
26
- order: "desc",
27
- per_page: perPage,
92
+ await institutionalStore.fetchLatestMagazine({
93
+ ...queryParams,
28
94
  page: currentPage.value,
29
- };
30
- if (selectedLanguage.value) params.filter.language = selectedLanguage.value;
95
+ });
96
+
97
+ const meta = magazine.data?.meta?.pagination ?? null;
98
+ totalPages.value = meta ? meta.total_pages : 1;
99
+ totalItens.value = meta
100
+ ? meta.total
101
+ : magazine.data && magazine.data.length
102
+ ? magazine.data.length
103
+ : 0;
31
104
 
32
- await institutionalStore.fetchLatestMagazine(params);
33
- } catch {
34
- // silent
105
+ if (magazine.data?.[0]?.language?.id) {
106
+ languageId.value = magazine.data[0].language.id;
107
+ }
108
+ filterLanguages();
109
+ } catch (error) {
110
+ console.error("Error fetching magazine:", error);
35
111
  }
36
112
  }
37
113
 
38
- function loadMore() {
39
- currentPage.value++;
40
- const params: any = {
41
- filter: {
42
- status: 1,
43
- platform_id: systemId,
44
- },
45
- sort: "created_at",
46
- order: "desc",
47
- per_page: perPage,
48
- page: currentPage.value,
49
- };
50
- if (selectedLanguage.value) params.filter.language = selectedLanguage.value;
51
- institutionalStore.fetchMoreLatestMagazine(params);
114
+ async function fetchMoreMagazine() {
115
+ try {
116
+ await institutionalStore.fetchMoreLatestMagazine({
117
+ ...queryParams,
118
+ page: currentPage.value,
119
+ });
120
+
121
+ if (magazine.data?.[0]?.language?.id) {
122
+ languageId.value = magazine.data[0].language.id;
123
+ }
124
+ filterLanguages();
125
+ } catch (error) {
126
+ console.error("Error fetching more magazine:", error);
127
+ }
52
128
  }
53
129
 
54
- function changeLanguage() {
55
- currentPage.value = 1;
56
- fetchMagazines();
130
+ function handleItemClick(magazineId: string) {
131
+ const clickedMagazine = magazine.data.find(
132
+ (item: MagazineItem) => item.id === magazineId,
133
+ );
134
+ if (clickedMagazine) {
135
+ const clickedIndex = magazine.data.findIndex(
136
+ (item: MagazineItem) => item.id === magazineId,
137
+ );
138
+ magazine.data.splice(clickedIndex, 1);
139
+ magazine.data.unshift(clickedMagazine);
140
+
141
+ languageId.value = clickedMagazine.language.id;
142
+ filterLanguages();
143
+ }
144
+ }
145
+
146
+ function fetchMore() {
147
+ if (currentPage.value < totalPages.value) {
148
+ currentPage.value++;
149
+ fetchMoreMagazine();
150
+ }
151
+ }
152
+
153
+ async function fetchLanguage() {
154
+ try {
155
+ await institutionalStore.fetchLanguage({});
156
+ } catch (error) {
157
+ console.error("Error fetching languiages:", error);
158
+ }
57
159
  }
58
160
 
59
- onMounted(() => {
60
- fetchMagazines();
61
- institutionalStore.fetchLanguage({ per_page: "all" });
161
+ function filterLanguages() {
162
+ if (magazine.data && magazine.data.length > 0) {
163
+ const firstMagazine = magazine.data[0];
164
+ languageId.value = firstMagazine.language.id;
165
+ const editionNumber = firstMagazine.edition_number;
166
+ const languageIds = magazine.data
167
+ .filter((item: MagazineItem) => item.edition_number === editionNumber)
168
+ .map((item: MagazineItem) => item.language.id);
169
+ languages.value = language.data.filter((language: LanguageItem) =>
170
+ languageIds.includes(language.id),
171
+ );
172
+ }
173
+ }
174
+
175
+ useSeoMeta({
176
+ title: "MGN Magazine",
177
+ description:
178
+ "Discover, be inspired and connect in the magazine that breathes digital gaming. Welcome to your new source of gamer passion!",
179
+ ogTitle: "MGN Magazine",
180
+ ogDescription:
181
+ "Discover, be inspired and connect in the magazine that breathes digital gaming. Welcome to your new source of gamer passion!",
182
+ ogImage: "/imgs/seo-magazine-image.jpg",
183
+ ogUrl: "/magazine",
184
+ twitterTitle: "MGN Magazine",
185
+ twitterDescription:
186
+ "Discover, be inspired and connect in the magazine that breathes digital gaming. Welcome to your new source of gamer passion!",
187
+ twitterImage: "/imgs/seo-magazine-image.jpg",
188
+ twitterCard: "summary",
62
189
  });
63
190
 
64
- const locale = useNuxtApp().$i18n.locale;
191
+ watch(languageId, (newValue) => {
192
+ if (!Array.isArray(magazine.data) || magazine.data.length === 0) return;
193
+
194
+ const selectedEditionNumber = magazine.data[0].edition_number;
195
+ const newMagazine = magazine.data.find(
196
+ (item: MagazineItem) =>
197
+ item.language.id === newValue &&
198
+ item.edition_number === selectedEditionNumber,
199
+ );
200
+ if (newMagazine) {
201
+ handleItemClick(newMagazine.id);
202
+ languageId.value = newMagazine.language.id;
203
+ }
204
+ filterLanguages();
205
+ });
206
+
207
+ function downloadPdf() {
208
+ if (magazine.data[0]?.pdf_url_src) {
209
+ window.open(magazine.data[0]?.pdf_url_src, "_blank");
210
+ }
211
+ }
212
+
213
+ const isSmallScreen = ref(false);
214
+
215
+ const updateScreenSize = () => {
216
+ isSmallScreen.value = window.innerWidth <= 768;
217
+ };
218
+
219
+ onMounted(async () => {
220
+ updateScreenSize();
221
+ window.addEventListener("resize", updateScreenSize);
222
+ await fetchLanguage();
223
+ await fetchMagazine();
224
+ });
225
+
226
+ onBeforeUnmount(() => {
227
+ window.removeEventListener("resize", updateScreenSize);
228
+ });
229
+
230
+ const runtimeConfig = useRuntimeConfig();
231
+
232
+ const accountsRegisterUrl = computed(() => {
233
+ if (process.client) {
234
+ const base_url = runtimeConfig.public.accountsBaseUrl;
235
+ const current = window.location.href;
236
+
237
+ return `${base_url}/register?redirect_to=${encodeURIComponent(current)}&system_id=${runtimeConfig.public.platformId}`;
238
+ }
239
+ });
240
+
241
+ const uniqueEditions = computed(() => {
242
+ if (!magazine.data || magazine.data.length === 0) {
243
+ return [];
244
+ }
245
+
246
+ const editionsSet = new Set();
247
+ for (const item of magazine.data) {
248
+ editionsSet.add(item.edition_number);
249
+ }
250
+
251
+ return [...editionsSet];
252
+ });
65
253
  </script>
66
254
 
67
255
  <template>
@@ -75,64 +263,468 @@ const locale = useNuxtApp().$i18n.locale;
75
263
  </div>
76
264
  <div class="container">
77
265
  <div class="row">
78
- <div class="col-8 offset-2">
79
- <div class="filters">
80
- <select v-model="selectedLanguage" @change="changeLanguage">
81
- <option value="">{{ $t("more.magazine.all_languages") }}</option>
82
- <option
83
- v-for="lang in institutionalStore.language.data"
84
- :key="lang.id"
85
- :value="lang.slug"
86
- >
87
- {{ lang.name }}
88
- </option>
89
- </select>
90
- </div>
91
-
92
- <div v-if="magazine.status === 'pending' && (!magazine.data || magazine.data.length === 0)" class="loading">
93
- <p>{{ $t("components.loading") }}</p>
266
+ <div class="col-12">
267
+ <div class="text-page">
268
+ {{ $t("more.magazine.text_1") }}
94
269
  </div>
95
270
 
96
- <div v-else-if="magazine.data && magazine.data.length > 0">
97
- <div class="magazine-grid">
98
- <div
99
- v-for="item in magazine.data"
100
- :key="item.id"
101
- class="magazine-card"
102
- >
103
- <NuxtLink :to="`/${locale}/magazine/${item.slug}`" class="magazine-card__link">
104
- <div class="magazine-card__cover">
271
+ <div v-if="magazine.data.length > 0">
272
+ <div v-if="magazine && magazine.data">
273
+ <div class="magazine-card first-item">
274
+ <div
275
+ class="infos d-flex flex-row w-100"
276
+ v-if="!isSmallScreen"
277
+ >
278
+ <div
279
+ v-if="magazine.data[0]?.premium === true"
280
+ class="premium-card col-auto"
281
+ >
282
+ <div class="premium">
283
+ <svg
284
+ xmlns="http://www.w3.org/2000/svg"
285
+ width="56"
286
+ height="57"
287
+ viewBox="0 0 56 57"
288
+ fill="none"
289
+ >
290
+ <path
291
+ d="M38.3133 42.3287H16.8933V44.9421H38.3133V42.3287Z"
292
+ fill="var(--text-magazine)"
293
+ />
294
+ <path
295
+ d="M35.7 26.2754L27.6033 12.2754L19.5066 26.2521L9.33331 23.6854L15.0966 39.7154H40.0633L46.6666 23.8487L35.7 26.2754Z"
296
+ fill="var(--text-magazine)"
297
+ />
298
+ </svg>
299
+ {{ $t("more.magazine.text_6") }}
300
+ </div>
301
+ <NuxtLink
302
+ :to="`/${locale}/magazine/${magazine.data[0]?.slug}`"
303
+ >
304
+ <img
305
+ :src="
306
+ magazine.data[0]?.cover_url_src ||
307
+ '/imgs/no-cover-img.jpg'
308
+ "
309
+ />
310
+ </NuxtLink>
311
+ </div>
312
+ <NuxtLink
313
+ :to="`/${locale}/magazine/${magazine.data[0]?.slug}`"
314
+ >
315
+ <img
316
+ v-if="magazine.data[0]?.premium === false"
317
+ :src="
318
+ magazine.data[0]?.cover_url_src ||
319
+ '/imgs/no-cover-img.jpg'
320
+ "
321
+ />
322
+ </NuxtLink>
323
+ <div class="col-6">
324
+ <NuxtLink
325
+ :to="`/${locale}/magazine/${magazine.data[0]?.slug}`"
326
+ :class="'title'"
327
+ >
328
+ <div class="title">
329
+ {{ magazine.data[0]?.name }}
330
+ </div>
331
+ </NuxtLink>
332
+ <div class="sub-infos">
333
+ <div class="edition">
334
+ {{ $t("more.magazine.edition") }} #{{
335
+ magazine.data[0]?.edition_number
336
+ }}
337
+ </div>
338
+ <div class="data">
339
+ {{ formatDate(magazine.data[0]?.release_date) }}
340
+ </div>
341
+ </div>
342
+ <div class="description">
343
+ {{ magazine.data[0]?.short_description }}
344
+ </div>
345
+ <NuxtLink
346
+ :to="`/${locale}/magazine/${magazine.data[0]?.slug}`"
347
+ >
348
+ <button class="btn more">
349
+ {{ $t("more.magazine.btn_1") }} >
350
+ </button>
351
+ </NuxtLink>
352
+ <div
353
+ v-if="
354
+ magazine.data[0]?.public === false &&
355
+ magazine.data[0]?.premium === false &&
356
+ signedIn === false
357
+ "
358
+ class="signin action-block"
359
+ >
360
+ {{ $t("more.magazine.text_2") }}
361
+ <div class="download">
362
+ <select v-model="languageId" class="select">
363
+ <option :key="'none'" :value="'none'">
364
+ {{ $t("more.magazine.text_3") }}
365
+ </option>
366
+ <option
367
+ v-for="language in languages"
368
+ :key="language.id"
369
+ :value="language.id"
370
+ >
371
+ {{ language.localized_name }}
372
+ </option>
373
+ </select>
374
+ <ClientOnly>
375
+ <a class="btn primary" :href="accountsRegisterUrl">
376
+ {{ $t("more.magazine.btn_4") }}
377
+ </a>
378
+ </ClientOnly>
379
+ </div>
380
+ </div>
381
+ <div
382
+ v-else-if="
383
+ magazine.data[0]?.premium === true &&
384
+ magazine.data[0]?.public === false &&
385
+ signedIn === false
386
+ "
387
+ class="download signin py-4 d-flex action-block premium"
388
+ >
389
+ {{ $t("more.magazine.text_4") }}
390
+ <div class="d-flex flex-row">
391
+ <select v-model="languageId" class="select">
392
+ <option :key="'none'" :value="'none'">
393
+ {{ $t("more.magazine.text_3") }}
394
+ </option>
395
+ <option
396
+ v-for="language in languages"
397
+ :key="language.id"
398
+ :value="language.id"
399
+ >
400
+ {{ language.localized_name }}
401
+ </option>
402
+ </select>
403
+ <button
404
+ class="btn primary"
405
+ :href="accountsRegisterUrl"
406
+ >
407
+ {{ $t("more.magazine.btn_5") }}
408
+ </button>
409
+ </div>
410
+ </div>
411
+ <div v-else class="download action-block flex-row py-4">
412
+ <select v-model="languageId" class="select">
413
+ <option :key="'none'" :value="'none'">
414
+ {{ $t("more.magazine.text_3") }}
415
+ </option>
416
+ <option
417
+ v-for="language in languages"
418
+ :key="language.id"
419
+ :value="language.id"
420
+ >
421
+ {{ language.localized_name }}
422
+ </option>
423
+ </select>
424
+ <a class="btn primary" @click="downloadPdf()">
425
+ {{ $t("more.magazine.btn_2") }}
426
+ </a>
427
+ </div>
428
+ </div>
429
+ </div>
430
+ <div class="infos" v-if="isSmallScreen">
431
+ <div
432
+ v-if="magazine.data[0]?.premium === true"
433
+ class="premium-card"
434
+ >
435
+ <div class="premium">
436
+ <svg
437
+ xmlns="http://www.w3.org/2000/svg"
438
+ width="56"
439
+ height="57"
440
+ viewBox="0 0 56 57"
441
+ fill="none"
442
+ >
443
+ <path
444
+ d="M38.3133 42.3287H16.8933V44.9421H38.3133V42.3287Z"
445
+ fill="var(--text-magazine)"
446
+ />
447
+ <path
448
+ d="M35.7 26.2754L27.6033 12.2754L19.5066 26.2521L9.33331 23.6854L15.0966 39.7154H40.0633L46.6666 23.8487L35.7 26.2754Z"
449
+ fill="var(--text-magazine)"
450
+ />
451
+ </svg>
452
+ {{ $t("more.magazine.text_6") }}
453
+ </div>
454
+ <NuxtLink
455
+ :to="`/${locale}/magazine/${magazine.data[0]?.slug}`"
456
+ >
457
+ <img
458
+ :src="
459
+ magazine.data[0]?.cover_url_src ||
460
+ '/imgs/no-cover-img.jpg'
461
+ "
462
+ />
463
+ </NuxtLink>
464
+ </div>
465
+ <NuxtLink
466
+ :to="`/${locale}/magazine/${magazine.data[0]?.slug}`"
467
+ :class="'title'"
468
+ >
469
+ <div class="title">
470
+ {{ magazine.data[0]?.name }}
471
+ </div>
472
+ </NuxtLink>
473
+ <div class="sub-infos">
474
+ <div class="edition">
475
+ {{ $t("more.magazine.edition") }} #{{
476
+ magazine.data[0]?.edition_number
477
+ }}
478
+ </div>
479
+ <div class="data">
480
+ {{ formatDate(magazine.data[0]?.release_date) }}
481
+ </div>
482
+ </div>
483
+ <NuxtLink
484
+ :to="`/${locale}/magazine/${magazine.data[0]?.slug}`"
485
+ >
105
486
  <img
106
- :src="item.cover_image_url || '/imgs/default.jpg'"
107
- :alt="item.title"
487
+ v-if="magazine.data[0]?.premium === false"
488
+ :src="
489
+ magazine.data[0]?.cover_url_src ||
490
+ '/imgs/no-cover-img.jpg'
491
+ "
108
492
  />
109
- <span v-if="item.is_premium" class="premium-badge">Premium</span>
493
+ </NuxtLink>
494
+
495
+ <div class="description">
496
+ {{ magazine.data[0]?.short_description }}
497
+ </div>
498
+
499
+ <NuxtLink
500
+ :to="`/${locale}/magazine/${magazine.data[0]?.slug}`"
501
+ >
502
+ <button class="btn more">
503
+ {{ $t("more.magazine.btn_1") }} >
504
+ </button>
505
+ </NuxtLink>
506
+ <div
507
+ v-if="
508
+ magazine.data[0]?.public === false &&
509
+ magazine.data[0]?.premium === false
510
+ "
511
+ class="signin action-block"
512
+ >
513
+ {{ $t("more.magazine.text_2") }}
514
+ <div class="download action-block">
515
+ <select v-model="languageId" class="select">
516
+ <option :key="'none'" :value="'none'">
517
+ {{ $t("more.magazine.text_3") }}
518
+ </option>
519
+ <option
520
+ v-for="language in languages"
521
+ :key="language.id"
522
+ :value="language.id"
523
+ >
524
+ {{ language.localized_name }}
525
+ </option>
526
+ </select>
527
+ <ClientOnly>
528
+ <a class="btn primary" :href="accountsRegisterUrl">
529
+ {{ $t("more.magazine.btn_4") }}
530
+ </a>
531
+ </ClientOnly>
532
+ </div>
110
533
  </div>
111
- <div class="magazine-card__info">
112
- <h3>{{ item.title }}</h3>
113
- <span class="edition" v-if="item.edition_number">
114
- {{ $t("more.magazine.edition") }} #{{ item.edition_number }}
115
- </span>
116
- <span class="date">{{ item.release_date || item.created_at }}</span>
534
+ <div
535
+ v-else-if="
536
+ magazine.data[0]?.premium === true &&
537
+ magazine.data[0]?.public === false
538
+ "
539
+ class="download signin py-4 d-flex action-block"
540
+ >
541
+ {{ $t("more.magazine.text_4") }}
542
+ <div class="d-flex flex-row">
543
+ <select v-model="languageId" class="select">
544
+ <option :key="'none'" :value="'none'">
545
+ {{ $t("more.magazine.text_3") }}
546
+ </option>
547
+ <option
548
+ v-for="language in languages"
549
+ :key="language.id"
550
+ :value="language.id"
551
+ >
552
+ {{ language.localized_name }}
553
+ </option>
554
+ </select>
555
+ <button class="btn primary" :href="accountsRegisterUrl">
556
+ {{ $t("more.magazine.btn_5") }}
557
+ </button>
558
+ </div>
117
559
  </div>
118
- </NuxtLink>
560
+ <div v-else class="download flex-row py-4 action-block">
561
+ <select v-model="languageId" class="select">
562
+ <option :key="'none'" :value="'none'">
563
+ {{ $t("more.magazine.text_3") }}
564
+ </option>
565
+ <option
566
+ v-for="language in languages"
567
+ :key="language.id"
568
+ :value="language.id"
569
+ >
570
+ {{ language.localized_name }}
571
+ </option>
572
+ </select>
573
+ <a class="btn primary" @click="downloadPdf()">
574
+ {{ $t("more.magazine.btn_2") }}
575
+ </a>
576
+ </div>
577
+ </div>
119
578
  </div>
120
- </div>
579
+ <div
580
+ v-if="
581
+ Array.isArray(magazine.data) && magazine.data.length > 0
582
+ "
583
+ class="content-magazine"
584
+ >
585
+ <template v-for="edition in uniqueEditions">
586
+ <div
587
+ v-if="
588
+ magazine.data.find(
589
+ (item) =>
590
+ item.edition_number === edition &&
591
+ item.language_id === languageId,
592
+ )
593
+ "
594
+ >
595
+ <div
596
+ class="magazine-card"
597
+ @click="
598
+ handleItemClick(
599
+ magazine.data.find(
600
+ (item) =>
601
+ item.edition_number === edition &&
602
+ item.language_id === languageId,
603
+ ).id,
604
+ )
605
+ "
606
+ >
607
+ <div class="infos">
608
+ <template
609
+ v-if="
610
+ magazine.data.find(
611
+ (item) =>
612
+ item.edition_number === edition &&
613
+ item.language_id === languageId,
614
+ ).premium === true
615
+ "
616
+ >
617
+ <div class="premium-card">
618
+ <div class="premium">
619
+ <svg
620
+ xmlns="http://www.w3.org/2000/svg"
621
+ width="56"
622
+ height="57"
623
+ viewBox="0 0 56 57"
624
+ fill="none"
625
+ >
626
+ <path
627
+ d="M38.3133 42.3287H16.8933V44.9421H38.3133V42.3287Z"
628
+ fill="var(--text-magazine)"
629
+ />
630
+ <path
631
+ d="M35.7 26.2754L27.6033 12.2754L19.5066 26.2521L9.33331 23.6854L15.0966 39.7154H40.0633L46.6666 23.8487L35.7 26.2754Z"
632
+ fill="var(--text-magazine)"
633
+ />
634
+ </svg>
635
+ {{ $t("more.magazine.text_6") }}
636
+ </div>
637
+ <img
638
+ :src="
639
+ magazine.data.find(
640
+ (item) =>
641
+ item.edition_number === edition &&
642
+ item.language_id === languageId,
643
+ ).cover_url_src || '/imgs/no-cover-img.jpg'
644
+ "
645
+ />
646
+ </div>
647
+ </template>
121
648
 
122
- <div
123
- v-if="magazine.data.meta && magazine.data.length < magazine.data.meta.total"
124
- class="load-more"
125
- >
126
- <button @click="loadMore" :disabled="magazine.status === 'pending'">
127
- {{ $t("components.load_more") }}
128
- </button>
649
+ <template v-else>
650
+ <img
651
+ :src="
652
+ magazine.data.find(
653
+ (item) =>
654
+ item.edition_number === edition &&
655
+ item.language_id === languageId,
656
+ ).cover_url_src || '/imgs/no-cover-img.jpg'
657
+ "
658
+ />
659
+ </template>
660
+ <div class="sub-infos">
661
+ <div class="edition">
662
+ {{ $t("more.magazine.edition") }} #{{
663
+ magazine.data.find(
664
+ (item) =>
665
+ item.edition_number === edition &&
666
+ item.language_id === languageId,
667
+ ).edition_number
668
+ }}
669
+ </div>
670
+ <div class="data">
671
+ {{
672
+ formatDate(
673
+ magazine.data.find(
674
+ (item) =>
675
+ item.edition_number === edition &&
676
+ item.language_id === languageId,
677
+ ).release_date,
678
+ )
679
+ }}
680
+ </div>
681
+ </div>
682
+ </div>
683
+ </div>
684
+ </div>
685
+ </template>
686
+ </div>
687
+
688
+ <div
689
+ v-if="
690
+ currentPage < totalPages || magazine.status === 'pending'
691
+ "
692
+ class="d-flex justify-content-center mt-4"
693
+ >
694
+ <button
695
+ v-for="page in totalPages"
696
+ :key="page"
697
+ :class="{
698
+ btn: true,
699
+ secondary: currentPage !== page,
700
+ primary: currentPage === page,
701
+ }"
702
+ @click.prevent="currentPage = page"
703
+ >
704
+ {{ page }}
705
+ </button>
706
+ </div>
129
707
  </div>
130
708
  </div>
131
709
 
132
- <div v-else class="no-data">
710
+ <div
711
+ v-else-if="magazine.status && magazine.status !== 'success'"
712
+ class="container-skelecton"
713
+ >
714
+ <MagazineSkelectonLoading v-for="n in 1" :key="n" />
715
+ </div>
716
+
717
+ <div v-else class="container-skelecton">
718
+ <br />
133
719
  {{ $t("more.magazine.no_data") }}
134
720
  </div>
135
721
  </div>
722
+
723
+ <NewsletterFullWidthComponent />
724
+
725
+ <!-- <div class="col-12">
726
+ <AdSenseComponent :ad-width-responsive="true" />
727
+ </div> -->
136
728
  </div>
137
729
  </div>
138
730
  </section>
@@ -144,12 +736,19 @@ const locale = useNuxtApp().$i18n.locale;
144
736
  color: var(--inactive);
145
737
  font-size: 0.875rem;
146
738
 
739
+ &-container-skelecton {
740
+ display: flex;
741
+ flex-direction: column;
742
+ row-gap: 16px;
743
+ }
744
+
147
745
  .header {
148
746
  position: relative;
149
747
  height: 200px;
150
748
  display: flex;
151
749
  justify-content: center;
152
750
  align-items: center;
751
+ font-size: 0.875rem;
153
752
  margin-bottom: 2rem;
154
753
 
155
754
  & > div {
@@ -161,7 +760,8 @@ const locale = useNuxtApp().$i18n.locale;
161
760
  content: " ";
162
761
  display: block;
163
762
  position: absolute;
164
- background: url("@/assets/images/bg-magazine.png") no-repeat center center / cover;
763
+ background: url("@/assets/images/bg-magazine.png") no-repeat center center /
764
+ cover;
165
765
  width: 100%;
166
766
  height: 100%;
167
767
  top: 50%;
@@ -170,98 +770,382 @@ const locale = useNuxtApp().$i18n.locale;
170
770
  }
171
771
  }
172
772
 
173
- .filters {
174
- margin-bottom: 24px;
175
-
176
- select {
177
- height: 40px;
178
- padding: 0 12px;
179
- border: 1px solid var(--search-bar-border-color);
180
- background: var(--search-bar-bg);
181
- color: var(--search-bar-fg);
182
- font-size: 14px;
183
- min-width: 200px;
184
- }
773
+ .text-page {
774
+ font-family: Roboto;
775
+ font-size: 14px;
776
+ font-style: normal;
777
+ font-weight: 400;
778
+ color: var(--text-magazine);
779
+ line-height: 20px;
185
780
  }
186
781
 
187
- .magazine-grid {
188
- display: grid;
189
- grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
190
- gap: 24px;
191
- }
782
+ .first-item {
783
+ display: flex;
784
+ padding: 2rem 0;
785
+ align-items: center;
786
+ gap: 32px;
787
+ align-self: stretch;
788
+ border-bottom: 2px solid #ee3831;
789
+ margin-bottom: 40px;
192
790
 
193
- .magazine-card {
194
- &__link {
195
- text-decoration: none;
196
- color: inherit;
197
- }
791
+ .infos {
792
+ display: flex;
793
+ gap: 32px;
794
+
795
+ .premium-card {
796
+ position: relative;
797
+ margin-right: -32px;
198
798
 
199
- &__cover {
200
- position: relative;
201
- margin-bottom: 8px;
799
+ .premium {
800
+ display: flex;
801
+ width: 270px;
802
+ height: 350px;
803
+ padding: 16px;
804
+ flex-direction: column;
805
+ justify-content: center;
806
+ align-items: center;
807
+ background: rgba(19, 22, 28, 0.5);
808
+ backdrop-filter: blur(2px);
809
+ position: absolute;
810
+ color: var(--text-magazine);
811
+ text-align: center;
812
+ font-family: Roboto;
813
+ font-size: 18px;
814
+ font-style: normal;
815
+ font-weight: 600;
816
+ line-height: 26px;
817
+
818
+ img {
819
+ width: 100%;
820
+ height: auto;
821
+ position: relative;
822
+ }
823
+ }
824
+ }
202
825
 
203
826
  img {
204
- width: 100%;
205
- aspect-ratio: 3/4;
206
- object-fit: cover;
827
+ width: 270px;
828
+ height: 350px;
207
829
  }
208
830
 
209
- .premium-badge {
210
- position: absolute;
211
- top: 8px;
212
- right: 8px;
213
- padding: 2px 8px;
214
- background: var(--chip-text);
215
- color: var(--chip-background-2);
216
- font-size: 11px;
831
+ .title {
832
+ font-family: Roboto;
833
+ font-size: 18px;
834
+ font-style: normal;
217
835
  font-weight: 600;
836
+ line-height: 26px;
837
+ color: var(--text-magazine);
218
838
  }
219
- }
220
839
 
221
- &__info {
222
- h3 {
840
+ .sub-infos {
841
+ display: flex;
842
+ align-items: center;
843
+ gap: 24px;
844
+ align-self: stretch;
845
+ margin-top: 24px;
846
+
847
+ .edition {
848
+ color: var(--text-magazine);
849
+ font-family: Roboto;
850
+ font-size: 14px;
851
+ font-style: normal;
852
+ font-weight: 400;
853
+ line-height: 20px;
854
+ }
855
+
856
+ .data {
857
+ font-family: Roboto;
858
+ font-size: 14px;
859
+ font-style: normal;
860
+ font-weight: 400;
861
+ line-height: 20px;
862
+ color: var(--text-magazine);
863
+ text-transform: uppercase;
864
+ }
865
+ }
866
+
867
+ .description {
868
+ font-family: Roboto;
223
869
  font-size: 14px;
224
- font-weight: 600;
225
- color: var(--card-cover-title);
226
- margin-bottom: 4px;
870
+ font-style: normal;
871
+ font-weight: 400;
872
+ color: var(--text-magazine);
873
+ margin-top: 24px;
874
+ margin-bottom: 24px;
875
+ line-height: 20px;
227
876
  }
228
877
 
229
- .edition {
230
- display: block;
878
+ .more {
879
+ display: flex;
880
+ height: 32px;
881
+ padding: 0px 12px;
882
+ flex-direction: column;
883
+ justify-content: center;
884
+ align-items: center;
885
+ background-color: var(--news-card-bg);
886
+ color: #ee3831;
887
+ font-family: Roboto;
231
888
  font-size: 12px;
232
- color: var(--chip-text);
233
- margin-bottom: 2px;
889
+ font-style: normal;
890
+ font-weight: 400;
891
+ line-height: 16px;
234
892
  }
235
893
 
236
- .date {
237
- font-size: 12px;
238
- color: var(--secondary-info-fg);
894
+ .signin {
895
+ display: flex;
896
+ padding: 8px 16px;
897
+ flex-direction: column;
898
+ align-items: flex-start;
899
+ gap: 16px;
900
+ max-width: 618px;
901
+ width: 100%;
902
+ align-self: stretch;
903
+ margin-top: 24px;
904
+ background-color: var(--news-card-bg);
905
+ color: var(--text-magazine);
906
+ font-family: Roboto;
907
+ font-size: 14px;
908
+ font-style: normal;
909
+ font-weight: 400;
910
+ line-height: 20px;
911
+
912
+ .btn {
913
+ display: flex;
914
+ width: 220px;
915
+ height: 44px;
916
+ padding: 0px 12px;
917
+ justify-content: center;
918
+ font-family: Roboto;
919
+ font-size: 16px;
920
+ font-style: normal;
921
+ font-weight: 400;
922
+ line-height: 24px;
923
+ align-items: center;
924
+ }
925
+ }
926
+
927
+ .download {
928
+ //margin-top: 24px;
929
+ width: 100%;
930
+ display: flex;
931
+ //gap: 24px;
932
+
933
+ .select {
934
+ border-style: solid;
935
+ background: transparent;
936
+ border-width: 0px 0px 1px 0px;
937
+ padding: 10px 12px;
938
+ display: flex;
939
+ flex-direction: row;
940
+ max-width: 224px;
941
+ align-items: center;
942
+ justify-content: flex-start;
943
+ align-self: stretch;
944
+ flex-shrink: 0;
945
+ margin-right: 16px;
946
+ color: var(--darkcommunity-content-text-inactive, #aaaaaa);
947
+ text-align: left;
948
+ font: var(--body-1, 400 16px/24px "Roboto", sans-serif);
949
+ position: relative;
950
+ flex: 1;
951
+ transition: 0.15s ease-in-out;
952
+
953
+ &:last-child {
954
+ margin-right: 0px;
955
+ }
956
+
957
+ &:focus,
958
+ &:focus-visible,
959
+ &:active {
960
+ transition: 0.15s ease-in-out;
961
+ border: 2px solid var(--search-bar-active-border-color);
962
+ }
963
+
964
+ option {
965
+ background: var(--search-bar-bg);
966
+ padding: 0px 16px;
967
+ gap: 16px;
968
+ align-items: center;
969
+ justify-content: flex-start;
970
+ height: 48px !important;
971
+ position: relative;
972
+ color: var(--active) !important;
973
+ text-align: left;
974
+ font: var(--body-1, 400 16px/24px "Roboto", sans-serif) !important;
975
+ }
976
+ }
977
+
978
+ .btn {
979
+ display: flex;
980
+ width: 220px;
981
+ height: 44px;
982
+ padding: 0px 12px;
983
+ justify-content: center;
984
+ font-family: Roboto;
985
+ font-size: 16px;
986
+ font-style: normal;
987
+ font-weight: 400;
988
+ line-height: 24px;
989
+ align-items: center;
990
+ }
991
+ }
992
+ }
993
+ }
994
+
995
+ .content-magazine {
996
+ display: flex;
997
+ align-items: flex-start;
998
+ align-content: flex-start;
999
+ gap: 40px 32px;
1000
+ align-self: stretch;
1001
+ flex-wrap: wrap;
1002
+
1003
+ .magazine-card:not(.first-item) {
1004
+ display: flex;
1005
+ flex-direction: row;
1006
+ align-items: flex-start;
1007
+ gap: 32px;
1008
+
1009
+ .infos {
1010
+ flex: 1;
1011
+ gap: 12px;
1012
+
1013
+ .premium-card {
1014
+ position: relative;
1015
+
1016
+ .premium {
1017
+ display: flex;
1018
+ width: 222px;
1019
+ height: 287px;
1020
+ padding: 16px;
1021
+ flex-direction: column;
1022
+ justify-content: center;
1023
+ align-items: center;
1024
+ background: rgba(19, 22, 28, 0.5);
1025
+ backdrop-filter: blur(2px);
1026
+ position: absolute;
1027
+ color: var(--text-magazine);
1028
+ text-align: center;
1029
+ font-family: Roboto;
1030
+ font-size: 18px;
1031
+ font-style: normal;
1032
+ font-weight: 600;
1033
+ line-height: 26px;
1034
+
1035
+ img {
1036
+ width: 100%;
1037
+ height: auto;
1038
+ position: relative;
1039
+ }
1040
+ }
1041
+ }
1042
+
1043
+ img {
1044
+ width: 222px;
1045
+ height: 287px;
1046
+ }
1047
+
1048
+ .sub-infos {
1049
+ display: block;
1050
+ align-items: center;
1051
+ gap: 12px;
1052
+ align-self: stretch;
1053
+ margin-top: 12px;
1054
+
1055
+ .edition {
1056
+ color: var(--text-magazine);
1057
+ font-family: Roboto;
1058
+ font-size: 14px;
1059
+ font-style: normal;
1060
+ font-weight: 400;
1061
+ line-height: 20px;
1062
+ }
1063
+
1064
+ .data {
1065
+ font-family: Roboto;
1066
+ font-size: 14px;
1067
+ font-style: normal;
1068
+ font-weight: 400;
1069
+ line-height: 20px;
1070
+ color: var(--text-magazine);
1071
+ text-transform: uppercase;
1072
+ margin-bottom: 8px;
1073
+ }
1074
+ }
1075
+ }
1076
+
1077
+ &:hover {
1078
+ border-bottom: 2px solid #ee3831;
239
1079
  }
240
1080
  }
241
1081
  }
1082
+ }
1083
+
1084
+ @media only screen and (max-width: 768px) {
1085
+ .first-item {
1086
+ display: flex;
1087
+ flex-direction: column;
1088
+
1089
+ .infos {
1090
+ display: flex;
1091
+ flex-direction: column;
1092
+ justify-content: center;
1093
+ align-items: center;
1094
+ gap: 10px !important;
1095
+
1096
+ .sub-infos {
1097
+ display: flex;
1098
+ flex-direction: column;
1099
+ justify-content: center;
1100
+ align-items: center;
1101
+ gap: 12px !important;
1102
+ align-self: stretch;
1103
+ margin: 12px 0 !important;
1104
+ }
1105
+
1106
+ .description {
1107
+ text-align: center;
1108
+ display: flex;
1109
+ width: 100vw !important;
1110
+ padding: 0 1.5rem;
1111
+ margin: 0.5rem 0 !important;
1112
+ }
242
1113
 
243
- .load-more {
244
- text-align: center;
245
- margin-top: 24px;
1114
+ .action-block {
1115
+ width: 90% !important;
1116
+ margin: 1rem auto;
1117
+ }
1118
+ }
1119
+ }
1120
+ .content-magazine {
1121
+ display: flex;
1122
+ flex-direction: column;
1123
+ justify-content: center;
1124
+ align-content: center !important;
246
1125
 
247
- button {
248
- padding: 8px 24px;
249
- border: 1px solid var(--chip-text);
250
- background: transparent;
251
- color: var(--chip-text);
252
- cursor: pointer;
253
- font-size: 14px;
1126
+ .magazine-card {
1127
+ flex-direction: column;
1128
+ justify-content: center;
254
1129
 
255
- &:disabled {
256
- opacity: 0.5;
1130
+ .sub-infos {
1131
+ display: flex;
1132
+ flex-direction: column;
1133
+ text-align: center;
257
1134
  }
258
1135
  }
259
1136
  }
1137
+ }
1138
+
1139
+ @media only screen and (max-width: 992px) {
1140
+ .action-block {
1141
+ .select {
1142
+ width: 10%;
1143
+ }
260
1144
 
261
- .no-data {
262
- text-align: center;
263
- padding: 32px;
264
- color: var(--secondary-info-fg);
1145
+ .btn {
1146
+ width: 50% !important;
1147
+ padding: 0;
1148
+ }
265
1149
  }
266
1150
  }
267
1151
  </style>