Dark VK Theme

Тёмная тема для VK

Tính đến 15-12-2019. Xem phiên bản mới nhất.

// ==UserScript==
// @name          Dark VK Theme
// @description	  Тёмная тема для VK
// @author        DygDyg
// @homepage      http://dygdyg.ddns.net
// @include       https://vk.com/*
// @require       https://code.jquery.com/jquery-3.3.1.min.js
// @icon          https://vk.com/images/icons/favicons/fav_logo.ico
// @version       0.0.9.4
// @run-at        document-start
// @grant         GM_setValue
// @grant         GM_getValue
// @grant         GM_addStyle
// @grant 		  GM_info
// @grant         GM_unregisterMenuCommand
// @grant         GM_registerMenuCommand
// @grant         GM_openInTab
// @namespace https://greasyfork.org/users/303755
// ==/UserScript==

var $ = window.jQuery;

/*{
    "enable": true,
    "names": "[\"пример1\",\"пример2\",\"пример3\",\"пример4\",\"пример5\" ]"
}*/

if (GM_getValue('enable', null) == null) GM_setValue('enable', false);
if (GM_getValue('names', null) == null) GM_setValue('names', JSON.stringify([]));

/*function update() { window.open('https://greasyfork.org/ru/scripts/392169-dark-vk-theme/versions'); }
function autor() { window.open('https://vk.com/dygdyg'); }
function UP() { window.open('https://greasyfork.org/scripts/392169-dark-vk-theme/code/Dark%20VK%20Theme.user.js'); }

GM_registerMenuCommand("Установленная версия: " + GM_info.script.version, update);
GM_registerMenuCommand("Страница автора", autor);
GM_registerMenuCommand("Обновить/переустановить", UP);*/

GM_addStyle(`.dark-theme-box { position: fixed; white-space: nowrap; z-index: 200; height: 42px; top: 0; left: 0; padding: 0 5px 0 10px; line-height: 42px; } .dark-theme-box a {color: red}`);


