@paris-ias/list 1.0.180 → 1.0.182

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.
@@ -0,0 +1,350 @@
1
+ <template>
2
+ <v-overlay
3
+ :model-value="active"
4
+ scrim="white"
5
+ class="align-center justify-center loader-overlay"
6
+ :class="{ 'loader-overlay--inactive': !active }"
7
+ >
8
+ <div
9
+ v-motion
10
+ :initial="{ scale: 0.8, opacity: 0 }"
11
+ :enter="{
12
+ scale: 1,
13
+ opacity: 1,
14
+ transition: { duration: 800, ease: 'easeOut' },
15
+ }"
16
+ :leave="{ scale: 0.9, opacity: 0, transition: { duration: 400 } }"
17
+ class="logo-container"
18
+ >
19
+ <ListAtomsLogoPlaceholder class="loader-logo" :class="{ 'loader-logo--active': active }" />
20
+ </div>
21
+ </v-overlay>
22
+ </template>
23
+
24
+ <script setup lang="ts">
25
+ defineProps<{
26
+ active: boolean
27
+ }>()
28
+ </script>
29
+
30
+ <style scoped>
31
+ .loader-overlay {
32
+ background: rgb(255, 255, 255) !important;
33
+ backdrop-filter: blur(3px);
34
+ transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
35
+ height: calc(100vh - 5px) !important;
36
+ top: 5px !important;
37
+ }
38
+
39
+ .loader-overlay--inactive {
40
+ opacity: 0;
41
+ transform: scale(0.95);
42
+ }
43
+ .loader-overlay--inactive .logo-container {
44
+ transform: scale(0.9);
45
+ opacity: 0;
46
+ transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
47
+ }
48
+
49
+ .loader-logo {
50
+ filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
51
+ max-width: 350px;
52
+ height: auto;
53
+ width: 280px;
54
+ }
55
+
56
+ .v-overlay--active {
57
+ animation: fade-in 0.5s ease-in-out;
58
+ }
59
+
60
+ @keyframes fade-in {
61
+ from {
62
+ opacity: 0;
63
+ }
64
+ to {
65
+ opacity: 1;
66
+ }
67
+ }
68
+ .loader-logo--active :deep([class^="IEA_"]) {
69
+ fill: transparent;
70
+ stroke: #000;
71
+ stroke-opacity: 1;
72
+ fill-opacity: 1;
73
+ fill-rule: nonzero;
74
+ }
75
+
76
+ .loader-logo--active :deep(.IEA_0) {
77
+ stroke-dasharray: 1223 1225;
78
+ stroke-dashoffset: 1224;
79
+ animation: IEA_draw_0 3141ms ease 0ms 1 forwards;
80
+ }
81
+
82
+ .loader-logo--active :deep(.IEA_5) {
83
+ stroke-dasharray: 335 337;
84
+ stroke-dashoffset: 336;
85
+ animation: IEA_draw_5 3141ms ease 0ms 1 forwards;
86
+ }
87
+
88
+ .loader-logo--active :deep(.IEA_1) {
89
+ stroke-dasharray: 1351 1353;
90
+ stroke-dashoffset: 1352;
91
+ animation: IEA_draw_1 3141ms ease 0ms 1 forwards, stroke-fade 3141ms linear 0ms 1 forwards, fill-standard 3141ms ease 0ms 1 forwards;
92
+ }
93
+
94
+ .loader-logo--active :deep(.IEA_2) {
95
+ stroke-dasharray: 1311 1313;
96
+ stroke-dashoffset: 1312;
97
+ animation: IEA_draw_2 3141ms ease 0ms 1 forwards, stroke-fade 3141ms linear 0ms 1 forwards, fill-standard 3141ms ease 0ms 1 forwards;
98
+ }
99
+
100
+ .loader-logo--active :deep(.IEA_3),
101
+ .loader-logo--active :deep(.IEA_4) {
102
+ stroke-dasharray: 13 15;
103
+ stroke-dashoffset: 14;
104
+ }
105
+
106
+ .loader-logo--active :deep(.IEA_3) {
107
+ animation: IEA_draw_3 3141ms ease 0ms 1 forwards, stroke-fade 3141ms linear 0ms 1 forwards, fill-standard 3141ms ease 0ms 1 forwards;
108
+ }
109
+
110
+ .loader-logo--active :deep(.IEA_4) {
111
+ animation: IEA_draw_4 3141ms ease 0ms 1 forwards, stroke-fade 3141ms linear 0ms 1 forwards, fill-standard 3141ms ease 0ms 1 forwards;
112
+ }
113
+
114
+ .loader-logo--active :deep(.IEA_6),
115
+ .loader-logo--active :deep(.IEA_7),
116
+ .loader-logo--active :deep(.IEA_8) {
117
+ stroke-dasharray: 102 104;
118
+ stroke-dashoffset: 103;
119
+ }
120
+
121
+ .loader-logo--active :deep(.IEA_6) {
122
+ animation: IEA_draw_6 3141ms ease 0ms 1 forwards, stroke-fade 3141ms linear 0ms 1 forwards, fill-standard 3141ms ease 0ms 1 forwards;
123
+ }
124
+
125
+ .loader-logo--active :deep(.IEA_7) {
126
+ animation: IEA_draw_7 3141ms ease 0ms 1 forwards, stroke-fade 3141ms linear 0ms 1 forwards, fill-standard 3141ms ease 0ms 1 forwards;
127
+ }
128
+
129
+ .loader-logo--active :deep(.IEA_8) {
130
+ animation: IEA_draw_8 3141ms ease 0ms 1 forwards, stroke-fade 3141ms linear 0ms 1 forwards, fill-standard 3141ms ease 0ms 1 forwards;
131
+ }
132
+
133
+ .loader-logo--active :deep(.IEA_9) {
134
+ stroke-dasharray: 372 374;
135
+ stroke-dashoffset: 373;
136
+ animation: IEA_draw_9 3141ms ease 0ms 1 forwards, stroke-fade 3141ms linear 0ms 1 forwards, fill-standard 3141ms ease 0ms 1 forwards;
137
+ }
138
+
139
+ .loader-logo--active :deep(.IEA_10) {
140
+ stroke-dasharray: 96 98;
141
+ stroke-dashoffset: 97;
142
+ animation: IEA_draw_10 3141ms ease 0ms 1 forwards, stroke-fade 3141ms linear 0ms 1 forwards, fill-standard 3141ms ease 0ms 1 forwards;
143
+ }
144
+
145
+ .loader-logo--active :deep(.IEA_11) {
146
+ stroke-dasharray: 184 186;
147
+ stroke-dashoffset: 185;
148
+ animation: IEA_draw_11 3141ms ease 0ms 1 forwards, stroke-fade 3141ms linear 0ms 1 forwards, fill-standard 3141ms ease 0ms 1 forwards;
149
+ }
150
+
151
+ .loader-logo--active :deep(.IEA_12) {
152
+ stroke-dasharray: 169 171;
153
+ stroke-dashoffset: 170;
154
+ animation: IEA_draw_12 3141ms ease 0ms 1 forwards, stroke-fade 3141ms linear 0ms 1 forwards, fill-standard 3141ms ease 0ms 1 forwards;
155
+ }
156
+
157
+ .loader-logo--active :deep(.IEA_13) {
158
+ stroke-dasharray: 1020 1022;
159
+ stroke-dashoffset: 1021;
160
+ animation: IEA_draw_13 3141ms ease 0ms 1 forwards, stroke-fade 3141ms linear 0ms 1 forwards, fill-circles 3141ms ease 0ms 1 forwards;
161
+ }
162
+
163
+ .loader-logo--active :deep(.IEA_14) {
164
+ stroke-dasharray: 939 941;
165
+ stroke-dashoffset: 940;
166
+ animation: IEA_draw_14 3141ms ease 0ms 1 forwards, stroke-fade 3141ms linear 0ms 1 forwards, fill-circles 3141ms ease 0ms 1 forwards;
167
+ }
168
+
169
+ .loader-logo--active :deep(.IEA_15) {
170
+ stroke-dasharray: 326 328;
171
+ stroke-dashoffset: 327;
172
+ animation: IEA_draw_15 3141ms ease 0ms 1 forwards, stroke-fade 3141ms linear 0ms 1 forwards, fill-standard 3141ms ease 0ms 1 forwards;
173
+ }
174
+
175
+ @keyframes fill-standard {
176
+ 0%, 35% {
177
+ fill: transparent;
178
+ }
179
+ 60% {
180
+ fill: rgba(0, 0, 0, 0.3);
181
+ }
182
+ 80% {
183
+ fill: rgba(0, 0, 0, 0.7);
184
+ }
185
+ 100% {
186
+ fill: #000;
187
+ }
188
+ }
189
+ @keyframes fill-circles {
190
+ 0%, 35% {
191
+ fill: transparent;
192
+ }
193
+ 60% {
194
+ fill: rgba(0, 0, 0, 0.2);
195
+ }
196
+ 80% {
197
+ fill: rgba(0, 0, 0, 0.5);
198
+ }
199
+ 100% {
200
+ fill: #000;
201
+ }
202
+ }
203
+ @keyframes stroke-fade {
204
+ 0%, 65% {
205
+ stroke-opacity: 1;
206
+ }
207
+ 80% {
208
+ stroke-opacity: 0.5;
209
+ }
210
+ 95% {
211
+ stroke-opacity: 0.2;
212
+ }
213
+ 100% {
214
+ stroke-opacity: 0;
215
+ }
216
+ }
217
+ @keyframes draw {
218
+ 100% {
219
+ stroke-dashoffset: 0;
220
+ }
221
+ }
222
+ @keyframes IEA_draw_0 {
223
+ 5% {
224
+ stroke-dashoffset: 1224;
225
+ }
226
+ 30%, 100% {
227
+ stroke-dashoffset: 0;
228
+ }
229
+ }
230
+ @keyframes IEA_draw_1 {
231
+ 8% {
232
+ stroke-dashoffset: 1352;
233
+ }
234
+ 35%, 100% {
235
+ stroke-dashoffset: 0;
236
+ }
237
+ }
238
+ @keyframes IEA_draw_2 {
239
+ 10% {
240
+ stroke-dashoffset: 1312;
241
+ }
242
+ 40%, 100% {
243
+ stroke-dashoffset: 0;
244
+ }
245
+ }
246
+ @keyframes IEA_draw_3 {
247
+ 12% {
248
+ stroke-dashoffset: 14;
249
+ }
250
+ 45%, 100% {
251
+ stroke-dashoffset: 0;
252
+ }
253
+ }
254
+ @keyframes IEA_draw_4 {
255
+ 15% {
256
+ stroke-dashoffset: 14;
257
+ }
258
+ 50%, 100% {
259
+ stroke-dashoffset: 0;
260
+ }
261
+ }
262
+ @keyframes IEA_draw_5 {
263
+ 15.74% {
264
+ stroke-dashoffset: 336;
265
+ }
266
+ 43.52%, 100% {
267
+ stroke-dashoffset: 0;
268
+ }
269
+ }
270
+ @keyframes IEA_draw_6 {
271
+ 16.67% {
272
+ stroke-dashoffset: 103;
273
+ }
274
+ 44.44%, 100% {
275
+ stroke-dashoffset: 0;
276
+ }
277
+ }
278
+ @keyframes IEA_draw_7 {
279
+ 17.59% {
280
+ stroke-dashoffset: 103;
281
+ }
282
+ 45.37%, 100% {
283
+ stroke-dashoffset: 0;
284
+ }
285
+ }
286
+ @keyframes IEA_draw_8 {
287
+ 18.52% {
288
+ stroke-dashoffset: 103;
289
+ }
290
+ 46.3%, 100% {
291
+ stroke-dashoffset: 0;
292
+ }
293
+ }
294
+ @keyframes IEA_draw_9 {
295
+ 19.44% {
296
+ stroke-dashoffset: 373;
297
+ }
298
+ 47.22%, 100% {
299
+ stroke-dashoffset: 0;
300
+ }
301
+ }
302
+ @keyframes IEA_draw_10 {
303
+ 20.37% {
304
+ stroke-dashoffset: 97;
305
+ }
306
+ 48.15%, 100% {
307
+ stroke-dashoffset: 0;
308
+ }
309
+ }
310
+ @keyframes IEA_draw_11 {
311
+ 21.3% {
312
+ stroke-dashoffset: 185;
313
+ }
314
+ 49.07%, 100% {
315
+ stroke-dashoffset: 0;
316
+ }
317
+ }
318
+ @keyframes IEA_draw_12 {
319
+ 22.22% {
320
+ stroke-dashoffset: 170;
321
+ }
322
+ 50%, 100% {
323
+ stroke-dashoffset: 0;
324
+ }
325
+ }
326
+ @keyframes IEA_draw_13 {
327
+ 23.15% {
328
+ stroke-dashoffset: 1021;
329
+ }
330
+ 50.93%, 100% {
331
+ stroke-dashoffset: 0;
332
+ }
333
+ }
334
+ @keyframes IEA_draw_14 {
335
+ 24.07% {
336
+ stroke-dashoffset: 940;
337
+ }
338
+ 51.85%, 100% {
339
+ stroke-dashoffset: 0;
340
+ }
341
+ }
342
+ @keyframes IEA_draw_15 {
343
+ 25% {
344
+ stroke-dashoffset: 327;
345
+ }
346
+ 52.78%, 100% {
347
+ stroke-dashoffset: 0;
348
+ }
349
+ }
350
+ </style>
@@ -2,83 +2,115 @@
2
2
  <ListMoleculesGlobalSearchInput
