itube-specs 0.0.920 → 0.0.921
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.
|
@@ -720,6 +720,7 @@ $player-menu-option-bar--active: $color-zinc-400; // bg-zinc-400
|
|
|
720
720
|
$player-menu-row-bg--hover: $mono-white-10;
|
|
721
721
|
$player-menu-option-bg--hover: $mono-white-5; // hover:bg-white/5
|
|
722
722
|
$player-menu-toggle-bg--active: $color-indigo-500; // switch on: bg-indigo-500
|
|
723
|
+
$player-center-label-shadow: $color-black-50; // мета в центре бара поверх видео
|
|
723
724
|
|
|
724
725
|
// accordion (scene types)
|
|
725
726
|
$player-menu-acc-border: $color-zinc-800-60; // border-zinc-800/60
|
|
@@ -771,6 +771,7 @@ $player-menu-option-bar--active: $color-gray-400; // bg-zinc-400
|
|
|
771
771
|
$player-menu-row-bg--hover: $mono-white-10;
|
|
772
772
|
$player-menu-option-bg--hover: $mono-white-5; // hover:bg-white/5
|
|
773
773
|
$player-menu-toggle-bg--active: $color-indigo-500; // switch on: bg-indigo-500
|
|
774
|
+
$player-center-label-shadow: $color-black-50; // мета в центре бара поверх видео
|
|
774
775
|
|
|
775
776
|
// accordion (scene types)
|
|
776
777
|
$player-menu-acc-border: $color-slate-700; // border-zinc-800/60
|
|
@@ -208,7 +208,7 @@ function nextPreviewMeta(card: IVideoCard): PreviewMetaItem[] {
|
|
|
208
208
|
{ text: card.channelName || t('user_uploaded'), icon: CHANNEL_META_ICON },
|
|
209
209
|
];
|
|
210
210
|
if (!props.hideViews && card.views != null) {
|
|
211
|
-
meta.push(`${n(card.views, 'compact')} ${t('views')}`);
|
|
211
|
+
meta.push(`${n(card.views, 'compact')} ${t('views', card.views)}`);
|
|
212
212
|
}
|
|
213
213
|
return meta;
|
|
214
214
|
}
|
|
@@ -244,6 +244,32 @@ watch(() => props.data.videoUrl, () => {
|
|
|
244
244
|
source.value = buildSource();
|
|
245
245
|
});
|
|
246
246
|
|
|
247
|
+
/**
|
|
248
|
+
* Центр контрол-бара: «N просмотров · 3 месяца назад» вместо названия текущей
|
|
249
|
+
* сцены (опция `controls.centerLabel`, плеер 0.11.0+). Больше этой меты на
|
|
250
|
+
* странице нигде нет — под плеером её не выводим.
|
|
251
|
+
*
|
|
252
|
+
* Отдаём СВОЙ элемент, а не строку: кастомный центр плеер рисует один раз при
|
|
253
|
+
* инициализации и больше не трогает, а ролик на странице меняется без пересоздания
|
|
254
|
+
* плеера (`externalAdvance` → `player.load()`), так что строка осталась бы от
|
|
255
|
+
* предыдущего ролика. Свой элемент мы просто переписываем сами.
|
|
256
|
+
*/
|
|
257
|
+
const centerLabel = shallowRef<HTMLElement | null>(null);
|
|
258
|
+
|
|
259
|
+
if (import.meta.client) {
|
|
260
|
+
centerLabel.value = document.createElement('span');
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
watchEffect(() => {
|
|
264
|
+
if (!centerLabel.value) return;
|
|
265
|
+
|
|
266
|
+
const parts: string[] = [];
|
|
267
|
+
if (props.data.views != null) parts.push(`${n(props.data.views, 'compact')} ${t('views', props.data.views)}`);
|
|
268
|
+
if (props.data.created) parts.push(useFormatTimeAgo(props.data.created, locale.value));
|
|
269
|
+
|
|
270
|
+
centerLabel.value.textContent = parts.join(' · ');
|
|
271
|
+
});
|
|
272
|
+
|
|
247
273
|
const options = computed<Omit<PlayerOptions, 'source'>>(() => ({
|
|
248
274
|
playOnInit: true,
|
|
249
275
|
muted: false,
|
|
@@ -265,6 +291,8 @@ const options = computed<Omit<PlayerOptions, 'source'>>(() => ({
|
|
|
265
291
|
scenes: false,
|
|
266
292
|
// Порядок правого кластера: sceneTypes → gear (настройки) → fullscreen (последней).
|
|
267
293
|
order: ['sceneTypes', 'gear', 'fullscreen'],
|
|
294
|
+
// Центр бара — мета ролика вместо названия текущей сцены (см. centerLabel выше).
|
|
295
|
+
centerLabel: centerLabel.value || false,
|
|
268
296
|
},
|
|
269
297
|
icons: PLAYER_ICONS,
|
|
270
298
|
// Заголовок дропдауна выбора типа сцен (дефолт «Scene type»).
|
|
@@ -300,4 +328,12 @@ async function loadAdConfig(): Promise<AdsOptions | undefined> {
|
|
|
300
328
|
border-radius: 0;
|
|
301
329
|
}
|
|
302
330
|
}
|
|
331
|
+
|
|
332
|
+
// Мета ролика в центре бара: по макету белая с тенью и средней жирностью,
|
|
333
|
+
// у плеера по умолчанию — приглушённая и без тени.
|
|
334
|
+
.player-core .imp-controls__chapter {
|
|
335
|
+
font-weight: 500;
|
|
336
|
+
opacity: 1;
|
|
337
|
+
filter: drop-shadow(0 1px 2px $player-center-label-shadow);
|
|
338
|
+
}
|
|
303
339
|
</style>
|