itube-specs 0.0.910 → 0.0.912

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.
@@ -300,18 +300,18 @@ $like-bar-bg: $color-zinc-700;
300
300
  $like-bar-likes: $color-zinc-500;
301
301
 
302
302
  // ─── Playlist input ───
303
- $playlist-input-label: $color-white;
304
- $playlist-input-toggle-icon: $color-zinc-500;
305
- $playlist-input-toggle-icon--active: $color-zinc-400;
306
- $playlist-input-hint-text: $color-zinc-900;
307
- $playlist-input-hint-bg: $color-zinc-600;
308
- $playlist-input-hint-bg--hover: $color-zinc-500;
303
+ $playlist-input-bg: $color-zinc-900;
309
304
  $playlist-input-back: $color-zinc-500;
310
305
  $playlist-input-back--hover: $color-white;
311
- $playlist-input-tooltip-highlight: $color-white;
312
- $playlist-input-delete-text: $color-red-400;
313
- $playlist-input-delete-bg: $color-red-500-10;
314
- $playlist-input-delete-bg--hover: $color-red-500-20;
306
+ $playlist-input-back-bg: $color-zinc-800;
307
+ $playlist-input-back-bg--hover: $color-zinc-700;
308
+
309
+ // ─── Playlist visibility ───
310
+ $playlist-visibility-icon: $color-zinc-400;
311
+ $playlist-visibility-hint-text: $color-zinc-900;
312
+ $playlist-visibility-hint-bg: $color-zinc-600;
313
+ $playlist-visibility-hint-bg--hover: $color-zinc-500;
314
+ $playlist-visibility-tooltip-highlight: $color-white;
315
315
 
316
316
  // ─── Playlist add ───
317
317
  $playlist-add-item-bg--hover: $color-zinc-800-50;
@@ -324,8 +324,10 @@ $playlist-add-item-edit: $color-zinc-500;
324
324
  $playlist-add-item-edit--hover: $color-white;
325
325
 
326
326
  // ─── Playlist edit ───
327
- $playlist-edit-border: $color-zinc-800;
328
- $playlist-edit-icon: $color-indigo-600;
327
+ $playlist-edit-delete-text: $color-red-400;
328
+ $playlist-edit-delete-text--hover: $color-red-300;
329
+ $playlist-edit-confirm-highlight: $color-white;
330
+ $playlist-edit-confirm-note: $color-zinc-500;
329
331
 
330
332
  // ─── Playlist delete video ───
331
333
  $playlist-delete-video-icon: $color-indigo-600;
@@ -554,7 +556,7 @@ $select-border--active: $color-indigo-500;
554
556
 
555
557
  // ─── Toggle ───
556
558
  $toggle-bg: $color-zinc-700;
557
- $toggle-bg--active: $color-emerald-500;
559
+ $toggle-bg--active: $color-zinc-500;
558
560
  $toggle-handle: $mono-white-50;
559
561
  $toggle-handle--active: $mono-white-100;
560
562
  $toggle-text--disabled: $mono-white-25;
@@ -980,7 +982,6 @@ $contacts-link: $color-indigo-400;
980
982
  $contacts-link--hover: $color-indigo-300;
981
983
 
982
984
  // ─── Page: playlists ───
983
- $page-playlists-border: $color-zinc-800;
984
985
 
985
986
  // ─── Page: channels ───
986
987
  $page-channels-border: $color-zinc-800;
@@ -1001,10 +1002,11 @@ $library-item-icon-border--hover: $color-indigo-500-40;
1001
1002
  $library-item-title: $color-white;
1002
1003
  $library-item-title--hover: $color-indigo-400;
1003
1004
  $library-item-subtitle: $color-zinc-500;
1004
- $library-item-badge-bg: $color-indigo-600-90;
1005
- $library-item-badge-text: $color-white;
1006
- $library-item-badge-bordered-border: $color-zinc-600;
1007
- $library-item-badge-bordered-text: $color-zinc-400;
1005
+ $library-item-avatar-bg: $color-zinc-700;
1006
+ $library-item-avatar-text: $color-zinc-200;
1007
+ $library-item-avatar-border: $color-zinc-900;
1008
+ $library-item-rest-bg: $color-zinc-800;
1009
+ $library-item-rest-text: $color-zinc-400;
1008
1010
 