3
3
  type="all"
4
4
  :placeholder="$t('search')"
5
- variant="outlined"
6
5
  :categories="selectedCategories"
7
- @change="updateSearch($event)"
6
+ filter
8
7
  @filter-change="handleFilterChange"
8
+ class="mb-6"
9
9
  />
10
- <ListMoleculesResultsContainer
11
- v-for="type in filteredSortedModules"
12
- :key="type"
13
- :feminine="type === 'people'"
14
- :type
15
- :open="$rootStore.results[type]?.total > 0 ?? open[type]"
16
- @toggle="open[$event] = !open[$event]"
17
- >
18
- {{ $rootStore.results[type]?.total }}
19
- <v-expand-transition class="results-container">
20
- <div v-show="$rootStore.results[type]?.total > 0 || open[type]">
21
- <ListAtomsResultsList :type />
22
- </div>
23
- </v-expand-transition>
24
- </ListMoleculesResultsContainer>
10
+ <div v-if="searchTerm.length === 0" class="search-empty">
11
+ <ListAtomsLogoPlaceholder idle />
12
+ </div>
13
+ <template v-else>
14
+ <div v-if="loading" class="search-pending">
15
+ <ListAtomsLogoPlaceholder />
16
+ </div>
17
+ <template v-else-if="!loading">
18
+ <ListMoleculesResultsContainer
19
+ v-for="type in filteredSortedModules"
20
+ :key="type"
21
+ :feminine="
22
+ type === 'people' || type === 'news' || type === 'publications'
23
+ "
24
+ :type
25
+ :open="open[type] ?? false"
26
+ @toggle="(t) => (open[t] = !open[t])"
27
+ >
28
+ <v-expand-transition class="results-container">
29
+ <div v-show="open[type]">
30
+ <ListAtomsResultsList
31
+ :type
32
+ :pathPrefix="
33
+ type === 'people'
34
+ ? 'people-slug'
35
+ : 'activities-' + type + '-slug'
36
+ "
37
+ />
38
+ </div>
39
+ </v-expand-transition>
40
+ </ListMoleculesResultsContainer>
41
+ </template>
42
+ </template>
25
43
  </template>