let darkStyle = GM_addStyle(`

.ui_rmenu_item,
.olist_item_name,
.ui_rmenu_subitem
{
    color: #afc6dc !important;
}

.ui_rmenu_item:hover,
.ui_rmenu_subitem:hover,
.ui_rmenu_item_sel,
.ui_rmenu_item_sel:hover,
.olist_item_wrap:hover,
.box_title_wrap.box_grey
{
    background-color: #4a76a8 !important;
}

    body,
    #top_profile_menu,
    .thumbed_link__label,
    textarea,
    .mv_info,
    .media_link__label
    .online.mobile:after,
    .media_link__label,
    .im-mess.im-mess_light,
    .nim-dialog:not(.nim-dialog_deleted).nim-dialog_unread.nim-dialog_classic,
    div.fc_tab_txt,
    #wk_box,
    .pv_cont .pv_comments_header,
    .Button--mobile:hover,
    .ListItem--active,
    .EditableLabel:hover .EditableLabel__text,
    .ListItem--can-be-hovered.ListItem--selectable:hover,
    .result_list ul li.active,
    .mail_box_cont,
    .info_msg
    {
        background: #2f2f2f !important;
        box-shadow: 2px 7px 3px rgba(0,0,0,.1);
    }

    .flat_button.secondary,
    .deep_active .replies .reply_fakebox,
    .ui_tabs.ui_tabs_box,
    .prefix_input_wrap,
    .audio_row:hover:not(.audio_row__current) .audio_row_content,
    .audio_page__shuffle_all .audio_page__shuffle_all_button:hover,
    .audio_layer_container .audio_friend:hover,
    .ui_search_sugg_list .ui_search_suggestion_selected,
    .top_notify_cont .feedback_row:not(.dld):hover,
    .feedback_row_clickable:not(.feedback_row_touched):hover,
    .audio_row.audio_row__current .audio_row_content,
    .page_actions_item:hover:not(.grey_hoverable),
    .nim-dialog.nim-dialog_classic.nim-dialog_unread-out .nim-dialog--inner-text,
    .fc_tab,
    .tabbed_box .summary_tab_sel .summary_tab2,
    .feedback_row_wrap.unread:not(.feedback_row_touched),
    .tabbed_box .summary_tab a:hover,
    .tabbed_box .summary_tab .summary_tab3:hover,
    .photos_container .photos_row,
    .tabbed_box .summary_tab_sel .summary_tab3:hover,
    .my_current_info:hover
    {
        background-color: #2f2f2f !important;
        box-shadow: 2px 7px 3px rgba(0,0,0,.1);
    }

    body::-webkit-scrollbar
    {
    -webkit-appearance: none;
    width: 11px;
    }

body::-webkit-scrollbar-thumb,
 .ui_scroll_default_theme>.ui_scroll_bar_container>.ui_scroll_bar_outer>.ui_scroll_bar_inner
 {
    border-radius: 3px;
    background-color: #4a76a8;
    transition: background-color 200ms linear, width 150ms linear;
}


    #side_bar ol li .left_row,
    body,
    .ui_rmenu_subitem,
    ._im_to_unread.im-page--dialogs-filter-wrap a,
    /*.top_notify_cont .feedback_header,*/
    .top_notify_cont,
    .wddi_text,
    .module_header .header_top,
    .page_actions_item,
    input,
    textarea,
    .tabbed_box .summary_tab_sel .summary_tab3,
    .ChatSettingsInfo__title,
    .result_list ul li.active,
    .search_filter_main,
    .result_list ul li,
    .search_filter_shut,
    .im-fwd.im-fwd_msg .im-fwd--messages,
    .links-list__title,
    .top_profile_mrow
    {
        color: #cacaca !important;
    }

    #side_bar ol li .left_row:hover
    {
        color: #292929 !important;
        background: #909090 !important;
        box-shadow: 2px 7px 3px rgba(0,0,0,.1);
    }

    .eltt,
    .pv_author_block,
    .pv_cont .narrow_column,
    .wall_module .reply_form,
    .top_notify_show_all,
    .ui_tabs_header,
    .box_body,
    input,
    .wall_module .reply_fakebox_wrap,
    .pv_cont .narrow_column,
    .wall_module .reply_box,
    .mention_tt_actions,
    .group_l_row,
    .group_tokens_row,
    .groups_edit_event_log_page .groups_edit_event_log_controls,
    .ui_search_sugg_list,
    .links-list__item:hover,
    .online.mobile:after,
    .stl_active.over_fast #stl_bg,
    .profile_info_header,
    .profile_info_edit,
    .fc_msgs,
    #groups_menu_items .groups_edit_menu_items .group_apps_list_row_drag_wrapper,
    #group_apps_list .group_apps_list_rows.group_apps_list_rows_multi .group_apps_list_row_drag_wrapper,
    .box_controls
        {
            background-color: #272727 !important;
        }


    .page_block,
    .ui_search,
    .im-page--toolsw,
    .im-chat-input,
    div[contenteditable=true],
    .im-page .im-page--history-new-bar,
    .im-page .im-page--dialogs-footer.ui_grey_block,
    .audio_page_layout .audio_friends_list,
    #top_notify_wrap,
    .tt_default,
    .wddi,
    .im-chat-input .im-chat-input--txt-wrap,
    .im-page--chat-header,
    .wpost_post,
    .submit_post,
    .im-page .im-page--history-new-bar>span,
    .im-mess.im-mess_unread+.im-mess:before,
    .im-page_classic.im-page .im-page--dcontent,
    .im-mess.im-mess_selected+.im-mess:before,
    .page_block_header,
    .settings_block_footer,
    .page_actions_wrap,
    .im-page_classic.im-page .im-page--chat-body-wrap-inner,
    .im-page .im-page--mess-search,
    .ChatSettings__content,
    .gedit_block_footer,
    .selector_container,
    .result_list ul,
    .List,
    .im-dropbox,
    .im-create .im-create--tabs,
    .im-create,
    .Button--mobile,
    .ChatSettingsMembersWidget,
    .ui_grey_block,
    .ChatSettingsInfo,
    .MessageForward__content
    {
        background: #272727 !important;
    }

    .im-page .im-page--center-empty
    {
        filter: invert(0.845) grayscale(100) !important;
    }
    .ui_actions_menu,
    .nim-dialog:not(.nim-dialog_deleted):hover,
    .ms_items_more,
    div.wdd,
    .ListItem--active,
    .ListItem--border:before,
    .wddi_over
    {
        background: #5a5a5a !important;
    }

    .nim-dialog .nim-dialog--name .nim-dialog--name-w,
    .im-page .im-search-results-head,
    .im-popular--name,
    .ui_actions_menu_item,
    .im-page--title-main-inner,
    .feedback_header b,
    .ui_tabs .ui_tab_sel,
    .page_block_header,
    .settings_block_footer,
    h2,
    #groups_menu_promo .apps_group_catalog_promo_header,
    input.dark,
    .im-page .im-page--mess-search,
    .audio_pl_item2 .audio_pl__subtitle>a
    {
        color: #ffff !important;
    }
    .nim-dialog .nim-dialog--date,
    div[contenteditable=true],
    .nim-dialog .nim-dialog--who,
    .ms_items_more._more_items a,
    .im-replied--text,
    .im-page .im-page--history-new-bar>span,
    .audio_page_player2 .audio_page_player_title_song,
    .ui_tab_default .ui_tab_plain,
    .mv_title,
    .mv_comments_summary,
    .mv_recom_block_title,
    #group_section_menu .module_body .ui_gallery .ui_gallery_item .groups_menu_item .groups_menu_item_title
    {
        color: #e6e6e6 !important;
    }

    .nim-dialog .nim-dialog--preview,
    .top_notify_header,
    .top_notify_cont .feedback_header,
    .feedback_header,
    .Tabs__item--active>*,
    .audio_page_layout .audio_item__title
    {
        color: #949494 !important;
    }

    .ui_actions_menu_item:hover,
    .media_selector .ms_items_more .ms_item:hover,
    /*.top_notify_cont .feedback_row:not(.dld):hover,*/
    .profile_more_info_link:hover
    {
        background-color: #a3a6a9 !important;
        color: #000000 !important;
    }

    .nim-dialog:not(.nim-dialog_deleted).nim-dialog_selected,
    .nim-dialog:not(.nim-dialog_deleted).nim-dialog_hovered
    {
        background: #3d5877 !important;
    }

    a,
    .page_counter .count,
    .subheader, h4.subheader,
    .tt_w,
    .Entity__title,
    .audio_page__shuffle_all .audio_page__shuffle_all_button
    {
        color: #eceff3 !important;
    }

    .im-mess.im-mess_unread:not(.im-mess_light),
    .im-mess.im-mess_selected:last-child:before,
    .im-mess.im-mess_unread:last-child:before,
    .page_actions_header,
    .im-mess.im-mess_selected:not(.im-mess_is_editing),
    .ts_cont_wrap
    {
        background: #252a31 !important;
    }


    #side_bar .more_div,
    .nim-dialog .nim-dialog--content,
    .im-chat-input,
    .ui_rmenu_sep,

    .wall_module .replies_list,
    #ads_left.ads_left_empty+.left_menu_nav_wrap,
    .pv_comments,
    .deep_active .replies .replies_wrap_deep,
    .deep_active .post_replies_header,
    .wddi,
    .wall_module .reply_box,
    .submit_post,
    .mention_tt_actions,
    .im-page .im-page--dialogs-footer,
    .wide_column .topics_module .topic_row,
    .flat_button.ui_load_more_btn,
    .gedit_block_footer,
    .top_profile_sep,
    .nim-dialog:not(.nim-dialog_deleted):hover+.nim-dialog,
    .nim-dialog:not(.nim-dialog_deleted).nim-dialog:hover,
    .page_actions_separator,
    .ui_actions_menu_sep,
    .audio_subscribe_promo,
    .ui_search_sugg_list,
    .top_notify_show_all,
    .feedback_row,
    .wall_module .reply~.reply .reply_wrap,
    .page_actions_inner,
    div.fc_tab_txt,
    .olist_item_wrap:hover,
    .profile_info_block,
    .ui_grey_block,
    .im-page .im-page--mess-search,
    .search_sep,
    .search_row,
    .feed_row~.feed_row .feedback_row_clickable:not(.feedback_row_touched):hover,
    .counts_module
    {
    border-top: 1px solid #464748 !important;
    }

    .deep_active .replies .reply_field_wrap .reply_field,
    .deep_active .replies .reply_fakebox,
    div[contenteditable=true],
    .wdd_list,
    div.wdd,
    .wpost_post,
    .ui_search_new .ui_search_input_inner,
    .module,
    #top_profile_menu,
    .ms_items_more,
    .ui_actions_menu,
    .eltt,
    .ui_search_sugg_list,
    #top_notify_wrap,
    .page_actions_wrap,
    .fc_msgs,
    .fc_tab,
    .tt_default,
    .im-chat-input .im-chat-input--txt-wrap
    {
    border: 1px solid #2f2f2f !important;
    }

    .page_block
    {
    box-shadow: 0 0 0 0 #d7d8db, 0 0 0 0px #e3e4e8 !important;
    }

    .ui_search,
    .im-page--toolsw,
    input.BlockSearchInput,
    .ui_tabs,
    .wide_column .page_top,
    .group_l_row,
    .group_edit_row_sep,
    .page_block_header,
    .group_tokens_row,
    .group_list_row,
    .pv_author_block,
    .mv_actions_block,
    .im-page .im-page--mess-search,
    .olist_item_wrap,
    .Tabs,
    .im-page_classic.im-page .im-page--chat-input,
    .feed_new_posts,
    .feedback_row_clickable:not(.feedback_row_touched):hover,
    .audio_layer_container .audio_page_player_wrap,
    .mv_comments_summary
    {
        border-bottom: 1px solid #2f2f2f !important;
    }


    .mv_info_narrow_column,
    .mv_recom_block_title,
    .im-page_classic.im-page .im-page--header,
    .wall_module .copy_quote
    {
        border-left: 1px solid #272727 !important;
    }

    .audio_page_layout .has_friends_block .audio_page__rows_wrap,
    .im-page_classic.im-page .im-page--header
    {
        border-right: 1px solid #272727 !important;
    }

    .chat_onl_inner
    {   /* убираем «быстрые диалоги» */
        display:none !important;
    }

    .page_photos_module
    {
    padding: 15px 15px 15px !important;
    }

    #page_header_cont .back,
    .page_avatar_img,
    .stl_active.over_fast #stl_bg,
    #profile_message_send,
    .stories_feed_preview_item,
    .post_img,
    .page_post_sized_thumbs,
    .im-page--header-more .ui_actions_menu,
    .nim-dialog:not(.nim-dialog_deleted).nim-dialog:hover,
    .im-chat-input .ms_items_more,
    .button_blue button,
    .button_gray button,
    .button_light_gray button,
    .flat_button,

    .fc_tab,
    .info_msg,
    .List--border
    {
        box-shadow: 2px 7px 3px rgba(0,0,0,.1);
    }

    .online:after {
        border: 0px solid #ffffff !important;
        box-shadow: 1px 3px 2px 2px rgba(0,0,0,.1);
    }

    .module_body {
    padding: 12px 14px 15px !important;
}

    .im-page_classic.im-page .im-page--dialogs-search,
    .im-page_classic .im-page--chat-header-in,
    .im-chat-input.im-chat-input_classic,
    .nim-dialog.nim-dialog_unread .nim-dialog--unread,
    .ChatSettingsInfo,
    .ChatSettingsMembersWidget,
    .List--border,
    .Button--mobile,
    .im-page_classic.im-page .im-page--chat-body-abs
{
        box-shadow: 2px 7px 3px rgba(0,0,0,.1) !important;
    }

    .im-page_classic .im-page--chat-header,
    .im-page_classic.im-page .im-page--chat-input,
    .nim-dialog:not(.nim-dialog_deleted).nim-dialog.nim-dialog_classic.nim-dialog_unread,
    .nim-dialog:not(.nim-dialog_deleted).nim-dialog_unread.nim-dialog_classic+.nim-dialog,
    .ui_tabs.ui_tabs_box,
    .ListItem--active,
    .ListItem--can-be-hovered.ListItem--selectable:hover,
    .like_cont,
    .photos_container .photos_row,
    .info_msg,
    .ListItem--active,
    .im-page_classic.im-page .im-page--header
    {
        border-top-color: #ffffff00 !important;
        border-color: #ffffff00 !important;
        border-bottom-color: #ffffff00 !important;
        border-left-color: #ffffff00 !important;
        border-right-color: #ffffff00 !important;
    }

    .im-page--back-btn:hover
    {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="9" height="16" viewBox="0 0 9 16" fill="rgb(128,141,153)"><path fill="curentCollor" d="M8 15.9c-.2 0-.4-.1-.6-.3l-7-7c-.3-.3-.3-.9 0-1.2l7-7c.3-.3.9-.3 1.2 0 .3.3.3.9 0 1.2l-6.4 6.4 6.4 6.4c.3.3.3.9 0 1.2-.2.2-.4.3-.6.3z" opacity=".7"/></svg>') 15px 16px no-repeat, linear-gradient(90deg, #2f2f2f 50%, #272727) !important;
    }


    .olist_checkbox
    {
        filter: invert(83%);
    }

`);