1009
1011
  // ─── Library feed (блок подписки: модель / канал / категория) ───
1010
1012
  $library-feed-bg: $color-zinc-900-40;
@@ -1023,6 +1025,8 @@ $library-feed-age: $color-zinc-500;
1023
1025
  $library-feed-meta: $color-zinc-500;
1024
1026
  $library-feed-meta-dot: $color-zinc-600;
1025
1027
  $library-feed-title: $color-zinc-500;
1028
+ $library-feed-open: $color-zinc-400;
1029
+ $library-feed-open--hover: $color-white;
1026
1030
 
1027
1031
  // ─── Page: library ───
1028
1032
  $page-library-toggle-text: $color-zinc-300;
@@ -357,18 +357,18 @@ $like-bar-bg: $color-slate-700;
357
357
  $like-bar-likes: $color-gray-500;
358
358
 
359
359
  // ─── Playlist input ───
360
- $playlist-input-label: $color-white;
361
- $playlist-input-toggle-icon: $color-gray-500;
362
- $playlist-input-toggle-icon--active: $color-gray-400;
363
- $playlist-input-hint-text: $color-gray-900;
364
- $playlist-input-hint-bg: $color-gray-600;
365
- $playlist-input-hint-bg--hover: $color-gray-500;
360
+ $playlist-input-bg: $color-slate-900;
366
361
  $playlist-input-back: $color-gray-400;
367
362
  $playlist-input-back--hover: $color-white;
368
- $playlist-input-tooltip-highlight: $color-white;
369
- $playlist-input-delete-text: $color-red-400;
370
- $playlist-input-delete-bg: $color-red-500-10;
371
- $playlist-input-delete-bg--hover: $color-red-500-20;
363
+ $playlist-input-back-bg: $color-slate-750;
364
+ $playlist-input-back-bg--hover: $color-slate-700;
365
+
366
+ // ─── Playlist visibility ───
367
+ $playlist-visibility-icon: $color-gray-400;
368
+ $playlist-visibility-hint-text: $color-gray-900;
369
+ $playlist-visibility-hint-bg: $color-gray-600;
370
+ $playlist-visibility-hint-bg--hover: $color-gray-500;
371
+ $playlist-visibility-tooltip-highlight: $color-white;
372
372
 
373
373
  // ─── Playlist add ───
374
374
  $playlist-add-item-bg--hover: $color-slate-750;
@@ -381,8 +381,10 @@ $playlist-add-item-edit: $color-gray-400;
381
381
  $playlist-add-item-edit--hover: $color-white;
382
382
 
383
383
  // ─── Playlist edit ───
384
- $playlist-edit-border: transparent;
385
- $playlist-edit-icon: $color-indigo-600;
384
+ $playlist-edit-delete-text: $color-red-400;
385
+ $playlist-edit-delete-text--hover: $color-red-300;
386
+ $playlist-edit-confirm-highlight: $color-white;
387
+ $playlist-edit-confirm-note: $color-gray-500;
386
388
 
387
389
  // ─── Playlist delete video ───
388
390
  $playlist-delete-video-icon: $color-indigo-600;
@@ -1008,7 +1010,6 @@ $contacts-link: $color-indigo-400;
1008
1010
  $contacts-link--hover: $color-indigo-300;
1009
1011
 
1010
1012
  // ─── Page: playlists ───
1011
- $page-playlists-border: transparent;
1012
1013
 
1013
1014
  // ─── Page: channels ───
1014
1015
  $page-channels-border: transparent;
@@ -1029,10 +1030,11 @@ $library-item-icon-border--hover: transparent;
1029
1030
  $library-item-title: $color-gray-900;
1030
1031
  $library-item-title--hover: $color-indigo-600;
1031
1032
  $library-item-subtitle: $color-gray-500;
1032
- $library-item-badge-bg: $color-indigo-600;
1033
- $library-item-badge-text: $color-white;
1034
- $library-item-badge-bordered-border: $color-gray-300;
1035
- $library-item-badge-bordered-text: $color-gray-600;
1033
+ $library-item-avatar-bg: $color-gray-300;
1034
+ $library-item-avatar-text: $color-gray-700;
1035
+ $library-item-avatar-border: $color-gray-100;
1036
+ $library-item-rest-bg: $color-gray-200;
1037
+ $library-item-rest-text: $color-gray-600;
1036
1038
 