26
44
 
27
45
  <script setup>
28
46
  import {
29
47
  useNuxtApp,
30
- onBeforeUnmount,
31
48
  useI18n,
32
49
  useAppConfig,
50
+ useRoute,
33
51
  ref,
52
+ reactive,
34
53
  useAsyncQuery,
35
54
  computed,
55
+ watch,
36
56
  } from "#imports"
37
57
  import SEARCH from "@paris-ias/trees/dist/graphql/client/misc/query.search.all.gql"
38
- // Component name for linting
39
- defineOptions({
40
- name: "SearchResults",
41
- })
42
58
 
43
59
  const { $rootStore } = useNuxtApp()
44
-
45
60
  const appConfig = useAppConfig()
46
61
  const { locale } = useI18n()
47
- const open = ref({})
62
+ const route = useRoute()
63
+ if (route.query.search) {
64
+ $rootStore.search = route.query.search
65
+ }
66
+
67
+ const loading = ref(true)
68
+
69
+ const open = reactive(
70
+ appConfig.list.modules.reduce((acc, type) => {
71
+ acc[type] = false
72
+ return acc
73
+ }, {}),
74
+ )
48
75
 
49
- // State for selected categories (default to all selected)
50
76
  const selectedCategories = ref([...appConfig.list.modules])
