@@ -73,11 +73,15 @@ const loading = computed(() => props.item.loading);
73
73
<NTimelineItem
74
74
:key =" item.id"
75
75
class =" timeline-item"
76
- :class =" { 'no-header': noHeader, 'next-has-header': nextHasHead }"
76
+ :class =" {
77
+ 'no-header': noHeader,
78
+ 'next-has-header': nextHasHead,
79
+ 'show-date': !hideDate,
80
+ }"
77
81
:data-key =" item.id"
78
82
:data-index =" index"
79
- :line-type =" item. loading ? 'dashed' : lineType"
80
- :color =" item. loading ? 'grey' : color"
83
+ :line-type =" loading ? 'dashed' : lineType"
84
+ :color =" loading ? 'grey' : color"
81
85
@mouseenter =" onHover(true)"
82
86
@mouseleave =" onHover(false)"
83
87
>
@@ -88,7 +92,13 @@ const loading = computed(() => props.item.loading);
88
92
<slot name =" before" />
89
93
</template >
90
94
<template #default >
91
- <NFlex class =" content" :class =" { 'no-border': noHeader }" :wrap =" false" >
95
+ <NFlex
96
+ class =" content"
97
+ :class =" { 'no-border': noHeader }"
98
+ size =" small"
99
+ :theme-overrides =" { gapSmall: '0' }"
100
+ :wrap =" false"
101
+ >
92
102
<NFlex
93
103
v-if =" !hideDate"
94
104
class =" header"
@@ -99,16 +109,16 @@ const loading = computed(() => props.item.loading);
99
109
size =" small"
100
110
:theme-overrides =" { gapSmall: '0.25rem' }"
101
111
>
102
- <template v-if =" date && ! noHeader " >
112
+ <template v-if =" date && ! noHeader && ! loading " >
103
113
<NTime class =" month" :time =" date" format =" MMM" />
104
114
<NTime class =" day" :time =" date" format =" dd" />
105
- <NTime :time =" date" format =" eee" />
115
+ <NTime class = " week " :time =" date" format =" eee" />
106
116
<NTime v-if =" !sameYear" class =" year" :time =" date" format =" yyyy" />
107
117
</template >
108
118
<template v-else-if =" loading " >
109
- <NSkeleton text style = " width : 1 rem " />
110
- <NSkeleton text style = " width : 2 rem " />
111
- <NSkeleton text style = " width : 1 rem " />
119
+ <NSkeleton class = " loading month " text round />
120
+ <NSkeleton class = " loading day " text round />
121
+ <NSkeleton class = " loading week " text round />
112
122
</template >
113
123
</NFlex >
114
124
<NFlex class =" tile" :wrap =" false" >
@@ -121,8 +131,8 @@ const loading = computed(() => props.item.loading);
121
131
:preview-src =" poster"
122
132
:fallback-src =" PosterPlaceholder"
123
133
/>
124
- <ListItemPanel :item =" item" :loading =" item. loading" >
125
- <slot :item =" item" :index =" index" :loading =" item. loading" />
134
+ <ListItemPanel :item =" item" :loading =" loading" >
135
+ <slot :item =" item" :index =" index" :loading =" loading" />
126
136
</ListItemPanel >
127
137
</NFlex >
128
138
</NFlex >
@@ -140,9 +150,11 @@ const loading = computed(() => props.item.loading);
140
150
.timeline-item {
141
151
margin : 0 1rem ;
142
152
143
- .content {
144
- padding : 0.5rem ;
153
+ & .show-date {
154
+ margin-left : 4rem ;
155
+ }
145
156
157
+ .content {
146
158
.tile {
147
159
@include mixin .hover-background (
148
160
$from : transparent ,
@@ -151,14 +163,18 @@ const loading = computed(() => props.item.loading);
151
163
);
152
164
153
165
flex : 1 1 auto ;
166
+ padding : 0.5rem ;
154
167
}
155
168
}
156
169
157
170
.header {
158
- width : 2.5rem ;
159
- margin : 0.25rem 0.5rem 0 -0.25rem ;
171
+ position : absolute ;
172
+ top : 0 ;
173
+ left : -3.75rem ;
174
+ width : 3.5rem ;
160
175
color : var (--n-text-color );
161
176
font-size : 14px ;
177
+ border-top : 1px solid var (--border-grey );
162
178
163
179
& .hover {
164
180
color : var (--trakt-red );
@@ -167,6 +183,7 @@ const loading = computed(() => props.item.loading);
167
183
}
168
184
169
185
.month {
186
+ margin-top : 0.75rem ;
170
187
font-weight : bold ;
171
188
}
172
189
@@ -178,6 +195,31 @@ const loading = computed(() => props.item.loading);
178
195
.year {
179
196
color : var (--n-meta-text-color );
180
197
}
198
+
199
+ .loading {
200
+ margin-bottom : 0.25rem ;
201
+
202
+ & .month {
203
+ width : 1.5rem ;
204
+ height : 0.8rem ;
205
+ }
206
+
207
+ & .day {
208
+ width : 2rem ;
209
+ height : 1rem ;
210
+ }
211
+
212
+ & .week {
213
+ width : 1.6rem ;
214
+ height : 0.75rem ;
215
+ }
216
+ }
217
+ }
218
+
219
+ & .no-header {
220
+ .header {
221
+ border-top : 1px solid transparent ;
222
+ }
181
223
}
182
224
183
225
.poster {
@@ -198,6 +240,8 @@ const loading = computed(() => props.item.loading);
198
240
199
241
.n-timeline.n-timeline--left-placement {
200
242
.timeline-item.n-timeline-item .n-timeline-item-timeline {
243
+ --n-icon-size : 12px ;
244
+
201
245
top : calc (0% - var (--n-icon-size ) / 2 );
202
246
}
203
247
@@ -212,6 +256,7 @@ const loading = computed(() => props.item.loading);
212
256
}
213
257
214
258
.timeline-item.n-timeline-item .n-timeline-item-content {
259
+ margin-left : calc (var (--n-icon-size ) + 0.125rem );
215
260
border-top : 1px solid transparent ;
216
261
217
262
.n-timeline-item-content__title {
@@ -220,7 +265,7 @@ const loading = computed(() => props.item.loading);
220
265
}
221
266
222
267
.timeline-item.n-timeline-item :not (.no-header ) .n-timeline-item-content {
223
- border-top : 1px solid rgba ( 255 255 255 / 10 % );
268
+ border-top : 1px solid var ( --border-grey );
224
269
}
225
270
}
226
271
</style >
0 commit comments