//$('#top_logout_link').textContent = 'test';



$(document).ready(function () {

    let names = JSON.parse(GM_getValue('names')).map(v => v.toLowerCase());
    let userName = $('.top_profile_name').text();
    if (names.indexOf(userName.toLowerCase()) > -1) {
        if (darkStyle && darkStyle.id) {
            $(`#${darkStyle.id}`).remove();
        }
    }

    $('#side_bar_inner ol').append($('<div>', { class: 'more_div' })).append($('<li>', { id: 'l_bt' }).append($('<a>', { class: 'left_row' }).on("click", () => { window.open('https://greasyfork.org/ru/scripts/392169-dark-vk-theme')}).append($('<span>', {
        class: 'left_fixer', html: [
            $('<span>', { class: 'left_count_wrap fl_r left_void' }).append($('<span>', { class: 'inl_bl left_count_sign' })),
            $('<span>', { class: 'left_icon fl_l' }),
            $('<span>', { class: 'left_label inl_bl', text: `Версия: ${GM_info.script.version}` })
        ]
    }))))

    $('#side_bar_inner ol').append($('<li>', { id: 'l_bt' }).append($('<a>', { class: 'left_row' }).on("click", () => { window.open('https://vk.com/dygdyg') }).append($('<span>', {
        class: 'left_fixer', html: [
            $('<span>', { class: 'left_count_wrap fl_r left_void' }).append($('<span>', { class: 'inl_bl left_count_sign' })),
            $('<span>', { class: 'left_icon fl_l' }),
            $('<span>', { class: 'left_label inl_bl', text: `Автор темы: DygDyg` })
        ]
    }))))
});