51
77
 
52
- // Handle filter changes
53
78
  const handleFilterChange = (filterData) => {
54
79
  selectedCategories.value = filterData.categories
55
80
  }
56
81
 
57
- // Computed property to sort modules by total count (highest first)
58
82
  const sortedModules = computed(() => {
59
83
  return appConfig.list.modules.slice().sort((a, b) => {
60
- const aResults = $rootStore.results[a] || { total: 0 }
61
- const bResults = $rootStore.results[b] || { total: 0 }
62
-
63
- // Sort by highest total count first
64
- return (bResults.total || 0) - (aResults.total || 0)
84
+ const aMaxScore = Math.max(
85
+ ...($rootStore.results[a]?.items || []).map((i) => i.score ?? 0),
86
+ 0,
87
+ )
88
+ const bMaxScore = Math.max(
89
+ ...($rootStore.results[b]?.items || []).map((i) => i.score ?? 0),
90
+ 0,
91
+ )
92
+ return bMaxScore - aMaxScore
65
93
  })
66
94
  })
67
-
68
- // Computed property to filter and sort modules based on selected categories
69
95
  const filteredSortedModules = computed(() => {
70
96
  return sortedModules.value.filter((type) =>
71
97
  selectedCategories.value.includes(type),
72
98
  )
73
99
  })
