From 65c6b45ff68833d65b7c0a1877e06673b52e584b Mon Sep 17 00:00:00 2001 From: Nguyen Duy Date: Tue, 21 Nov 2023 20:33:05 +0700 Subject: [PATCH] Add source --- assets/social-button.png | Bin 0 -> 3819 bytes index.js | 1 + indie-theme.js | 8 ++ package.json | 23 +++++ src/index.js | 77 ++++++++++++++++ src/theme.css | 193 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 302 insertions(+) create mode 100644 assets/social-button.png create mode 100644 index.js create mode 100644 indie-theme.js create mode 100644 package.json create mode 100644 src/index.js create mode 100644 src/theme.css diff --git a/assets/social-button.png b/assets/social-button.png new file mode 100644 index 0000000000000000000000000000000000000000..8cf51e745d771fac34b0171b346f2ad443d38d90 GIT binary patch literal 3819 zcmZ8kdpOhW8{eEp<`k_t#7iOBw3$WzHIvrX1#2+D4R_LrJn;5r$@! z*c`qTDv@(cYozo#y|Hro?f3ihcU|}OeD3SMpX>SD&wW3~ELRr?g&i6@Kp>EU<6kGS zVkCh;V7{!RSo0D2ToXf>tMgeq@D5c6qO-XDKk@KzTNJ*V8(~ksDe7y<9ebJ3!KT#L z*Y{WXwU-A~KS=B}=-Mm}Gvg@d;m+;w9Xg{1+sLMX5!!Qd=jE$Kt@}P3 z_v`8DscGmQ{mVs0Oe%L7>*C%8vI|YT`*e7-UVv8wffV;Uo;-GzG&WzH75mvr&8{p> z_cSy=CH4f|L4JEXcSYN`CgY2KobH;MUyo*EV(fh>(i3}%aCx}4srT29yxEHKT(F3IbqY!$(i^2ItGotM3 zFD)NLy;UNN9-^J+?-ogKO{Gx|aXT*yexKd5x}JFDNrT3)$DI4e6TA*YHwUh?HC8~I zZ%qpFQ;tW7&Q1#dl@tUuFL|j8Ba|78i7q_tdm?ml_yo<6TxFUYUKfLg`4zk#Ji%q> zIHc4*HWNiKV$hSEQ)xIq(>izq;OCN%okysME8ACNGj_Wl+I%z^0#_0}`P(otrDTEn&WJen zwCHz!ymlyJ;o1u7w}YOA?NyC}tA(o#q*dU1OU^)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000000..5714d64 --- /dev/null +++ b/index.js @@ -0,0 +1 @@ +import './src/index' \ No newline at end of file diff --git a/indie-theme.js b/indie-theme.js new file mode 100644 index 0000000..b7d3c0f --- /dev/null +++ b/indie-theme.js @@ -0,0 +1,8 @@ +/** + * @name indie-theme + * @description A simple and clean theme for Pengu Loader + * @author nomi-san + * @link https://github.com/nomi-san/indie-theme + */ + +export * from 'https://unpkg.com/indie-theme@latest' \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..91349e3 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "indie-theme", + "version": "0.1.0", + "description": "A simple and clean theme for Pengu Loader", + "main": "src/index.js", + "type": "module", + "keywords": [ + "pengu-loader", + "pengu-theme", + "pengu-plugin", + "league-client" + ], + "author": "nomi-san", + "license": "MIT", + "files": [ + "assets/", + "src/" + ], + "exports": { + ".": "./src/index.js", + "./index.js": "./src/index.js" + } +} \ No newline at end of file diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..d71343e --- /dev/null +++ b/src/index.js @@ -0,0 +1,77 @@ +async function delay(t) { + return new Promise(r => setTimeout(r, t)) +} + +function toggleSocial() { + /** @type {HTMLDivElement} */ + let pane = document.querySelector('.lol-social-lower-pane-container') + if (pane != null) { + pane.classList.toggle('hidden') + window.DataStore?.set('__social_hidden', pane.classList.contains('hidden')) + } +} + +/** @returns {Promise} */ +function watchElement(selector, interval = 500) { + return new Promise(async resolve => { + while (true) { + let el = document.querySelector(selector) + if (el != null) { + resolve(el) + break + } + await delay(interval) + } + }) +} + +export async function load() { + watchElement('.bug-report-button') + .then(el => { + let clone = el.cloneNode(true) + el.style.display = 'none' + el.parentNode.appendChild(clone) + clone.addEventListener('click', (e) => { + e.stopPropagation() + e.preventDefault() + toggleSocial() + }, true) + }) + + watchElement('.lol-social-lower-pane-container') + .then(el => { + let hidden = window.DataStore?.get('__social_hidden', false) + if (hidden === true) { + el.classList.add('hidden') + } + }) + + // watchElement('.rcp-fe-viewport-persistent') + // .then(el => { + // console.log('.rcp-fe-viewport-persistent created') + // let mo = new MutationObserver(mutations => { + // mutations.forEach(mutation => { + // mutation.addedNodes.forEach(node => { + // if (node.nodeName === 'IFRAME') { + // /** @type {HTMLIFrameElement} */ + // // todo + // } + // }) + // }) + // }) + // mo.observe(el, { + // childList: true, + // subtree: true + // }) + // }) + + let url = import.meta.url + if (url.startsWith('https://plugins/')) { + import('./theme.css') + } else { + let link = document.createElement('link') + link.setAttribute('rel', 'stylesheet'); + link.setAttribute('href', new URL('./theme.css', url).href); + document.body.appendChild(link) + } +} \ No newline at end of file diff --git a/src/theme.css b/src/theme.css new file mode 100644 index 0000000..4ecbef3 --- /dev/null +++ b/src/theme.css @@ -0,0 +1,193 @@ +.rcp-fe-viewport-main { + width: 100% !important; +} + +lol-uikit-flyout-frame { + z-index: 100; +} + +.bg-current.uikit-background-switcher { + width: 100% !important; +} + +.rcp-fe-viewport-sidebar { + position: fixed; + right: 0px; + z-index: 1; + background: transparent !important; + height: auto !important; +} + +.lol-social-sidebar { + background: transparent !important; +} + +lol-social-avatar { + transform: scale(0.85); +} + +lol-social-roster { + /* padding-bottom: 160px; */ +} + +.v2-header-component { + top: 0 !important; +} + +.v2-header-component .lobby-header-content { + margin-top: 18px !important; +} + +.v2-parties-invite-info-panel { + background: transparent !important; +} + +.parties-invite-info-panel-body { + border-bottom: none !important; +} + +.lobby-header-buttons-container { + position: absolute; + top: calc(90vh - 4px); + right: calc(60vw + 4px); +} + +.alpha-version-panel { + position: fixed; + bottom: 1px; + right: 1px; + width: 223px !important; +} + +.navbar-blur { + display: none; +} + +.navigation-root-component { + border-bottom: none !important; +} + +/* lol-parties-game-info-panel { + display: none !important; +} */ + +.lol-social-lower-pane-container { + position: fixed; + height: 330px; + right: 1px; + bottom: 36px; + width: 223px; + background-image: linear-gradient(rgb(7, 34, 55), rgb(1, 10, 19)); + /* border-top: 2px solid transparent; + border-image: linear-gradient(0deg, rgb(120, 91, 40), rgb(200, 156, 60) 55%, rgb(200, 163, 85) 71%, rgb(200, 170, 110)) 1 / 1 / 0 stretch; */ + box-sizing: border-box; + + /* flex-flow: column-reverse; */ + box-shadow: -14px -13px 39px 6px rgba(0, 0, 0, 0.5); +} + +.lol-social-lower-pane-container.hidden { + display: none; +} + +.bug-report-button { + background-image: url(../assets/social-button.png) !important; +} + +.play-button-component.disabled { + visibility: hidden; +} + +.navigation-root-component { + justify-content: flex-end !important; +} + +lol-uikit-navigation-bar { + width: unset !important; +} + +.right-nav-vertical-rule { + display: none; +} + +.wallet-and-badges { + margin-right: 0 !important; +} + +.wallet-and-badges>* { + margin-left: 8px !important; +} + +.main-navigation-menu-item, +.wallet-and-badges, +.ticker-button, +lol-social-panel>* { + opacity: .2; +} + +.main-navigation-menu-item:hover, +.main-navigation-menu-item[active], +.wallet-and-badges:hover, +.ticker-button:hover, +lol-social-panel>*:hover { + opacity: .8; +} + +.style-profile-skin-picker-button { + z-index: 100; +} + +.loot-content-wrapper, +.collections-application { + width: 100% !important; +} + +.loot-backdrop { + width: 100% !important; + background-size: cover !important; +} + +.rcp-fe-viewport-overlay { + z-index: 2; +} + +.rcp-fe-viewport-overlay>.screen-root:first-child { + border-top: 1px solid #1e282d; +} + +.invite-info-panel-container { + bottom: 40px !important; + /* z-index: 1; */ +} + +.vng-age-rating { + display: none; +} + +.left-nav-menu>* { + margin: 0 -4px !important; +} + +.right-nav-menu .main-navigation-menu-item:last-of-type { + margin-right: 0 !important; +} + +.right-nav-menu .main-navigation-menu-item { + width: 40px !important; +} + +/* landing pages */ + +.rcp-fe-viewport-persistent, +.rcp-fe-viewport-persistent>* { + width: 100% !important; +} + + + +/* postgame stats */ + +.postgame-header-container { + padding-right: 250px; + width: unset !important; +} \ No newline at end of file