chuijs 4.0.3 → 4.0.4
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.
- package/CHANGELOG.md +536 -0
- package/framework/appLayout/default/chui_app_layout.js +361 -303
- package/framework/appLayout/default/global_style.css +243 -89
- package/framework/appLayout/default/main_theme_style.css +188 -101
- package/framework/components/chui_accordion/accordion.js +17 -17
- package/framework/components/chui_accordion/styles.css +7 -7
- package/framework/components/chui_action_sheet/action_sheet.js +35 -32
- package/framework/components/chui_action_sheet/styles.css +10 -4
- package/framework/components/chui_actions_bar/actions_bar.js +338 -0
- package/framework/components/chui_actions_bar/styles.css +139 -0
- package/framework/components/chui_affix/affix.js +4 -4
- package/framework/components/chui_affix/styles.css +5 -0
- package/framework/components/chui_alert/alert.js +11 -5
- package/framework/components/chui_alert/styles.css +7 -0
- package/framework/components/chui_avatar/avatar.js +13 -13
- package/framework/components/chui_avatar/styles.css +1 -1
- package/framework/components/chui_avatar_group/avatar_group.js +4 -4
- package/framework/components/chui_avatar_group/styles.css +1 -1
- package/framework/components/chui_backtop/backtop.js +25 -2
- package/framework/components/chui_backtop/styles.css +21 -0
- package/framework/components/chui_badge/badge.js +15 -15
- package/framework/components/chui_badge/styles.css +6 -6
- package/framework/components/chui_banner/banner.js +222 -0
- package/framework/components/chui_banner/styles.css +170 -0
- package/framework/components/chui_breadcrumb/styles.css +1 -1
- package/framework/components/chui_button/button.js +24 -28
- package/framework/components/chui_button/styles.css +5 -5
- package/framework/components/chui_calendar/calendar.js +6 -6
- package/framework/components/chui_card/card.js +14 -14
- package/framework/components/chui_card_scroll/card_scroll.js +169 -0
- package/framework/components/chui_card_scroll/styles.css +86 -0
- package/framework/components/chui_chat/chat.js +73 -51
- package/framework/components/chui_chat/styles.css +18 -7
- package/framework/components/chui_clipboard_history/clipboard_history.js +25 -20
- package/framework/components/chui_clipboard_history/styles.css +10 -8
- package/framework/components/chui_code/code.js +8 -8
- package/framework/components/chui_code/styles.css +2 -2
- package/framework/components/chui_code_editor/code_editor.js +26 -26
- package/framework/components/chui_code_editor/styles.css +3 -3
- package/framework/components/chui_command_palette/command_palette.js +29 -29
- package/framework/components/chui_command_palette/styles.css +5 -5
- package/framework/components/chui_console/console.js +9 -9
- package/framework/components/chui_console/styles.css +5 -2
- package/framework/components/chui_content_block/content_block.js +2 -2
- package/framework/components/chui_context_menu/context_menu.js +162 -54
- package/framework/components/chui_context_menu/styles.css +82 -8
- package/framework/components/chui_custom_element/custom_element.js +11 -11
- package/framework/components/chui_data_grid/data_grid.js +268 -268
- package/framework/components/chui_data_grid/styles.css +14 -14
- package/framework/components/chui_descriptions/styles.css +1 -1
- package/framework/components/chui_details/details.js +12 -12
- package/framework/components/chui_details/styles.css +7 -7
- package/framework/components/chui_diff_viewer/diff_viewer.js +88 -88
- package/framework/components/chui_diff_viewer/styles.css +9 -9
- package/framework/components/chui_divider/divider.js +6 -6
- package/framework/components/chui_divider/styles.css +2 -2
- package/framework/components/chui_drawer/drawer.js +37 -14
- package/framework/components/chui_drawer/styles.css +18 -4
- package/framework/components/chui_drop_zone/drop_zone.js +6 -6
- package/framework/components/chui_drop_zone/styles.css +10 -6
- package/framework/components/chui_fieldset/fieldset.js +6 -6
- package/framework/components/chui_fieldset/styles.css +5 -5
- package/framework/components/chui_file_explorer/file_explorer.js +115 -115
- package/framework/components/chui_file_explorer/styles.css +6 -6
- package/framework/components/chui_form/form.js +11 -11
- package/framework/components/chui_gantt/gantt.js +41 -41
- package/framework/components/chui_gantt/styles.css +5 -5
- package/framework/components/chui_graphs/graphs.js +82 -46
- package/framework/components/chui_graphs/styles.css +26 -5
- package/framework/components/chui_hero/hero.js +63 -20
- package/framework/components/chui_hero/styles.css +176 -7
- package/framework/components/chui_html_block/html_block.js +5 -5
- package/framework/components/chui_html_block/styles.css +1 -1
- package/framework/components/chui_hx/styles.css +2 -2
- package/framework/components/chui_icons/icons.js +7 -7
- package/framework/components/chui_icons/styles.css +2 -1
- package/framework/components/chui_inputs/chui_check_box/styles.css +12 -3
- package/framework/components/chui_inputs/chui_chips/chips.js +92 -31
- package/framework/components/chui_inputs/chui_chips/styles.css +28 -5
- package/framework/components/chui_inputs/chui_color_picker/color_picker.js +20 -15
- package/framework/components/chui_inputs/chui_color_picker/styles.css +7 -7
- package/framework/components/chui_inputs/chui_combo_box/combo_box.js +58 -58
- package/framework/components/chui_inputs/chui_combo_box/styles.css +9 -9
- package/framework/components/chui_inputs/chui_date/date.js +93 -95
- package/framework/components/chui_inputs/chui_date/styles.css +8 -8
- package/framework/components/chui_inputs/chui_date_range/date_range.js +22 -22
- package/framework/components/chui_inputs/chui_date_range/styles.css +3 -3
- package/framework/components/chui_inputs/chui_datetime/datetime.js +12 -12
- package/framework/components/chui_inputs/chui_datetime/styles.css +3 -3
- package/framework/components/chui_inputs/chui_email/email.js +10 -10
- package/framework/components/chui_inputs/chui_email/styles.css +6 -6
- package/framework/components/chui_inputs/chui_file/file.js +8 -8
- package/framework/components/chui_inputs/chui_file/styles.css +12 -9
- package/framework/components/chui_inputs/chui_hotkey/hotkey.js +39 -39
- package/framework/components/chui_inputs/chui_hotkey/styles.css +6 -6
- package/framework/components/chui_inputs/chui_masked/masked.js +44 -44
- package/framework/components/chui_inputs/chui_masked/styles.css +5 -5
- package/framework/components/chui_inputs/chui_mention/mention.js +13 -13
- package/framework/components/chui_inputs/chui_mention/styles.css +14 -8
- package/framework/components/chui_inputs/chui_multi_combo_box/multi_combo_box.js +147 -137
- package/framework/components/chui_inputs/chui_multi_combo_box/styles.css +14 -8
- package/framework/components/chui_inputs/chui_number/number.js +42 -45
- package/framework/components/chui_inputs/chui_number/styles.css +6 -6
- package/framework/components/chui_inputs/chui_otp/otp.js +32 -32
- package/framework/components/chui_inputs/chui_otp/styles.css +5 -5
- package/framework/components/chui_inputs/chui_password/password.js +30 -36
- package/framework/components/chui_inputs/chui_password/styles.css +7 -7
- package/framework/components/chui_inputs/chui_radio_button/styles.css +2 -2
- package/framework/components/chui_inputs/chui_rating/rating.js +28 -28
- package/framework/components/chui_inputs/chui_rating/styles.css +3 -3
- package/framework/components/chui_inputs/chui_select_box/select_box.js +54 -54
- package/framework/components/chui_inputs/chui_select_box/styles.css +10 -10
- package/framework/components/chui_inputs/chui_slider/slider.js +14 -14
- package/framework/components/chui_inputs/chui_slider/styles.css +5 -4
- package/framework/components/chui_inputs/chui_text/styles.css +7 -7
- package/framework/components/chui_inputs/chui_text/text.js +13 -17
- package/framework/components/chui_inputs/chui_text_area/styles.css +8 -8
- package/framework/components/chui_inputs/chui_text_area/text_area.js +23 -23
- package/framework/components/chui_inputs/chui_time/styles.css +13 -17
- package/framework/components/chui_inputs/chui_time/time.js +35 -24
- package/framework/components/chui_inputs/chui_toggle/styles.css +10 -3
- package/framework/components/chui_inputs/chui_toggle/toggle.js +16 -16
- package/framework/components/chui_json_editor/json_editor.js +87 -87
- package/framework/components/chui_json_editor/styles.css +5 -5
- package/framework/components/chui_json_viewer/json_viewer.js +80 -80
- package/framework/components/chui_json_viewer/styles.css +6 -6
- package/framework/components/chui_kanban/kanban.js +27 -27
- package/framework/components/chui_kanban/styles.css +8 -4
- package/framework/components/chui_kbd/styles.css +1 -1
- package/framework/components/chui_label/label.js +17 -17
- package/framework/components/chui_label/styles.css +1 -1
- package/framework/components/chui_link/link.js +9 -9
- package/framework/components/chui_link/styles.css +11 -4
- package/framework/components/chui_list/list.js +11 -11
- package/framework/components/chui_list/styles.css +2 -2
- package/framework/components/chui_markdown_editor/markdown_editor.js +66 -66
- package/framework/components/chui_markdown_editor/styles.css +5 -5
- package/framework/components/chui_media/audio.js +240 -246
- package/framework/components/chui_media/audio_styles.css +41 -23
- package/framework/components/chui_media/image.js +49 -46
- package/framework/components/chui_media/image_compare.js +35 -35
- package/framework/components/chui_media/image_compare_styles.css +5 -5
- package/framework/components/chui_media/image_styles.css +1 -1
- package/framework/components/chui_media/video.js +148 -148
- package/framework/components/chui_media/video_styles.css +27 -11
- package/framework/components/chui_menu_bar/menu_bar.js +54 -54
- package/framework/components/chui_menu_bar/styles.css +10 -10
- package/framework/components/chui_message_bar/message_bar.js +551 -0
- package/framework/components/chui_message_bar/styles.css +248 -0
- package/framework/components/chui_modal/modal.js +37 -13
- package/framework/components/chui_notification/notification.js +76 -54
- package/framework/components/chui_notification/notification_download.js +26 -81
- package/framework/components/chui_notification/notification_download_card.js +115 -0
- package/framework/components/chui_notification/notification_download_progress.css +2 -2
- package/framework/components/chui_notification/notification_download_progress.js +70 -108
- package/framework/components/chui_notification/notification_update.js +31 -31
- package/framework/components/chui_notification/status_plate.css +3 -3
- package/framework/components/chui_notification/styles.css +6 -1
- package/framework/components/chui_notification/styles_download.css +1 -1
- package/framework/components/chui_notification/styles_update.css +2 -2
- package/framework/components/chui_org_chart/org_chart.js +29 -29
- package/framework/components/chui_org_chart/styles.css +2 -2
- package/framework/components/chui_pagination/pagination.js +3 -3
- package/framework/components/chui_pagination/styles.css +1 -1
- package/framework/components/chui_paragraph/styles.css +2 -2
- package/framework/components/chui_popover/popover.js +29 -23
- package/framework/components/chui_popover/styles.css +1 -1
- package/framework/components/chui_popups/popups.js +124 -124
- package/framework/components/chui_popups/styles.css +5 -5
- package/framework/components/chui_print_button/print_button.js +15 -10
- package/framework/components/chui_progress_bar/progress_bar.js +34 -12
- package/framework/components/chui_progress_bar/styles.css +4 -4
- package/framework/components/chui_progress_ring/progress_ring.js +15 -15
- package/framework/components/chui_progress_ring/styles.css +1 -1
- package/framework/components/chui_qrcode/qrcode.js +12 -12
- package/framework/components/chui_query_builder/query_builder.js +46 -46
- package/framework/components/chui_query_builder/styles.css +4 -4
- package/framework/components/chui_radio_group/styles.css +1 -1
- package/framework/components/chui_result/result.js +15 -15
- package/framework/components/chui_result/styles.css +3 -3
- package/framework/components/chui_scheduler/scheduler.js +74 -74
- package/framework/components/chui_scheduler/styles.css +5 -5
- package/framework/components/chui_screen_spinner/screen_spinner.js +167 -0
- package/framework/components/chui_screen_spinner/styles.css +49 -0
- package/framework/components/chui_segmented_control/segmented_control.js +63 -6
- package/framework/components/chui_segmented_control/styles.css +32 -6
- package/framework/components/chui_settings/settings.js +45 -46
- package/framework/components/chui_settings/styles.css +4 -4
- package/framework/components/chui_shortcut_help/shortcut_help.js +32 -34
- package/framework/components/chui_sidebar_nav/sidebar_nav.js +98 -29
- package/framework/components/chui_sidebar_nav/styles.css +9 -3
- package/framework/components/chui_slideshow/slideshow.js +85 -85
- package/framework/components/chui_slideshow/styles.css +6 -6
- package/framework/components/chui_spinner/spinner.js +10 -10
- package/framework/components/chui_split_button/split_button.js +30 -12
- package/framework/components/chui_split_button/styles.css +21 -5
- package/framework/components/chui_splitter/splitter.js +11 -11
- package/framework/components/chui_splitter/styles.css +2 -2
- package/framework/components/chui_statistic/statistic.js +47 -47
- package/framework/components/chui_status_bar/styles.css +2 -2
- package/framework/components/chui_stepper/stepper.js +202 -31
- package/framework/components/chui_stepper/styles.css +79 -14
- package/framework/components/chui_sticky_bar/sticky_bar.js +44 -13
- package/framework/components/chui_sticky_bar/styles.css +10 -8
- package/framework/components/chui_tabs/chui_tabs.js +74 -26
- package/framework/components/chui_tabs/styles.css +40 -12
- package/framework/components/chui_text_editor/styles.css +7 -7
- package/framework/components/chui_text_editor/text_editor.js +56 -56
- package/framework/components/chui_text_editor/text_editor_panel.js +173 -174
- package/framework/components/chui_theme_toggle/theme_toggle.js +21 -5
- package/framework/components/chui_timeline/styles.css +3 -1
- package/framework/components/chui_toast_queue/styles.css +11 -11
- package/framework/components/chui_toast_queue/toast_queue.js +30 -27
- package/framework/components/chui_toolbar/styles.css +2 -2
- package/framework/components/chui_tooltip/styles.css +2 -2
- package/framework/components/chui_tooltip/tooltip.js +3 -3
- package/framework/components/chui_tour/styles.css +8 -8
- package/framework/components/chui_tour/tour.js +72 -72
- package/framework/components/chui_transfer/styles.css +6 -6
- package/framework/components/chui_transfer/transfer.js +93 -106
- package/framework/components/chui_tree_table/styles.css +4 -4
- package/framework/components/chui_tree_table/tree_table.js +45 -45
- package/framework/components/chui_tree_view/styles.css +10 -8
- package/framework/components/chui_tree_view/tree_view.js +185 -183
- package/framework/components/chui_user_bar/styles.css +145 -0
- package/framework/components/chui_user_bar/user_bar.js +402 -0
- package/framework/components/chui_user_list_bar/styles.css +173 -0
- package/framework/components/chui_user_list_bar/user_list_bar.js +485 -0
- package/framework/components/chui_watermark/watermark.js +17 -17
- package/framework/components/chui_webview/webview.js +9 -9
- package/framework/components/chui_write_bar/styles.css +172 -0
- package/framework/components/chui_write_bar/write_bar.js +320 -0
- package/framework/main_window.js +1234 -0
- package/framework/modules/chui_a11y/chui_a11y.js +78 -79
- package/framework/modules/chui_animations/animations.js +77 -15
- package/framework/modules/chui_animations/motion.js +120 -0
- package/framework/modules/chui_animations/styles.css +36 -3
- package/framework/modules/chui_functions.js +31 -27
- package/framework/modules/chui_highlight/styles.css +13 -10
- package/framework/modules/chui_i18n/chui_i18n.js +3 -3
- package/framework/modules/chui_i18n/locales/feedback.js +62 -0
- package/framework/modules/chui_i18n/locales/navigation.js +4 -0
- package/framework/modules/chui_json/chui_json.js +2 -2
- package/framework/modules/chui_logger/chui_logger.js +23 -8
- package/framework/modules/chui_page/page.js +10 -10
- package/framework/modules/chui_palette/palette.js +61 -0
- package/framework/modules/chui_qr/chui_qr.js +23 -23
- package/framework/modules/chui_scrollbar/chui_scrollbar.js +45 -45
- package/framework/modules/chui_scrollbar/styles.css +3 -3
- package/framework/modules/chui_services/chui_services.js +8 -8
- package/framework/modules/chui_services/desktop.js +77 -71
- package/framework/modules/chui_sortable/chui_sortable.js +17 -17
- package/framework/modules/chui_validate/chui_validate.js +3 -3
- package/framework/tray_bar/chui_menu_items.js +2 -2
- package/index.d.ts +266 -34
- package/index.js +20 -1168
- package/package.json +6 -4
- package/framework/components/telegram_bot/chui_telegram_bot.js +0 -191
|
@@ -17,18 +17,18 @@ const { setStyles, optionOr } = require("../../modules/chui_functions");
|
|
|
17
17
|
* а события — через `addEventListener()`.
|
|
18
18
|
*/
|
|
19
19
|
class Video {
|
|
20
|
-
#
|
|
21
|
-
#
|
|
20
|
+
#chuiVpMain = document.createElement("chui_vp_main");
|
|
21
|
+
#chuiVt = document.createElement("video");
|
|
22
22
|
// Плавающая полоса управления
|
|
23
|
-
#
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
#
|
|
23
|
+
#chuiVpPanel = document.createElement("chui_vp_panel");
|
|
24
|
+
#chuiVpPlayPause = document.createElement("chui_vp_play_pause");
|
|
25
|
+
#chuiVpTime = undefined;
|
|
26
|
+
#chuiVpProgress = document.createElement("chui_vp_progress");
|
|
27
|
+
#chuiVpSeek = document.createElement("input");
|
|
28
|
+
#chuiVpSeekBuf = document.createElement("chui_vp_seek_buf");
|
|
29
|
+
#chuiVpVolumeIcon = document.createElement("chui_vp_volume_icon");
|
|
30
|
+
#chuiVpVolume = document.createElement("input");
|
|
31
|
+
#chuiVpFullMode = document.createElement("chui_vp_full_mode");
|
|
32
32
|
// Состояние
|
|
33
33
|
#controls = true;
|
|
34
34
|
#destroyed = false;
|
|
@@ -60,47 +60,47 @@ class Video {
|
|
|
60
60
|
setStyles(__dirname + "/video_styles.css", "chUiJS_Video");
|
|
61
61
|
// Плеер — именованная группа: своих ролей у панели нет, а без имени скринридер
|
|
62
62
|
// читает подряд безымянные кнопки без контекста
|
|
63
|
-
this.#
|
|
64
|
-
this.#
|
|
65
|
-
this.#
|
|
66
|
-
this.#
|
|
67
|
-
if (options.src !== undefined) this.#
|
|
68
|
-
if (options.poster !== undefined) this.#
|
|
69
|
-
if (options.autoplay !== undefined) this.#
|
|
70
|
-
if (options.loop !== undefined) this.#
|
|
71
|
-
if (options.muted !== undefined) this.#
|
|
72
|
-
this.#
|
|
63
|
+
this.#chuiVpMain.setAttribute("role", "group");
|
|
64
|
+
this.#chuiVpMain.setAttribute("aria-label", optionOr(options.label, I18n.t("media.videoPlayer")));
|
|
65
|
+
this.#chuiVt.preload = "metadata";
|
|
66
|
+
this.#chuiVt.controls = false;
|
|
67
|
+
if (options.src !== undefined) this.#chuiVt.setAttribute("src", options.src);
|
|
68
|
+
if (options.poster !== undefined) this.#chuiVt.setAttribute("poster", options.poster);
|
|
69
|
+
if (options.autoplay !== undefined) this.#chuiVt.autoplay = options.autoplay === true;
|
|
70
|
+
if (options.loop !== undefined) this.#chuiVt.loop = options.loop === true;
|
|
71
|
+
if (options.muted !== undefined) this.#chuiVt.muted = options.muted === true;
|
|
72
|
+
this.#chuiVt.volume = options.volume === undefined ? 0.5 : Math.min(1, Math.max(0, Number(options.volume)));
|
|
73
73
|
// Размеры кадра — стилем: опции принимают и проценты, и `-webkit-fill-available`
|
|
74
|
-
if (options.width !== undefined) this.#
|
|
75
|
-
if (options.height !== undefined) this.#
|
|
76
|
-
this.#
|
|
74
|
+
if (options.width !== undefined) this.#chuiVt.style.width = options.width;
|
|
75
|
+
if (options.height !== undefined) this.#chuiVt.style.height = options.height;
|
|
76
|
+
this.#chuiVpMain.appendChild(this.#chuiVt);
|
|
77
77
|
this.#buildPanel();
|
|
78
|
-
this.#
|
|
78
|
+
this.#chuiVpMain.appendChild(this.#chuiVpPanel);
|
|
79
79
|
// О смене состояния и ошибках сообщает скрытый live-регион
|
|
80
80
|
this.#status.classList.add("chui_visually_hidden");
|
|
81
81
|
this.#status.setAttribute("role", "status");
|
|
82
82
|
this.#status.setAttribute("aria-live", "polite");
|
|
83
|
-
this.#
|
|
83
|
+
this.#chuiVpMain.appendChild(this.#status);
|
|
84
84
|
// СОБЫТИЯ
|
|
85
|
-
this.#
|
|
86
|
-
this.#
|
|
87
|
-
this.#
|
|
88
|
-
this.#
|
|
89
|
-
this.#
|
|
90
|
-
this.#
|
|
91
|
-
this.#
|
|
92
|
-
this.#
|
|
85
|
+
this.#chuiVt.addEventListener("play", this.#onPlay);
|
|
86
|
+
this.#chuiVt.addEventListener("pause", this.#onPause);
|
|
87
|
+
this.#chuiVt.addEventListener("timeupdate", this.#onTimeUpdate);
|
|
88
|
+
this.#chuiVt.addEventListener("durationchange", this.#onDurationChange);
|
|
89
|
+
this.#chuiVt.addEventListener("loadedmetadata", this.#onDurationChange);
|
|
90
|
+
this.#chuiVt.addEventListener("progress", this.#onBuffered);
|
|
91
|
+
this.#chuiVt.addEventListener("volumechange", () => this.#renderVolume());
|
|
92
|
+
this.#chuiVt.addEventListener("error", () => {
|
|
93
93
|
Log.error(`[Video] не удалось прочитать дорожку: ${this.getSrc()}`);
|
|
94
94
|
this.#setStatus(I18n.t("media.videoNotPlaying", { reason: I18n.t("media.error.sourceFailed") }));
|
|
95
95
|
});
|
|
96
|
-
this.#
|
|
97
|
-
this.#
|
|
96
|
+
this.#chuiVpMain.addEventListener("mouseenter", this.#onEnter);
|
|
97
|
+
this.#chuiVpMain.addEventListener("mouseleave", this.#onLeave);
|
|
98
98
|
// Панель не должна прятаться, пока в ней стоит клавиатурный фокус
|
|
99
|
-
this.#
|
|
100
|
-
this.#
|
|
101
|
-
this.#
|
|
102
|
-
this.#
|
|
103
|
-
this.#
|
|
99
|
+
this.#chuiVpMain.addEventListener("focusin", this.#onEnter);
|
|
100
|
+
this.#chuiVpMain.addEventListener("focusout", this.#onLeave);
|
|
101
|
+
this.#chuiVpPlayPause.addEventListener("click", () => this.#playPause());
|
|
102
|
+
this.#chuiVpVolumeIcon.addEventListener("click", () => this.setMuted(!this.getMuted()));
|
|
103
|
+
this.#chuiVpFullMode.addEventListener("click", () => this.#toggleFullscreen());
|
|
104
104
|
this.#setSliderMax();
|
|
105
105
|
this.setControls(options.controls === undefined ? true : options.controls === true);
|
|
106
106
|
this.#renderPlayState(false);
|
|
@@ -108,46 +108,46 @@ class Video {
|
|
|
108
108
|
}
|
|
109
109
|
/** Полоса управления: кнопки, полоса прогресса, время, громкость, полный экран */
|
|
110
110
|
#buildPanel() {
|
|
111
|
-
this.#setButton(this.#
|
|
112
|
-
this.#setButton(this.#
|
|
113
|
-
this.#setButton(this.#
|
|
114
|
-
this.#
|
|
115
|
-
this.#
|
|
116
|
-
this.#
|
|
117
|
-
this.#
|
|
118
|
-
this.#
|
|
119
|
-
this.#
|
|
120
|
-
this.#
|
|
121
|
-
this.#
|
|
111
|
+
this.#setButton(this.#chuiVpPlayPause, I18n.t("media.play"), Icons.AUDIO_VIDEO.PLAY_ARROW);
|
|
112
|
+
this.#setButton(this.#chuiVpVolumeIcon, I18n.t("media.mute"), Icons.AUDIO_VIDEO.VOLUME_UP);
|
|
113
|
+
this.#setButton(this.#chuiVpFullMode, I18n.t("media.fullscreen"), Icons.NAVIGATION.FULLSCREEN);
|
|
114
|
+
this.#chuiVpTime = new Label({ text: this.#calculateTime(0) });
|
|
115
|
+
this.#chuiVpSeek.type = "range";
|
|
116
|
+
this.#chuiVpSeek.id = "chui_vp_seek";
|
|
117
|
+
this.#chuiVpSeek.max = "0";
|
|
118
|
+
this.#chuiVpSeek.value = "0";
|
|
119
|
+
this.#chuiVpSeek.setAttribute("aria-label", I18n.t("media.position"));
|
|
120
|
+
this.#chuiVpSeek.addEventListener("input", () => {
|
|
121
|
+
this.#chuiVt.currentTime = Number(this.#chuiVpSeek.value);
|
|
122
122
|
this.#renderProgress();
|
|
123
123
|
});
|
|
124
|
-
this.#
|
|
125
|
-
this.#
|
|
126
|
-
this.#
|
|
127
|
-
this.#
|
|
128
|
-
this.#
|
|
129
|
-
this.#
|
|
130
|
-
this.#
|
|
131
|
-
this.#
|
|
132
|
-
this.#
|
|
133
|
-
this.#
|
|
124
|
+
this.#chuiVpProgress.appendChild(this.#chuiVpSeek);
|
|
125
|
+
this.#chuiVpProgress.appendChild(this.#chuiVpSeekBuf);
|
|
126
|
+
this.#chuiVpVolume.type = "range";
|
|
127
|
+
this.#chuiVpVolume.id = "chui_vp_volume";
|
|
128
|
+
this.#chuiVpVolume.max = "100";
|
|
129
|
+
this.#chuiVpVolume.value = String(Math.round(this.#chuiVt.volume * 100));
|
|
130
|
+
this.#chuiVpVolume.setAttribute("aria-label", I18n.t("media.volume"));
|
|
131
|
+
this.#chuiVpVolume.addEventListener("input", () => {
|
|
132
|
+
this.#chuiVt.volume = Number(this.#chuiVpVolume.value) / 100;
|
|
133
|
+
this.#chuiVt.muted = false;
|
|
134
134
|
});
|
|
135
135
|
//
|
|
136
|
-
this.#
|
|
137
|
-
this.#
|
|
138
|
-
this.#
|
|
139
|
-
this.#
|
|
140
|
-
this.#
|
|
141
|
-
this.#
|
|
136
|
+
this.#chuiVpPanel.appendChild(this.#chuiVpPlayPause);
|
|
137
|
+
this.#chuiVpPanel.appendChild(this.#chuiVpProgress);
|
|
138
|
+
this.#chuiVpPanel.appendChild(this.#chuiVpTime.set());
|
|
139
|
+
this.#chuiVpPanel.appendChild(this.#chuiVpVolumeIcon);
|
|
140
|
+
this.#chuiVpPanel.appendChild(this.#chuiVpVolume);
|
|
141
|
+
this.#chuiVpPanel.appendChild(this.#chuiVpFullMode);
|
|
142
142
|
}
|
|
143
143
|
// === ПАНЕЛЬ И ПОЛОСЫ ===
|
|
144
144
|
/** Полоса показывается, пока курсор над плеером или фокус в нём (состояние — класс) */
|
|
145
145
|
#openPanel() {
|
|
146
146
|
if (!this.#controls) return;
|
|
147
|
-
this.#
|
|
147
|
+
this.#chuiVpMain.classList.add("vp_panel_open");
|
|
148
148
|
}
|
|
149
149
|
#closePanel() {
|
|
150
|
-
this.#
|
|
150
|
+
this.#chuiVpMain.classList.remove("vp_panel_open");
|
|
151
151
|
}
|
|
152
152
|
#playPause = async () => {
|
|
153
153
|
if (this.getPaused()) await this.play();
|
|
@@ -158,26 +158,26 @@ class Video {
|
|
|
158
158
|
else await this.exitFullscreen();
|
|
159
159
|
};
|
|
160
160
|
#renderPlayState(playing) {
|
|
161
|
-
this.#setIcon(this.#
|
|
162
|
-
this.#setLabel(this.#
|
|
161
|
+
this.#setIcon(this.#chuiVpPlayPause, playing ? Icons.AUDIO_VIDEO.PAUSE : Icons.AUDIO_VIDEO.PLAY_ARROW);
|
|
162
|
+
this.#setLabel(this.#chuiVpPlayPause, playing ? I18n.t("media.pause") : I18n.t("media.play"));
|
|
163
163
|
}
|
|
164
164
|
#renderVolume = () => {
|
|
165
|
-
const доля = Math.min(100, Math.max(0, Math.round(this.#
|
|
166
|
-
this.#
|
|
167
|
-
this.#
|
|
168
|
-
this.#
|
|
165
|
+
const доля = Math.min(100, Math.max(0, Math.round(this.#chuiVt.volume * 100)));
|
|
166
|
+
this.#chuiVpVolume.value = String(доля);
|
|
167
|
+
this.#chuiVpVolume.disabled = this.getMuted();
|
|
168
|
+
this.#chuiVpMain.style.setProperty("--volume_before_width", `${доля}%`);
|
|
169
169
|
this.#setIcon(
|
|
170
|
-
this.#
|
|
171
|
-
this.getMuted() || this.#
|
|
170
|
+
this.#chuiVpVolumeIcon,
|
|
171
|
+
this.getMuted() || this.#chuiVt.volume === 0 ? Icons.AUDIO_VIDEO.VOLUME_OFF : Icons.AUDIO_VIDEO.VOLUME_UP
|
|
172
172
|
);
|
|
173
|
-
this.#
|
|
173
|
+
this.#chuiVpVolumeIcon.setAttribute("aria-label", I18n.t(this.getMuted() ? "media.unmute" : "media.mute"));
|
|
174
174
|
};
|
|
175
175
|
#displayBufferedAmount = () => {
|
|
176
|
-
const max = Number(this.#
|
|
176
|
+
const max = Number(this.#chuiVpSeek.max);
|
|
177
177
|
if (!(max > 0)) return;
|
|
178
178
|
try {
|
|
179
|
-
const end = Math.floor((this.#
|
|
180
|
-
this.#
|
|
179
|
+
const end = Math.floor((this.#chuiVt.buffered.end(0) / max) * 100);
|
|
180
|
+
this.#chuiVpSeekBuf.style.width = `${Math.min(100, Math.max(0, end))}%`;
|
|
181
181
|
} catch (_error) {
|
|
182
182
|
// Буфер ещё пуст — рисовать нечего
|
|
183
183
|
}
|
|
@@ -187,26 +187,26 @@ class Video {
|
|
|
187
187
|
#setSliderMax = () => {
|
|
188
188
|
const duration = this.getDuration();
|
|
189
189
|
const known = Number.isFinite(duration) && duration > 0;
|
|
190
|
-
this.#
|
|
190
|
+
this.#chuiVpSeek.max = known ? String(Math.floor(duration)) : "0";
|
|
191
191
|
// Без известной длительности ползунок бессмысленен: перетаскивание отправляло бы плеер в начало
|
|
192
|
-
this.#
|
|
192
|
+
this.#chuiVpSeek.disabled = !known;
|
|
193
193
|
};
|
|
194
194
|
#renderProgress = () => {
|
|
195
|
-
const max = Number(this.#
|
|
195
|
+
const max = Number(this.#chuiVpSeek.max);
|
|
196
196
|
const position = this.getCurrentTime();
|
|
197
197
|
const duration = this.getDuration();
|
|
198
198
|
if (!(max > 0)) {
|
|
199
199
|
// «0:07 / 0:00» читалось бы как поломка: у источника без длительности показываем только прошедшее
|
|
200
|
-
this.#
|
|
201
|
-
this.#
|
|
200
|
+
this.#chuiVpTime.setText(this.#calculateTime(position));
|
|
201
|
+
this.#chuiVpMain.style.setProperty("--seek_before_width", "0%");
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
|
-
this.#
|
|
205
|
-
this.#
|
|
204
|
+
this.#chuiVpTime.setText(`${this.#calculateTime(position)} / ${this.#calculateTime(duration)}`);
|
|
205
|
+
this.#chuiVpSeek.value = String(Math.floor(position));
|
|
206
206
|
// Доля ограничена сотней: `max` — округлённая длительность, а позиция идёт дальше,
|
|
207
207
|
// и без ограничения полоса целиком заливалась акцентом
|
|
208
208
|
const доля = Math.min(100, Math.max(0, Math.floor((position / max) * 100)));
|
|
209
|
-
this.#
|
|
209
|
+
this.#chuiVpMain.style.setProperty("--seek_before_width", `${доля}%`);
|
|
210
210
|
};
|
|
211
211
|
#calculateTime = (secs) => {
|
|
212
212
|
const seconds = Number.isFinite(Number(secs)) ? Number(secs) : 0;
|
|
@@ -219,12 +219,12 @@ class Video {
|
|
|
219
219
|
this.#status.innerText = text;
|
|
220
220
|
}
|
|
221
221
|
#setButton(node, label, icon) {
|
|
222
|
-
node.innerHTML = new Icon(icon
|
|
222
|
+
node.innerHTML = new Icon(icon).getHTML();
|
|
223
223
|
node.setAttribute("aria-label", label);
|
|
224
224
|
makeKeyboardButton(node);
|
|
225
225
|
}
|
|
226
|
-
#setIcon(node, icon
|
|
227
|
-
const glyph = new Icon(icon
|
|
226
|
+
#setIcon(node, icon) {
|
|
227
|
+
const glyph = new Icon(icon).getHTML();
|
|
228
228
|
if (node.innerHTML !== glyph) node.innerHTML = glyph;
|
|
229
229
|
}
|
|
230
230
|
#setLabel(node, label) {
|
|
@@ -235,7 +235,7 @@ class Video {
|
|
|
235
235
|
/** Полоса управления: `false` — панели нет вовсе, остаётся только кадр */
|
|
236
236
|
setControls(boolean = Boolean()) {
|
|
237
237
|
this.#controls = boolean === true;
|
|
238
|
-
this.#
|
|
238
|
+
this.#chuiVpMain.classList.toggle("vp_controls_off", !this.#controls);
|
|
239
239
|
if (!this.#controls) this.#closePanel();
|
|
240
240
|
return this;
|
|
241
241
|
}
|
|
@@ -245,151 +245,151 @@ class Video {
|
|
|
245
245
|
// === СТАНДАРТНЫЕ ВОЗМОЖНОСТИ `<video>` ===
|
|
246
246
|
/** Сам элемент: для всего, чего нет в списке ниже */
|
|
247
247
|
getVideo() {
|
|
248
|
-
return this.#
|
|
248
|
+
return this.#chuiVt;
|
|
249
249
|
}
|
|
250
250
|
/** Воспроизведение: промис, как у `<video>` (разрешается, когда воспроизведение началось) */
|
|
251
251
|
play() {
|
|
252
|
-
return this.#
|
|
252
|
+
return this.#chuiVt.play();
|
|
253
253
|
}
|
|
254
254
|
pause() {
|
|
255
|
-
this.#
|
|
255
|
+
this.#chuiVt.pause();
|
|
256
256
|
return this;
|
|
257
257
|
}
|
|
258
258
|
load() {
|
|
259
|
-
this.#
|
|
259
|
+
this.#chuiVt.load();
|
|
260
260
|
return this;
|
|
261
261
|
}
|
|
262
262
|
canPlayType(type = String()) {
|
|
263
|
-
return this.#
|
|
263
|
+
return this.#chuiVt.canPlayType(type);
|
|
264
264
|
}
|
|
265
265
|
getSrc() {
|
|
266
|
-
return this.#
|
|
266
|
+
return this.#chuiVt.getAttribute("src") ?? "";
|
|
267
267
|
}
|
|
268
268
|
setSrc(url = String()) {
|
|
269
|
-
this.#
|
|
270
|
-
this.#
|
|
269
|
+
this.#chuiVt.setAttribute("src", url);
|
|
270
|
+
this.#chuiVt.load();
|
|
271
271
|
return this;
|
|
272
272
|
}
|
|
273
273
|
getSrcObject() {
|
|
274
|
-
return this.#
|
|
274
|
+
return this.#chuiVt.srcObject;
|
|
275
275
|
}
|
|
276
276
|
/** Живой поток (камера, `getUserMedia`) — штатное `srcObject`, а не путь */
|
|
277
277
|
setSrcObject(object) {
|
|
278
|
-
this.#
|
|
278
|
+
this.#chuiVt.srcObject = object;
|
|
279
279
|
return this;
|
|
280
280
|
}
|
|
281
281
|
getPoster() {
|
|
282
|
-
return this.#
|
|
282
|
+
return this.#chuiVt.getAttribute("poster") ?? "";
|
|
283
283
|
}
|
|
284
284
|
setPoster(url = String()) {
|
|
285
|
-
if (url === "") this.#
|
|
286
|
-
else this.#
|
|
285
|
+
if (url === "") this.#chuiVt.removeAttribute("poster");
|
|
286
|
+
else this.#chuiVt.setAttribute("poster", url);
|
|
287
287
|
return this;
|
|
288
288
|
}
|
|
289
289
|
getCurrentTime() {
|
|
290
|
-
return this.#
|
|
290
|
+
return this.#chuiVt.currentTime;
|
|
291
291
|
}
|
|
292
292
|
setCurrentTime(seconds = Number()) {
|
|
293
|
-
this.#
|
|
293
|
+
this.#chuiVt.currentTime = Number(seconds);
|
|
294
294
|
// Подписи и заливка не ждут `timeupdate`: перемотка из кода видна сразу
|
|
295
295
|
this.#renderProgress();
|
|
296
296
|
return this;
|
|
297
297
|
}
|
|
298
298
|
getDuration() {
|
|
299
|
-
return this.#
|
|
299
|
+
return this.#chuiVt.duration;
|
|
300
300
|
}
|
|
301
301
|
getBuffered() {
|
|
302
|
-
return this.#
|
|
302
|
+
return this.#chuiVt.buffered;
|
|
303
303
|
}
|
|
304
304
|
getPaused() {
|
|
305
|
-
return this.#
|
|
305
|
+
return this.#chuiVt.paused;
|
|
306
306
|
}
|
|
307
307
|
getEnded() {
|
|
308
|
-
return this.#
|
|
308
|
+
return this.#chuiVt.ended;
|
|
309
309
|
}
|
|
310
310
|
getReadyState() {
|
|
311
|
-
return this.#
|
|
311
|
+
return this.#chuiVt.readyState;
|
|
312
312
|
}
|
|
313
313
|
getVolume() {
|
|
314
|
-
return this.#
|
|
314
|
+
return this.#chuiVt.volume;
|
|
315
315
|
}
|
|
316
316
|
setVolume(value = Number()) {
|
|
317
|
-
this.#
|
|
317
|
+
this.#chuiVt.volume = Math.min(1, Math.max(0, Number(value)));
|
|
318
318
|
return this;
|
|
319
319
|
}
|
|
320
320
|
getMuted() {
|
|
321
|
-
return this.#
|
|
321
|
+
return this.#chuiVt.muted;
|
|
322
322
|
}
|
|
323
323
|
setMuted(boolean = Boolean()) {
|
|
324
|
-
this.#
|
|
324
|
+
this.#chuiVt.muted = boolean === true;
|
|
325
325
|
return this;
|
|
326
326
|
}
|
|
327
327
|
getPlaybackRate() {
|
|
328
|
-
return this.#
|
|
328
|
+
return this.#chuiVt.playbackRate;
|
|
329
329
|
}
|
|
330
330
|
setPlaybackRate(rate = Number()) {
|
|
331
|
-
this.#
|
|
331
|
+
this.#chuiVt.playbackRate = Number(rate);
|
|
332
332
|
return this;
|
|
333
333
|
}
|
|
334
334
|
getDefaultPlaybackRate() {
|
|
335
|
-
return this.#
|
|
335
|
+
return this.#chuiVt.defaultPlaybackRate;
|
|
336
336
|
}
|
|
337
337
|
setDefaultPlaybackRate(rate = Number()) {
|
|
338
|
-
this.#
|
|
338
|
+
this.#chuiVt.defaultPlaybackRate = Number(rate);
|
|
339
339
|
return this;
|
|
340
340
|
}
|
|
341
341
|
getLoop() {
|
|
342
|
-
return this.#
|
|
342
|
+
return this.#chuiVt.loop;
|
|
343
343
|
}
|
|
344
344
|
setLoop(boolean = Boolean()) {
|
|
345
|
-
this.#
|
|
345
|
+
this.#chuiVt.loop = boolean === true;
|
|
346
346
|
return this;
|
|
347
347
|
}
|
|
348
348
|
getAutoplay() {
|
|
349
|
-
return this.#
|
|
349
|
+
return this.#chuiVt.autoplay;
|
|
350
350
|
}
|
|
351
351
|
setAutoplay(boolean = Boolean()) {
|
|
352
|
-
this.#
|
|
352
|
+
this.#chuiVt.autoplay = boolean === true;
|
|
353
353
|
return this;
|
|
354
354
|
}
|
|
355
355
|
getWidth() {
|
|
356
|
-
return getComputedStyle(this.#
|
|
356
|
+
return getComputedStyle(this.#chuiVt).width;
|
|
357
357
|
}
|
|
358
358
|
setWidth(value = String()) {
|
|
359
|
-
this.#
|
|
359
|
+
this.#chuiVt.style.width = value;
|
|
360
360
|
return this;
|
|
361
361
|
}
|
|
362
362
|
getHeight() {
|
|
363
|
-
return getComputedStyle(this.#
|
|
363
|
+
return getComputedStyle(this.#chuiVt).height;
|
|
364
364
|
}
|
|
365
365
|
setHeight(value = String()) {
|
|
366
|
-
this.#
|
|
366
|
+
this.#chuiVt.style.height = value;
|
|
367
367
|
return this;
|
|
368
368
|
}
|
|
369
369
|
getFullscreen() {
|
|
370
|
-
return this.#
|
|
370
|
+
return this.#chuiVpMain === document.fullscreenElement;
|
|
371
371
|
}
|
|
372
372
|
/** Полный экран — на весь плеер, а не на кадр: иначе полоса управления осталась бы снаружи */
|
|
373
373
|
requestFullscreen() {
|
|
374
|
-
return this.#
|
|
374
|
+
return this.#chuiVpMain.requestFullscreen({ navigationUI: "hide" });
|
|
375
375
|
}
|
|
376
376
|
exitFullscreen() {
|
|
377
377
|
return document.exitFullscreen();
|
|
378
378
|
}
|
|
379
379
|
addEventListener(type = String(), listener = () => {}) {
|
|
380
|
-
this.#
|
|
380
|
+
this.#chuiVt.addEventListener(type, listener);
|
|
381
381
|
return this;
|
|
382
382
|
}
|
|
383
383
|
removeEventListener(type = String(), listener = () => {}) {
|
|
384
|
-
this.#
|
|
384
|
+
this.#chuiVt.removeEventListener(type, listener);
|
|
385
385
|
return this;
|
|
386
386
|
}
|
|
387
387
|
set() {
|
|
388
|
-
return this.#
|
|
388
|
+
return this.#chuiVpMain;
|
|
389
389
|
}
|
|
390
390
|
detach() {
|
|
391
391
|
this.pause();
|
|
392
|
-
this.#
|
|
392
|
+
this.#chuiVpMain.remove();
|
|
393
393
|
return this;
|
|
394
394
|
}
|
|
395
395
|
/** Остановить плеер и снять свои обработчики. Повторный вызов безопасен */
|
|
@@ -397,18 +397,18 @@ class Video {
|
|
|
397
397
|
if (this.#destroyed) return this;
|
|
398
398
|
this.#destroyed = true;
|
|
399
399
|
this.pause();
|
|
400
|
-
this.#
|
|
401
|
-
this.#
|
|
402
|
-
this.#
|
|
403
|
-
this.#
|
|
404
|
-
this.#
|
|
405
|
-
this.#
|
|
406
|
-
this.#
|
|
407
|
-
this.#
|
|
408
|
-
this.#
|
|
409
|
-
this.#
|
|
410
|
-
this.#
|
|
411
|
-
this.#
|
|
400
|
+
this.#chuiVt.removeEventListener("play", this.#onPlay);
|
|
401
|
+
this.#chuiVt.removeEventListener("pause", this.#onPause);
|
|
402
|
+
this.#chuiVt.removeEventListener("timeupdate", this.#onTimeUpdate);
|
|
403
|
+
this.#chuiVt.removeEventListener("durationchange", this.#onDurationChange);
|
|
404
|
+
this.#chuiVt.removeEventListener("loadedmetadata", this.#onDurationChange);
|
|
405
|
+
this.#chuiVt.removeEventListener("progress", this.#onBuffered);
|
|
406
|
+
this.#chuiVpMain.removeEventListener("mouseenter", this.#onEnter);
|
|
407
|
+
this.#chuiVpMain.removeEventListener("mouseleave", this.#onLeave);
|
|
408
|
+
this.#chuiVpMain.removeEventListener("focusin", this.#onEnter);
|
|
409
|
+
this.#chuiVpMain.removeEventListener("focusout", this.#onLeave);
|
|
410
|
+
this.#chuiVt.removeAttribute("src");
|
|
411
|
+
this.#chuiVt.load();
|
|
412
412
|
return this;
|
|
413
413
|
}
|
|
414
414
|
}
|
|
@@ -11,11 +11,11 @@ chui_vp_main {
|
|
|
11
11
|
display: block;
|
|
12
12
|
width: 100%;
|
|
13
13
|
border-radius: var(--radius_md);
|
|
14
|
-
background: var(--
|
|
14
|
+
background: var(--player_background);
|
|
15
15
|
border: 1px solid var(--border_color);
|
|
16
16
|
overflow: hidden;
|
|
17
|
-
--
|
|
18
|
-
--
|
|
17
|
+
--seek_before_width: 0%;
|
|
18
|
+
--volume_before_width: 0%;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/* Кадр занимает всю ширину, а высоту считает соотношение сторон: прежде элемент показывал
|
|
@@ -50,7 +50,7 @@ chui_vp_panel {
|
|
|
50
50
|
`pointer-events` гасим вместе с прозрачностью — иначе невидимая полоса ловит щелчки */
|
|
51
51
|
opacity: 0;
|
|
52
52
|
pointer-events: none;
|
|
53
|
-
transition: opacity var(--
|
|
53
|
+
transition: opacity var(--motion_fast) var(--motion_ease);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
chui_vp_main.vp_panel_open chui_vp_panel {
|
|
@@ -78,6 +78,14 @@ chui_vp_full_mode {
|
|
|
78
78
|
border-radius: var(--radius_sm);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
/* Кегль глифа — ключом плеера: у `chui_icon` есть своё правило (размер шапки),
|
|
82
|
+
поэтому размер задаётся значку, а не кнопке. Прежде число стояло в коде */
|
|
83
|
+
chui_vp_play_pause chui_icon,
|
|
84
|
+
chui_vp_volume_icon chui_icon,
|
|
85
|
+
chui_vp_full_mode chui_icon {
|
|
86
|
+
font-size: var(--player_icon_size);
|
|
87
|
+
}
|
|
88
|
+
|
|
81
89
|
/* Главная кнопка — светлый круг с глифом цвета подложки, как у Audio: он адаптивен к схеме
|
|
82
90
|
и не спорит с акцентом полосы прогресса */
|
|
83
91
|
chui_vp_play_pause {
|
|
@@ -158,7 +166,7 @@ chui_vp_seek_buf {
|
|
|
158
166
|
width: 0;
|
|
159
167
|
height: var(--player_track_height);
|
|
160
168
|
border-radius: var(--radius_pill);
|
|
161
|
-
background: var(--
|
|
169
|
+
background: var(--player_slider_buffer_background);
|
|
162
170
|
position: absolute;
|
|
163
171
|
/* На те же полголовки ползунка, что и дорожка: иначе буфер выступал бы слева */
|
|
164
172
|
inset-inline-start: 6px;
|
|
@@ -203,8 +211,8 @@ chui_vp_seek_buf {
|
|
|
203
211
|
#chui_vp_seek {
|
|
204
212
|
background-image: linear-gradient(
|
|
205
213
|
to right,
|
|
206
|
-
var(--blue_prime_background) 0 var(--
|
|
207
|
-
var(--
|
|
214
|
+
var(--blue_prime_background) 0 var(--seek_before_width, 0%),
|
|
215
|
+
var(--player_slider_background) var(--seek_before_width, 0%) 100%
|
|
208
216
|
);
|
|
209
217
|
}
|
|
210
218
|
|
|
@@ -213,8 +221,8 @@ chui_vp_seek_buf {
|
|
|
213
221
|
#chui_vp_volume {
|
|
214
222
|
background-image: linear-gradient(
|
|
215
223
|
to right,
|
|
216
|
-
var(--text_color) 0 var(--
|
|
217
|
-
var(--
|
|
224
|
+
var(--text_color) 0 var(--volume_before_width, 0%),
|
|
225
|
+
var(--player_slider_background) var(--volume_before_width, 0%) 100%
|
|
218
226
|
);
|
|
219
227
|
}
|
|
220
228
|
|
|
@@ -222,8 +230,8 @@ chui_vp_seek_buf {
|
|
|
222
230
|
#chui_vp_volume:disabled {
|
|
223
231
|
background-image: linear-gradient(
|
|
224
232
|
to right,
|
|
225
|
-
var(--
|
|
226
|
-
var(--
|
|
233
|
+
var(--player_slider_buffer_background) 0 var(--volume_before_width, 0%),
|
|
234
|
+
var(--player_slider_background) var(--volume_before_width, 0%) 100%
|
|
227
235
|
);
|
|
228
236
|
}
|
|
229
237
|
|
|
@@ -248,6 +256,14 @@ chui_vp_seek_buf {
|
|
|
248
256
|
box-shadow: 0 0 0 2px var(--header_background);
|
|
249
257
|
cursor: pointer;
|
|
250
258
|
margin-top: calc((var(--player_track_height) - 9px) / 2);
|
|
259
|
+
/* Рост под курсором — тот же переход: своё время у ручки есть только здесь,
|
|
260
|
+
общее правило до псевдоэлемента бегунка не достаёт */
|
|
261
|
+
transition:
|
|
262
|
+
height var(--motion_fast) var(--motion_ease),
|
|
263
|
+
width var(--motion_fast) var(--motion_ease),
|
|
264
|
+
margin-top var(--motion_fast) var(--motion_ease),
|
|
265
|
+
background-color var(--motion_fast) var(--motion_ease),
|
|
266
|
+
box-shadow var(--motion_fast) var(--motion_ease);
|
|
251
267
|
}
|
|
252
268
|
|
|
253
269
|
/* У выключенной полосы ползунка нет: она и так приглушена заливкой */
|