74
100
 
75
- // Apollo GraphQL query with proper reactivity
76
- const { data, pending, error, refresh } = await useAsyncQuery(
101
+ const searchTerm = computed(() => $rootStore.search || "")
102
+ const currentLocale = computed(() => locale.value)
103
+
104
+ const { data, pending, error } = useAsyncQuery(
77
105
  SEARCH,
78
- { search: $rootStore.search, appId: "iea", locale: locale.value },
106
+ computed(() => ({
107
+ search: searchTerm.value,
108
+ appId: "iea",
109
+ lang: currentLocale.value,
110
+ })),
79
111
  {
80
- key: `search-${$rootStore.search}`, // Unique key for caching
81
- server: true, // Enable SSR
112
+ server: false,
113
+ enabled: computed(() => searchTerm.value.length > 0),
82
114
  },
83
115
  )
84
116
  if (error.value) {
@@ -87,94 +119,26 @@ if (error.value) {
87
119
  /* console.log("Query result data: ", data.value.items?.length) */
88
120
  }
89
121
 
90
- // Apply data to store immediately if available
91
- if (data.value) {
92
- console.log("Applying data to store directly [first load scenario]")
93
- $rootStore.applyListResult("all", data.value)
94
- // Initialize open state for types with results
122
+ const applyData = (newData) => {
123
+ if (!newData) return
124
+ $rootStore.applyListResult("all", newData)
95
125
  appConfig.list.modules.forEach((type) => {
96
- if ($rootStore.results[type]?.total > 0) {
97
- open.value[type] = true
126
+ if (newData.search?.[type]?.total > 0) {
127
+ open[type] = true
98
128
  }
99
129
  })
130
+ loading.value = false
100
131
  }
101
132
 
102
- const updateSearch = async (newSearch) => {
103
- console.log("update search")
104
- if (newSearch !== $rootStore.search) {
105
- await refresh()
106
- if (data.value) {
107
- console.log("Applying data to store directly [first load scenario]")
108
- $rootStore.applyListResult("all", data.value)
109
- // Initialize open state for types with results
110
- appConfig.list.modules.forEach((type) => {
111
- if ($rootStore.results[type]?.total > 0) {
112
- open.value[type] = true
113
- }
114
- })
115
- }
133
+ watch(data, applyData, { immediate: true })
134
+
135
+ watch(error, (err) => {
136
+ if (err) {
137
+ console.error("GraphQL query error:", err)
138
+ loading.value = false
116
139
  }
117
- }
118
- onBeforeUnmount(() => {
119
- /* rootStore.resetState("all", locale.value) */
120
140
  })
121
-
122
- const socioscope = {
123
- appId: ["iea"],
124
- url: "https://thesocioscope.org",
125
- subtitle: {
126
- en: "Seeing How Social Change Takes Shape",
127
- fr: "Voir comment le changement social prend forme",
128
- },
129
- date: {
130
- $date: "2023-03-18T00:00:00.000Z",
131
- },
132
- image: {
133
- url: "https://cdn-yggdrasil-dev.s3.eu-west-2.amazonaws.com/iea/project/the_socioscope.svg",
134
- },
135
- summary: {
136
- en: "Through large scale data collection around the world and LLM-driven research, the Socioscope analyses how behaviours, norms, and practices evolve within sustainable food transitions.\nWe're building a systemic way to help make complex social patterns measurable, comparable, and understandable.",
137
- fr: "Grâce à la collecte de données à grande échelle dans le monde entier et à la recherche pilotée par LLM, le Socioscope analyse comment les comportements, normes et pratiques évoluent dans les transitions alimentaires durables.\nNous construisons une méthode systématique pour rendre les schémas sociaux complexes mesurables, comparables et compréhensibles.",
138
- },
139
- description: {
140
- en: "The Socioscope is a transformative qualitative research project that maps how behaviours, norms, and communities influence the transition toward sustainable food systems.\nThe Socioscope serves as a comprehensive observatory of these efforts, making knowledge accessible to researchers, policymakers, and practitioners worldwide. Equally important is shining a light on local initiatives that lead change on the ground and drive the shift toward a more sustainable food system.",
141
- fr: "Le Socioscope est un projet de recherche qualitative transformatif qui cartographie comment les comportements, normes et communautés influencent la transition vers des systèmes alimentaires durables.\nLe Socioscope sert d'observatoire complet de ces efforts, rendant les connaissances accessibles aux chercheurs, décideurs politiques et praticiens du monde entier. Tout aussi important, il met en lumière les initiatives locales qui mènent le changement sur le terrain et conduisent la transition vers un système alimentaire plus durable.",
142
- },
143
- name: {
144
- en: "The Socioscope",
145
- fr: "Le Socioscope",
146
- },
147
- related: {
148
- people: [
149
- {
150
- firstname: "Antoine",
151
- lastname: "Cordelois",
152
- image: {
153
- url: "https://cdn-yggdrasil-dev.s3.eu-west-2.amazonaws.com/iea/people/antoine_cordelois.jpg",
154
- },
155
- },
156
- {
157
- firstname: "Saadi",
158
- lastname: "Lahlou",
159
- image: {
160
- url: "https://cdn-yggdrasil-dev.s3.eu-west-2.amazonaws.com/iea/people/lahlou_saadi.jpg",
161
- },
162
- },
163
- {
164
- firstname: "Paulius",
165
- lastname: "Yamin",
166
- image: {
167
- url: "https://cdn-yggdrasil-dev.s3.eu-west-2.amazonaws.com/iea/people/Paulius_Yamin.jpg",
168
- },
169
- },
170
- ],
171
- },
172
- slug: {
173
- fr: "le-socioscope",
174
- en: "the-socioscope",
175
- },
176
- }
177
141
  </script>
178
142
  <style scoped>
179
- .results-container{display:flex;flex-direction:column;gap:8px;margin-left:8px}
143
+ .results-container{display:flex;flex-direction:column;gap:8px;margin-left:8px}.search-empty{min-height:100vh;opacity:.8}.search-empty,.search-pending{display:flex;justify-content:center}.search-pending{padding:48px 0}
180
144
  </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <section class="my-6 ml-2 pb-6">
2
+ <section class="my-6 pb-6">
3
3
  <slot>
4
4
  <!-- fallback content -->
5
5
  </slot>
@@ -1,4 +1,5 @@
1
1
  <template>
2
+ <!-- TODO: make it after the slider of seed without swiper -->
2
3
  <v-row class="mb-9">
3
4
  <v-col class="justify-center">
4
5
  <slot />
@@ -79,10 +80,10 @@
79
80
  - Meaningful behavior when clicking on the arrrows
80
81
  - Add a slide-in from right animation when the items are entering viewport
81
82
  */
82
- import { useDisplay } from "vuetify";
83
- const { locale } = useI18n();
84
- const { name, mdAndUp } = useDisplay();
85
- const model = ref(0);
83
+ import { useDisplay } from "vuetify"
84
+ const { locale } = useI18n()
85
+ const { name, mdAndUp } = useDisplay()
86
+ const model = ref(0)
86
87
  const swiperBreakpoints = ref({
87
88
  320: {
88
89
  slidesPerView: "auto",
@@ -108,7 +109,7 @@ const swiperBreakpoints = ref({
108
109
  slidesPerView: "auto",
109
110
  spaceBetween: 35,
110
111
  },
111
- });
112
+ })
112
113
  const props = defineProps({
113
114
  type: {
114
115
  type: String,
@@ -118,44 +119,39 @@ const props = defineProps({
118
119
  loading: { type: Boolean, default: false },
119
120
  dark: { type: Boolean, default: false },
120
121
  more: { type: Boolean, default: true },
121
- });
122
+ })
122
123
 
123
124
  /* const { data, error } = await useAsyncData(props.type, () =>
124
125
  )
125
126
  console.log("error: ", error) */
126
- const spaceBetween = 10;
127
+ const spaceBetween = 10
127
128
  const onProgress = (e) => {
128
- console.log("e: progress ", e);
129
- const [swiper, progress] = e.detail;
130
- console.log(progress);
131
- };
129
+ const [swiper, progress] = e.detail
130
+ }
132
131
 
133
- const onSlideChange = (e) => {
134
- console.log("slide changed", e);
135
- };
136
132
  const computedWidth = computed(() => {
137
- let modifier = 1;
133
+ let modifier = 1
138
134
  switch (props.type) {
139
135
  case "events":
140
- modifier = 1.1;
141
- break;
136
+ modifier = 1.1
137
+ break
142
138
  case "people":
143
- break;
139
+ break
144
140
  case "image":
145
- break;
141
+ break
146
142
  default:
147
- break;
143
+ break
148
144
  }
149
145
  return (
150
146
  [250, 300, 350, 380, 430, 460][
151
147
  ["xs", "sm", "md", "lg", "xl", "xxl"].indexOf(name.value || "md")
152
148
  ] * modifier
153
- );
154
- });
149
+ )
150
+ })
155
151
 
156
152
  onMounted(() => {
157
- console.log("Resolved Item", capitalize(props.type) + "SlidingItem");
158
- });
153
+ console.log("Resolved Item", capitalize(props.type) + "SlidingItem")
154
+ })
159
155
  </script>
160
156
  <style scoped>
161
157
  .swiper-slide{width:auto}