// ==UserScript== // @name LZT style 2019 // @description LZT back style 2019 // @namespace http://tampermonkey.net/ // @version 1.3.2 // @icon https://lolz.live/styles/brand/download/avatars/three_avatar.svg // @author https://lolz.live/tekumi/ // @match https://lolz.live/* // @grant GM_addStyle // @grant unsafeWindow // @run-at document-start // @license LZT // @downloadURL https://update.greasyfork.org/scripts/554560/LZT%20style%202019.user.js // @updateURL https://update.greasyfork.org/scripts/554560/LZT%20style%202019.meta.js // ==/UserScript== (function() { 'use strict'; const win = typeof unsafeWindow !== 'undefined' ? unsafeWindow : window; function activatePreviewTooltips() { document.querySelectorAll('.PreviewTooltip:not([data-tooltip-init])').forEach(link => { if (win.XenForo && win.XenForo.PreviewTooltip && win.jQuery) { try { new win.XenForo.PreviewTooltip(win.jQuery(link)); link.setAttribute('data-tooltip-init', 'true'); } catch(e) {} } }); } function disableControlsStyles() { for (let sheet of document.styleSheets) { try { const rules = sheet.cssRules || sheet.rules; for (let i = rules.length - 1; i >= 0; i--) { const rule = rules[i]; if (rule.selectorText && (rule.selectorText.includes('.discussionListMainPage .discussionListItem .controls') || rule.selectorText.includes('.discussionListItem--Wrapper:hover .controls'))) { sheet.deleteRule(i); } } } catch(e) {} } } function applyBackground() { const bgUrl = localStorage.getItem('customBackground'); let bgElement = document.getElementById('customBgLayer'); if (bgUrl) { if (!bgElement) { bgElement = document.createElement('div'); bgElement.id = 'customBgLayer'; const insertBg = () => { try { if (document.body && !document.getElementById('customBgLayer')) { document.body.prepend(bgElement); } } catch(e) {} }; if (document.body) { insertBg(); } else { const obs = new MutationObserver((mutations, observer) => { if (document.body) { insertBg(); observer.disconnect(); } }); obs.observe(document.documentElement, { childList: true, subtree: true }); } } bgElement.style.cssText = ` position: fixed; top: 0; left: 0; z-index: -2; width: 100%; height: 100vh; background: linear-gradient(rgb(54 54 54 / .85), rgb(54 54 54 / .85)), url(${bgUrl}); background-size: cover; background-position: center; background-repeat: no-repeat; `; } else if (bgElement) { bgElement.remove(); } } try { applyBackground(); } catch(e) {} function updateRoundingClasses() { const hotContainer = document.querySelector('.hotThreadsContainer'); const textAdsMain = document.querySelector('.text_Ads-main'); const latestThreadsFirst = document.querySelector('.latestThreads._insertLoadedContent .discussionListItem:first-child'); if (!hotContainer) return; const isHidden = hotContainer.classList.contains('hidden'); if (textAdsMain) { if (isHidden) { textAdsMain.classList.add('hot-hidden'); } else { textAdsMain.classList.remove('hot-hidden'); } } if (latestThreadsFirst) { if (isHidden) { latestThreadsFirst.classList.add('hot-hidden'); } else { latestThreadsFirst.classList.remove('hot-hidden'); } } } window.addEventListener('load', () => { disableControlsStyles(); setTimeout(disableControlsStyles, 500); applyBackground(); updateRoundingClasses(); }); GM_addStyle(` .text_Ads { margin-bottom: 0px !important; border-radius: 0px !important; } .text_Ads-main { margin-bottom: 0px !important; border-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border-bottom-left-radius: 8px !important; border-bottom-right-radius: 8px !important; } .text_Ads-main.hot-hidden { border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; } .text_Ads-main .discussionListItem:first-child { border-top-left-radius: 8px !important; border-top-right-radius: 8px !important; } .text_Ads-main .discussionListItem:last-child { border-bottom-left-radius: 8px !important; border-bottom-right-radius: 8px !important; } .text_Ads-main.hot-hidden .discussionListItem:last-child { border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; } .latestThreads._insertLoadedContent .discussionListItem:first-child { border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; } .latestThreads._insertLoadedContent .discussionListItem:first-child:not(.hot-hidden) { border-top-left-radius: 8px !important; border-top-right-radius: 8px !important; } .discussionListItem[data-converted="true"] .listBlock.main .title { margin-left: 15px !important; display: flex !important; align-items: center !important; gap: 2px !important; flex-wrap: nowrap !important; min-width: 0 !important; } .discussionListItem[data-converted="true"] .listBlock.main .title .threadPrefixes { flex-shrink: 0 !important; white-space: nowrap !important; display: flex !important; gap: 2px !important; position: relative !important; } .discussionListItem[data-converted="true"] .listBlock.main .title .spanTitle { flex-shrink: 1 !important; min-width: 0 !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; } .discussionListItem[data-converted="true"] .listBlock.main .title .hot { margin-right: 6px !important; flex-shrink: 0 !important; color: #ff6b35 !important; } .discussionListItem[data-converted="true"] .listBlock.main .secondRow { margin-left: 15px !important; align-items: center !important; flex-wrap: nowrap !important; gap: 4px !important; } .discussionListItem[data-converted="true"] .listBlock.main .secondRow .info-separator { margin: 0 2px !important; } .discussionListItem[data-converted="true"] .listBlock.main .secondRow .zindex-block-main-forum-title { white-space: nowrap !important; } .discussionListItem[data-converted="true"] { margin-bottom: 0px !important; border-radius: 0px !important; } .discussionListItem[data-converted="true"] .discussionListItem--Wrapper { margin-bottom: 0px !important; border-radius: 0px !important; } .discussionListItem[data-converted="true"] .listBlock { border-radius: 0px !important; } .discussionListItem[data-converted="true"]:first-child { border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; } .index .aboveThread-main { border-radius: 8px 8px 0px 0px !important; } .aboveThread-main { padding: 16px; margin-bottom: 0px; border-radius: 8px !important; } .hotThreadsContainer { margin-top: 12px; } .hotThreadsContainer.hidden { display: none !important; } .discussionListItem[data-converted="true"] .forum-name-prefix-wrapper { position: absolute !important; right: 205px !important; top: 8px !important; opacity: 0 !important; transition: .15s !important; z-index: 100 !important; } .discussionListItem[data-converted="true"]:hover .forum-name-prefix-wrapper { opacity: 1 !important; } .discussionListItem[data-converted="true"] .forum-name-prefix { background: #505050 !important; font-size: 11.5px !important; font-weight: 600 !important; padding: 2px 7px !important; line-height: 18px !important; border-radius: 6px; display: inline-block !important; white-space: nowrap !important; } #feedUpdateNotification { position: fixed; top: 20px; right: 20px; background: #2a2a2a; color: #d6d6d6; padding: 12px 20px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); z-index: 10000; opacity: 0; transition: opacity 0.3s ease; pointer-events: none; } #feedUpdateNotification.show { opacity: 1; } @media (max-width: 610px) { .Responsive .discussionListMainPage .discussionListItem .controls { margin: unset; display: none; } } `); function extractTimestamp(threadItem) { const headerBottoms = threadItem.querySelectorAll('.threadHeaderBottom'); for (let headerBottom of headerBottoms) { const allElements = headerBottom.querySelectorAll('*'); for (let el of allElements) { if (el.children.length === 0) { const text = el.textContent.trim(); if (text && (text.includes('назад') || text.includes('сегодня') || text.includes('вчера') || text.match(/в \d{1,2}:\d{2}/) || text.includes('Только что') || text.match(/^\d+\s+сек/) || text.match(/^\d+\s+мин/) || text.match(/^\d+\s+час/) || text.match(/^\d+\s+\w+\s+\d{4}/) || text.match(/^\d+\s+янв|^\d+\s+фев|^\d+\s+мар|^\d+\s+апр|^\d+\s+май|^\d+\s+июн|^\d+\s+июл|^\d+\s+авг|^\d+\s+сен|^\d+\s+окт|^\d+\s+ноя|^\d+\s+дек/i))) { return text; } } } } return ''; } function getReplyCount(threadItem) { const threadCounters = threadItem.querySelector('.threadCounters'); if (threadCounters) { const replyCounter = threadCounters.querySelector('.counter:not(.LikeLink)'); if (replyCounter) { const valueEl = replyCounter.querySelector('.value'); if (valueEl) { return valueEl.textContent.trim(); } } } return '0'; } function getLikeCount(threadItem) { const threadCounters = threadItem.querySelector('.threadCounters'); if (threadCounters) { const likeLink = threadCounters.querySelector('.LikeLink'); if (likeLink) { const valueEl = likeLink.querySelector('.LikeLabel.value'); if (valueEl) { return valueEl.textContent.trim(); } } } return '0'; } function isLikesSection(threadItem) { const threadCounters = threadItem.querySelector('.threadCounters'); if (threadCounters) { const likeLink = threadCounters.querySelector('.LikeLink'); if (likeLink) { const like2Icon = likeLink.querySelector('.like2Icon'); return like2Icon !== null; } } return false; } function isHotThread(threadItem) { return threadItem.classList.contains('hot') || threadItem.querySelector('.hot') !== null || threadItem.classList.contains('isHot'); } function isLockedThread(threadItem) { return threadItem.classList.contains('locked') || threadItem.querySelector('.iconKey.fa-lock') !== null; } function convertThreadItem(threadItem) { if (threadItem.hasAttribute('data-converted')) return; const threadMain = threadItem.querySelector('.threadMessage, .threadMain'); if (!threadMain) { setTimeout(() => { if (!threadItem.querySelector('.threadMessage, .threadMain')) { threadItem.remove(); } }, 500); return; } const threadId = threadItem.id; const dataAuthor = threadItem.getAttribute('data-author'); const classes = threadItem.className; const titleLink = threadItem.querySelector('.threadHeaderTitle a'); if (!titleLink) { threadItem.remove(); return; } const prefixesElement = titleLink.querySelector('.threadPrefixes'); let prefixesHTML = prefixesElement ? prefixesElement.outerHTML : ''; let threadTitle = titleLink.textContent.trim(); if (prefixesElement) { const prefixText = prefixesElement.textContent.trim(); threadTitle = threadTitle.replace(prefixText, '').trim(); } let threadUrl = titleLink.getAttribute('href'); if (!threadUrl || threadUrl === '#') { const altLink = threadItem.querySelector('a[href*="posts/"]'); if (altLink) { threadUrl = altLink.getAttribute('href'); } } let previewUrl = threadUrl.replace('/unread', ''); if (previewUrl.endsWith('/')) { previewUrl = previewUrl.slice(0, -1); } const creatorLink = threadItem.querySelector('.threadHeaderUsernameBlock .username, .thread_creator_mobile_hidden .username'); if (!creatorLink) { threadItem.remove(); return; } const creatorUsernameHTML = creatorLink.innerHTML; const creatorUrl = creatorLink.getAttribute('href'); const creatorAvatar = threadItem.querySelector('.threadHeaderAvatar a.avatar, .zindex-block-main2.threadHeaderAvatar a.avatar'); const timestamp = extractTimestamp(threadItem); let bumpTime = ''; let forumName = ''; let forumUrl = ''; const headerBottom = threadItem.querySelector('.threadHeaderBottom'); if (headerBottom) { const mutedElements = headerBottom.querySelectorAll('.muted'); for (let el of mutedElements) { const text = el.textContent.trim(); if (text.includes('поднята') || text.includes('обновлена')) { bumpTime = text.replace('поднята', '').replace('обновлена', '').trim(); break; } } const forumLink = headerBottom.querySelector('a[href*="forums/"]'); if (forumLink) { forumName = forumLink.textContent.trim(); forumUrl = forumLink.getAttribute('href'); } } let forumPrefixHTML = ''; if (forumName) { forumPrefixHTML = `