UI changes

Test resizing AH/DLP/SB/SV/QQ ui for mobile and remove a few buttons

Устаревшая версия за 03.09.2025. Перейдите к последней версии.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey, Greasemonkey или Violentmonkey.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey или Violentmonkey.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey или Violentmonkey.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey или Userscripts.

Чтобы установить этот скрипт, сначала вы должны установить расширение браузера, например Tampermonkey.

Чтобы установить этот скрипт, вы должны установить расширение — менеджер скриптов.

(у меня уже есть менеджер скриптов, дайте мне установить скрипт!)

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

(у меня уже есть менеджер стилей, дайте мне установить скрипт!)

// ==UserScript==
// @name        UI changes
// @description Test resizing AH/DLP/SB/SV/QQ ui for mobile and remove a few buttons
// @author      C89sd
// @version     1.14
// @namespace   https://greasyfork.org/users/1376767
// @match       https://*.alternatehistory.com/*
// @match       https://*.spacebattles.com/*
// @match       https://*.darklordpotter.net/*
// @match       https://*.questionablequesting.com/*
// @match       https://*.sufficientvelocity.com/*
// @grant       GM_addStyle
// @run-at      document-start
// @noframes
// ==/UserScript==
'use strict';

// Default dark mode text colors:
// SV 230, SB 204, QQ 177
const c = 217; // I like 217, 224

const IS_AH = window.location.hostname === 'www.alternatehistory.com'

const DM = window.getComputedStyle(document.body).color.match(/\d+/g)[0] > 128;

const textColor = DM ? `
.actionBar-set.actionBar-set--external .actionBar-actionBar, .message-footer .message-actionBar .actionBar-set a,  .block-tabHeader.block-tabHeader--threadmarkCategoryTabs .tabs-tab, .block--messages .message-cell--threadmark-header, .node-statsMeta .pairs > dt, .structItem-cell .pairs > dt, .js-tagList .tagItem, .pairJustifier .pairs > dt,  .p-body-header .p-description, .block-container , .structItem-minor .structItem-parts a,  .structItem-cell.structItem-cell--main ul.structItem-statuses .structItem-status::before,  .message-cell--main, li, ul, div, time, .structItem-tagBlock .tagItem.labelLink, .structItem-minor .username , .pairs.pairs--justified dt a.hl-base, .pairs.pairs--justified dd a.hl-base, .pairs.pairs--justified dd {
    color: rgb(${c},${c},${c});
}` : ''

const css = textColor + `
#XF, #XenForo { font-size: 0.9375em !important;  }

html, body { font-size: 15px !important;  line-height: 1.3 !important; }

h1.p-title-value { font-size: 18px !important; }
.threadmarkListingHeader-content.threadmarkListingHeader-content--info.with-icon { display: none !important; } /* QQ: hide title below img */


.structItem-title, .node-title {    font-size: ${ IS_AH ? '15px' : '14px' } !important; }
.structItem-minor, .node-meta, .node-extra  {    font-size: 12px !important; line-height: 1.3 !important; }
.structItem-pageJump { font-size: 10px !important; }
.tagItem {             font-size: 10px !important; }
.structItem-cell {     font-size: 12px !important; }
.pageNavSimple-el {    font-size: 12px !important; }
.p-breadcrumbs { font-size: 12px !important; }

.button--link { font-size: 12px !important;}
.threadmarkListingHeader-contentLink { font-size: 12px !important; }
#top, .inputGroup, .input--inline { font-size: 12px !important; }

.structItem-tagBlock {
  padding-top: 4px !important;
  display: block !important;
}

:root {
  --padTOP: 1px;
  --padBOTTOM: 2px;
}
.structItem-cell--icon {
  width: 54px !important;
  padding: calc(10px + var(--padTOP)) 9px 10px 9px !important;       /* ADD TOP PADDING */
}

.structItem-cell--main, .node-main {
  padding-top: calc(5px + var(--padTOP)) !important;        /* ADD TOP PADDING */
  padding-bottom: 2px !important;

}
.structItem-cell--latest, .structItem-cell--meta {
  padding-right: 8px !important;
  padding-bottom: calc(8px + var(--padBOTTOM)) !important;    /* ADD BOTTOM PADDING */
}


/* Remove ignore button */
.structItem-ignore  { display: none !important; }
`;

GM_addStyle(css);

document.querySelectorAll('.link--external[target="_blank"]').forEach(link => {
  link.removeAttribute('target');
});

// Replace 'Thread Tools' with 'Mark threadmarks read'
const A = Array.from(document.querySelectorAll('.menuTrigger')).find(e => e.textContent.toLowerCase() === 'thread tools');
const B = Array.from(document.querySelectorAll('.menu-linkRow')).find(e => e.textContent === 'Mark threadmarks read');
if (A && B) {
  A.classList.remove('menuTrigger');
  A.style.display = 'flex';
  A.textContent = B.textContent;
  A.addEventListener('click', function(e) {
    e.stopPropagation();
    e.preventDefault();
    B.click();
  });
}

// Remove thread ignore button.
const btn = document.querySelector('.button--link[data-sk-ignore="Ignore"]');
if (btn) btn.remove();