1037
1039
  // ─── Library feed (блок подписки: модель / канал / категория) ───
1038
1040
  $library-feed-bg: $color-gray-100;
@@ -1051,6 +1053,8 @@ $library-feed-age: $color-gray-500;
1051
1053
  $library-feed-meta: $color-gray-500;
1052
1054
  $library-feed-meta-dot: $color-gray-400;
1053
1055
  $library-feed-title: $color-gray-500;
1056
+ $library-feed-open: $color-gray-600;
1057
+ $library-feed-open--hover: $color-gray-900;
1054
1058
 
1055
1059
  // ─── Page: library ───
1056
1060
  $page-library-toggle-text: $color-gray-700;
@@ -171,10 +171,6 @@ async function submit() {
171
171
 
172
172
  await useUser(AuthorizationApiService).register(form.value);
173
173
 
174
- // Создаем сразу Favorites плейлист, возможно костыль убрать когда будет нормальная логика с беком
175
- // const { FAVORITES_KEY } = useFavorites();
176
- // await PlaylistsApiService.postPlaylist(FAVORITES_KEY, PlaylistType.Private);
177
-
178
174
  useAuthPopup().closeAuthPopup();
179
175
  show('Registration success');
180
176
  } catch (err) {
@@ -49,7 +49,7 @@
49
49
 
50
50
  <span
51
51
  v-if="item.newCount"
52
- class="library-feed__badge _from-sm"
52
+ class="library-feed__badge"
53
53
  >{{ t('library.new_count', { count: item.newCount }) }}</span>
54
54
  </div>
55
55
 
@@ -108,10 +108,28 @@
108
108
  </div>
109
109
  </header>
110
110
 
111
- <!-- <h3
112
- v-if="item.feedTitle"
113
- class="library-feed__feed-title"
114
- >{{ item.feedTitle }}</h3> -->
111
+ <!-- На мобиле ссылки на сущность в шапке нет — она уезжает сюда, в строку над лентой -->
112
+ <div
113
+ v-if="item.feedTitle || item.openText"
114
+ class="library-feed__feed-head _to-sm"
115
+ >
116
+ <p
117
+ v-if="item.feedTitle"
118
+ class="library-feed__feed-title"
119
+ >{{ item.feedTitle }}</p>
120
+
121
+ <NuxtLink
122
+ v-if="item.openText"
123
+ :to="item.to"
124
+ class="library-feed__open"
125
+ >
126
+ {{ item.openText }}
127
+ <UiIcon
128
+ name="arrow-right"
129
+ size="16"
130
+ />
131
+ </NuxtLink>
132
+ </div>
115
133
 
116
134
  <div class="library-feed__grid">
117
135
  <CardVideo
@@ -123,19 +141,6 @@
123
141
  compact
124
142
  />
125
143
  </div>
126
-
127
- <!-- <UiLink
128
- :to="item.to"
129
- theme="secondary"
130
- class="library-feed__all _to-sm"
131
- wide
132
- >
133
- {{ videosText }}
134
- <UiIcon
135
- name="arrow-right"
136
- size="16"
137
- />
138
- </UiLink> -->
139
144
  </article>
140
145
  </template>
141
146
 
@@ -329,13 +334,38 @@ const ageText = computed(() => {
329
334
  column-gap: 8px;
330
335
  }
331
336
 
332
- // .library-feed__feed-title {
333
- // @include font-sm;
337
+ .library-feed__feed-head {
338
+ display: flex;
339
+ align-items: center;
340
+ justify-content: space-between;
341
+ column-gap: 12px;
342
+ margin-bottom: 8px;
343
+ }
344
+
345
+ .library-feed__feed-title {
346
+ @include font-sm;
347
+
348
+ margin: 0;
349
+ font-weight: 400;
350
+ color: $library-feed-title;
351
+ }
352
+
353
+ /* Заголовка может не быть (лента без подписи) — ссылка всё равно держится правого края */
354
+ .library-feed__open {
355
+ @include font-sm;
356
+
357
+ display: flex;
358
+ align-items: center;
359
+ column-gap: 4px;
360
+ flex-shrink: 0;
361
+ margin-inline-start: auto;
362
+ white-space: nowrap;
363
+ color: $library-feed-open;
334
364
 
335
- // margin: 0 0 12px;
336
- // font-weight: 400;
337
- // color: $library-feed-title;
338
- // }
365
+ @include hover(color) {
366
+ color: $library-feed-open--hover;
367
+ }
368
+ }
339
369
 
340
370
  .library-feed__grid {
341
371
  display: grid;
@@ -1,4 +1,4 @@
1
- <!-- Карточка-ссылка библиотеки: иконка-плитка, счётчик, заголовок и опциональный бейдж -->
1
+ <!-- Карточка-ссылка библиотеки: иконка-плитка, ряд аватарок «что внутри» (десктоп), заголовок и счётчик -->
2
2
  <template>
3
3
  <NuxtLink
4
4
  :to="to"
@@ -8,55 +8,76 @@
8
8
  <span class="library-item__icon">
9
9
  <UiIcon
10
10
  :name="icon"
11
- size="20"
11
+ size="22"
12
12
  />
13
13
  </span>
14
- <span
15
- v-if="subtitle"
16
- class="library-item__subtitle _truncate"
17
- >{{ subtitle }}</span>
18
- </span>
19
14
 
20
- <span class="library-item__footer">
21
- <h3 class="library-item__title">{{ title }}</h3>
22
15
  <span
23
- v-if="badge"
24
- :class="`--${badgeTheme}`"
25
- class="library-item__badge"
16
+ v-if="avatars && avatars.length"
17
+ class="library-item__preview"
26
18
  >
27
- {{ badge }}
28
19
  <span
29
- v-if="badgeNote"
30
- class="library-item__badge-note _from-xs"
31
- >{{ badgeNote }}</span>
20
+ v-for="(avatar, index) in avatars"
21
+ :key="`${avatar.title}-${index}`"
22
+ :style="{ zIndex: avatars.length - index }"
23
+ :title="avatar.title"
24
+ class="library-item__avatar"
25
+ >
26
+ <UiImg
27
+ v-if="avatar.avatarUrl && !failedAvatars.includes(index)"
28
+ :src="avatar.avatarUrl"
29
+ :alt="avatar.title"
30
+ class="library-item__photo"
31
+ width="40"
32
+ height="40"
33
+ @error="failedAvatars.push(index)"
34
+ />
35
+ <span
36
+ v-else
37
+ class="library-item__initials"
38
+ >{{ getNameInitials(avatar.title) }}</span>
39
+ </span>
40
+
41
+ <span
42
+ v-if="restCount"
43
+ class="library-item__rest"
44
+ >+{{ restCount }}</span>
32
45
  </span>
33
46
  </span>
47
+
48
+ <h3 class="library-item__title">{{ title }}</h3>
49
+
50
+ <span
51
+ v-if="subtitle"
52
+ class="library-item__subtitle"
53
+ >{{ subtitle }}</span>
34
54
  </NuxtLink>
35
55
  </template>
36
56
 
37
57
  <script setup lang="ts">
38
- withDefaults(defineProps<{
58
+ import { getNameInitials } from '../../utils/player-channel/get-name-initials';
59
+ import type { ILibraryItemAvatar } from '../../types';
60
+
61
+ defineProps<{
39
62
  to: string
40
63
  icon: string
41
64
  title: string
42
- /** Счётчик справа от иконки: «128 videos», «3 private · 1 public» */
65
+ /** Счётчик под заголовком: «128 videos», «3 private · 1 public» */
43
66
  subtitle?: string
44
- /** Бейдж у заголовка: «3 new», «+214» */
45
- badge?: string
46
- /** Хвост бейджа, скрытый на мобиле: «this week» */
47
- badgeNote?: string
48
- badgeTheme?: 'accent' | 'bordered'
49
- }>(), {
50
- badgeTheme: 'accent'
51
- });
67
+ /** Первые подписки внутри раздела — ряд аватарок, виден только на широкой карточке */
68
+ avatars?: ILibraryItemAvatar[]
69
+ /** Сколько подписок не влезло в ряд: плашка «+8» в его хвосте */
70
+ restCount?: number
71
+ }>();
72
+
73
+ const failedAvatars = ref<number[]>([]);
52
74
  </script>
53
75
 
54
76
  <style lang="scss">
55
77
  .library-item {
78
+ container-type: inline-size;
56
79
  display: flex;
57
80
  flex-direction: column;
58
- row-gap: 32px;
59
- justify-content: space-between;
60
81
  padding: 20px;
61
82
  background-color: $library-item-bg;
62
83
  border: 1px solid $library-item-border;
@@ -71,16 +92,17 @@ withDefaults(defineProps<{
71
92
  .library-item__head {
72
93
  display: flex;
73
94
  align-items: center;
74
- justify-content: space-between;
75
- column-gap: 8px;
95
+ column-gap: 12px;
96
+ min-height: 44px;
97
+ margin-bottom: 32px;
76
98
  }
77
99
 
78
100
  .library-item__icon {
79
101
  display: grid;
80
102
  place-content: center;
81
103
  flex-shrink: 0;
82
- width: 44px;
83
- height: 44px;
104
+ width: 48px;
105
+ height: 48px;
84
106
  color: $library-item-icon;
85
107
  background-color: $library-item-icon-bg;
86
108
  border: 1px solid $library-item-icon-border;
@@ -98,18 +120,70 @@ withDefaults(defineProps<{
98
120
  }
99
121
  }
100
122
 
123
+ /* Ряд аватарок занимает больше половины карточки: показываем, только когда она реально широкая */
124
+ .library-item__preview {
125
+ display: none;
126
+ }
127
+
128
+ @include from-br(sm) {
129
+ @include from-cq(220px) {
130
+ .library-item__preview {
131
+ display: flex;
132
+ align-items: center;
133
+ }
134
+ }
135
+ }
136
+
137
+ .library-item__avatar,
138
+ .library-item__rest {
139
+ display: grid;
140
+ place-content: center;
141
+ overflow: hidden;
142
+ flex-shrink: 0;
143
+ width: 40px;
144
+ height: 40px;
145
+ border: 2px solid $library-item-avatar-border;
146
+ border-radius: $radius-full;
147
+ }
148
+
149
+ .library-item__avatar {
150
+ background-color: $library-item-avatar-bg;
151
+ }
152
+
153
+ .library-item__avatar:not(:first-child),
154
+ .library-item__rest {
155
+ margin-inline-start: -11px;
156
+ }
157
+
158
+ .library-item__photo {
159
+ width: 100%;
160
+ height: 100%;
161
+ object-fit: cover;
162
+ object-position: center 30%;
163
+ }
164
+
165
+ .library-item__initials {
166
+ @include font-3xs;
167
+
168
+ font-weight: 700;
169
+ color: $library-item-avatar-text;
170
+ }
171
+
172
+ .library-item__rest {
173
+ @include font-3xs;
174
+
175
+ font-weight: 600;
176
+ color: $library-item-rest-text;
177
+ background-color: $library-item-rest-bg;
178
+ }
179
+
101
180
  .library-item__subtitle {
102
181
  @include font-sm;
103
182
 
183
+ margin-top: 4px;
104
184
  color: $library-item-subtitle;
105
185
  }
106
186
 
107
- .library-item__footer {
108
- display: flex;
109
- align-items: center;
110
- column-gap: 8px;
111
- }
112
-
113
187
  .library-item__title {
114
188
  @include font-base;
115
189
 
@@ -127,26 +201,4 @@ withDefaults(defineProps<{
127
201
  color: $library-item-title--hover;
128
202
  }
129
203
  }
130
-
131
- .library-item__badge {
132
- @include font-3xs;
133
-
134
- flex-shrink: 0;
135
- font-weight: 600;
136
- white-space: nowrap;
137
- padding-block: 2px;
138
- padding-inline: 8px;
139
- border: 1px solid transparent;
140
- border-radius: $radius-full;
141
- }
142
-
143
- .library-item__badge.--accent {
144
- color: $library-item-badge-text;
145
- background-color: $library-item-badge-bg;
146
- }
147
-
148
- .library-item__badge.--bordered {
149
- color: $library-item-badge-bordered-text;
150
- border-color: $library-item-badge-bordered-border;
151
- }
152
204
  </style>