@@ -4,83 +4,118 @@ import TeritorioIconBadge from '~/components/UI/TeritorioIconBadge.vue'
4
4
import UIPicture from ' ~/components/UI/UIPicture.vue'
5
5
import type { ApiPoi } from ' ~/lib/apiPois'
6
6
7
- //
8
- // Props
9
- //
10
7
const props = withDefaults (defineProps <{
11
8
notebook? : boolean
12
9
poi: ApiPoi
13
10
}>(), {
14
11
notebook: false ,
15
12
})
16
13
17
- //
18
- // Composables
19
- //
20
14
const { featureName } = useFeature (toRef (() => props .poi ), { type: ' popup' })
21
15
22
- //
23
- // Data
24
- //
25
16
const colorFill = ref (props .poi .properties .display ?.color_fill || ' black' )
26
17
const colorLine = ref (props .poi .properties .display ?.color_line || ' black' )
27
18
const websiteDetails = ref (props .poi .properties .editorial && props .poi .properties .editorial [' website:details' ])
28
19
</script >
29
20
30
21
<template >
31
- <div
32
- :id =" `PoiCardLight-${poi.properties.metadata.id}`"
33
- class =" tw-flex-col md:tw-flex-row tw-h-auto tw-shrink-0 tw-flex tw-items-start tw-gap-4 tw-justify-between tw-box-border tw-w-full tw-border-gray-300 tw-border-t tw-pt-4 first-of-type:tw-border-t-0"
34
- >
22
+ <article :id =" `PoiCardLight-${poi.properties.metadata.id}`" >
35
23
<div >
36
- <div class =" tw-flex tw-items-center tw-shrink-0 tw-mb-2" >
37
- <h3
38
- class =" tw-block tw-text-xl tw-font-semibold tw-leading-tight tw-flex tw-items-center tw-gap-2"
39
- :style =" `color:${colorLine}`"
40
- >
41
- <TeritorioIconBadge
42
- v-if =" props.poi.properties.display?.icon || poi.properties.display?.text"
43
- :color-fill =" colorFill"
44
- :picto =" props.poi.properties.display?.icon"
45
- size =" lg"
46
- :image =" undefined"
47
- :text =" poi.properties.display?.text"
48
- />
24
+ <header >
25
+ <TeritorioIconBadge
26
+ v-if =" props.poi.properties.display?.icon || poi.properties.display?.text"
27
+ :color-fill =" colorFill"
28
+ :picto =" props.poi.properties.display?.icon"
29
+ :image =" undefined"
30
+ :text =" poi.properties.display?.text"
31
+ size =" lg"
32
+ />
33
+ <h3 class =" tw-text-xl tw-font-semibold tw-leading-tight" :style =" `color:${colorLine}`" >
49
34
{{ featureName }}
50
35
</h3 >
51
36
52
37
<a
53
38
v-if =" Boolean(websiteDetails)"
54
- class =" tw-ml-6 md:tw-ml-8 tw-px-3 tw-py-1.5 tw-text-xs tw-text-zinc-800 tw-bg-zinc-100 hover:tw-bg-zinc-200 focus:tw-bg-zinc-200 tw-transition tw-transition-colors tw-rounded-md"
55
39
:href =" websiteDetails"
40
+ class =" tw-text-xs tw-text-zinc-800 tw-bg-zinc-100 hover:tw-bg-zinc-200 focus:tw-bg-zinc-200 tw-transition tw-transition-colors"
56
41
rel =" noopener noreferrer"
57
42
target =" _blank"
58
43
>
59
44
{{ $t('poiCard.details') }}
60
45
</a >
61
- </div >
62
- < Fields
63
- :fields = "
64
- (poi.properties.editorial && poi.properties.editorial.popup_fields)
65
- || []
66
- "
67
- :properties = " poi.properties "
68
- :details = " websiteDetails "
69
- :geom = " poi.geometry "
70
- / >
46
+ </header >
47
+
48
+ < section >
49
+ < Fields
50
+ :fields = " (poi.properties.editorial && poi.properties.editorial.popup_fields) || []"
51
+ :properties = " poi.properties "
52
+ :details = " websiteDetails "
53
+ :geom = " poi.geometry "
54
+ />
55
+ </ section >
71
56
</div >
57
+
72
58
<UIPicture
73
59
v-if =" poi.properties.image && poi.properties.image.length > 0"
74
- class =" tw-w-full tw-h-32 md:tw-w-32 md:tw-h-32 tw-z-10 tw-contents"
75
60
:src =" poi.properties.image[0]"
76
61
:alt =" $t('poiCard.thumbnail')"
77
62
media-size =" 8rem"
78
63
/>
79
- </div >
64
+ </article >
80
65
</template >
81
66
82
67
<style scoped>
83
- h3 {
84
- margin-bottom : 0 !important ;
68
+ article {
69
+ display : flex ;
70
+ flex-direction : column ;
71
+ gap : 1rem ;
72
+ }
73
+
74
+ article :not (:last-of-type ) {
75
+ border-bottom : 1px solid #d1d5db ;
76
+ padding-bottom : 1rem ;
77
+ }
78
+
79
+ article > div {
80
+ display : flex ;
81
+ flex-direction : column ;
82
+ gap : 0.5rem ;
83
+ }
84
+
85
+ header {
86
+ align-items : center ;
87
+ display : flex ;
88
+ gap : 0.5rem ;
89
+ }
90
+
91
+ header > a {
92
+ padding : 0.5rem ;
93
+ border-radius : 4px ;
94
+ margin-left : auto ;
95
+ align-self : flex-start ;
96
+ }
97
+
98
+ header > h3 {
99
+ margin : 0 ;
100
+ }
101
+
102
+ article > picture :deep(img ) {
103
+ width : 100% ;
104
+ max-height : 280px ;
105
+ object-fit : scale-down ;
106
+ }
107
+
108
+ @media (width >= 768px ) {
109
+ article {
110
+ flex-direction : row ;
111
+ }
112
+
113
+ article > div {
114
+ flex : 70% ;
115
+ }
116
+
117
+ article > picture {
118
+ flex : 30% ;
119
+ }
85
120
}
86
121
</style >
0 commit comments