|
3 | 3 | * @author programmer2514 |
4 | 4 | * @authorId 563652755814875146 |
5 | 5 | * @description A feature-rich BetterDiscord plugin that reworks the Discord UI to be significantly more modular |
6 | | - * @version 12.3.1 |
| 6 | + * @version 12.3.2 |
7 | 7 | * @donate https://ko-fi.com/benjaminpryor |
8 | 8 | * @patreon https://www.patreon.com/BenjaminPryor |
9 | 9 | * @website https://github.com/programmer2514/BetterDiscord-CollapsibleUI |
@@ -155,14 +155,14 @@ const settings = { |
155 | 155 | const config = { |
156 | 156 | changelog: [ |
157 | 157 | { |
158 | | - title: '12.3.1', |
| 158 | + title: '12.3.2', |
159 | 159 | type: 'added', |
160 | 160 | items: [ |
161 | | - 'Added BetterAnimations compatibility', |
| 161 | + 'Fixed profile panel visual glitches on resize', |
162 | 162 | ], |
163 | 163 | }, |
164 | 164 | { |
165 | | - title: '1.0.0 - 12.3.0', |
| 165 | + title: '1.0.0 - 12.3.1', |
166 | 166 | type: 'added', |
167 | 167 | items: [ |
168 | 168 | 'See the full changelog here: https://programmer2514.github.io/?l=cui-changelog', |
@@ -1150,6 +1150,7 @@ const modules = { |
1150 | 1150 | get callButtons() { return this._callButtons ?? (this._callButtons = runtime.api.Webpack.getByKeys('controlButton', 'wrapper', 'buttonContainer')); }, |
1151 | 1151 | get userAreaButtons() { return this._userAreaButtons ?? (this._userAreaButtons = runtime.api.Webpack.getByKeys('actionButtons', 'micTestButton', 'buttonIcon')); }, |
1152 | 1152 | get scroller() { return this._scroller ?? (this._scroller = runtime.api.Webpack.getByKeys('wrapper', 'scroller', 'discoveryIcon')); }, |
| 1153 | + get profileWrappers() { return this._profileWrappers ?? (this._profileWrappers = runtime.api.Webpack.getByKeys('header', 'footerButton', 'widgetBreadcrumb', 'wishlistBreadcrumb')); }, |
1153 | 1154 | }; |
1154 | 1155 |
|
1155 | 1156 | const elements = { |
@@ -1658,41 +1659,46 @@ const styles = { |
1658 | 1659 | { |
1659 | 1660 | _index: constants.I_USER_PROFILE, |
1660 | 1661 | get _init() { |
1661 | | - if (document.querySelector(`.${modules.panel?.outer} header > svg`)) document.querySelector(`.${modules.panel?.outer} header > svg`).style.maxHeight = document.querySelector(`.${modules.panel?.outer} header > svg`).style.minHeight; |
1662 | | - document.querySelector(`.${modules.panel?.outer} header > svg > mask > rect`)?.setAttribute('width', '500%'); |
1663 | | - document.querySelector(`.${modules.panel?.outer} header > svg`)?.removeAttribute('viewBox'); |
| 1662 | + let panelPath = `.${modules.guilds?.content} .${modules.panel?.outer}`; |
| 1663 | + let headerPath = `${panelPath} .${modules.profileWrappers?.header}`; |
| 1664 | + |
| 1665 | + if (document.querySelector(`${headerPath} > svg`)) |
| 1666 | + document.querySelector(`${headerPath} > svg`).style.maxHeight = document.querySelector(`${headerPath} > svg`).style.minHeight; |
| 1667 | + document.querySelector(`${headerPath} > svg > mask > rect`)?.setAttribute('width', '500%'); |
| 1668 | + document.querySelector(`${headerPath} > svg`)?.removeAttribute('viewBox'); |
| 1669 | + |
1664 | 1670 | return this.__init ?? (this.__init = [`${runtime.meta.name}-userProfile_init`, ` |
1665 | | - .${modules.guilds?.content} .${modules.panel?.outer} { |
| 1671 | + ${panelPath} { |
1666 | 1672 | max-width: var(--cui-user-profile-width) !important; |
1667 | 1673 | width: var(--cui-user-profile-width) !important; |
1668 | 1674 | min-width: var(--cui-user-profile-width) !important; |
1669 | 1675 | transition: max-width var(--cui-transition-speed), width var(--cui-transition-speed), min-width var(--cui-transition-speed); |
1670 | 1676 | min-height: 100% !important; |
1671 | 1677 | } |
1672 | 1678 |
|
1673 | | - .${modules.guilds?.content} .${modules.panel?.outer} .${modules.panel?.inner} { |
| 1679 | + ${panelPath} .${modules.panel?.inner} { |
1674 | 1680 | border-left: 1px solid var(--border-subtle) !important; |
1675 | 1681 | } |
1676 | 1682 |
|
1677 | | - .${modules.guilds?.content} .${modules.panel?.outer} > * { |
| 1683 | + ${panelPath} > * { |
1678 | 1684 | width: 100% !important; |
1679 | 1685 | } |
1680 | 1686 |
|
1681 | | - .${modules.guilds?.content} .${modules.panel?.outer} header > svg { |
| 1687 | + ${headerPath} > svg { |
1682 | 1688 | min-width: 100% !important; |
1683 | 1689 | } |
1684 | 1690 |
|
1685 | | - .${modules.guilds?.content} .${modules.panel?.outer} header > svg > mask > rect { |
| 1691 | + ${headerPath} > svg > mask > rect { |
1686 | 1692 | width: 500% !important; |
1687 | 1693 | } |
1688 | 1694 |
|
1689 | | - .${modules.guilds?.content} .${modules.panel?.outer} .${modules.effects?.effect} { |
| 1695 | + ${panelPath} .${modules.effects?.effect} { |
1690 | 1696 | min-height: 100% !important; |
1691 | 1697 | } |
1692 | 1698 |
|
1693 | 1699 | ${(settings.userProfileWidth) |
1694 | 1700 | ? ` |
1695 | | - .${modules.guilds?.content} .${modules.panel?.outer}:before { |
| 1701 | + ${panelPath}:before { |
1696 | 1702 | cursor: e-resize; |
1697 | 1703 | z-index: 200; |
1698 | 1704 | position: absolute; |
@@ -1750,9 +1756,11 @@ const styles = { |
1750 | 1756 | `.replace(/\s+/g, ' ')]); |
1751 | 1757 | }, |
1752 | 1758 | _clear: function () { |
1753 | | - document.querySelector(`.${modules.guilds?.content} .${modules.panel?.outer} header > svg`)?.style.removeProperty('max-height'); |
1754 | | - document.querySelector(`.${modules.guilds?.content} .${modules.panel?.outer} header > svg > mask > rect`)?.setAttribute('width', '100%'); |
1755 | | - document.querySelector(`.${modules.guilds?.content} .${modules.panel?.outer} header > svg`)?.setAttribute('viewBox', `0 0 ${parseInt(document.querySelector(`.${modules.panel?.outer} header > svg`)?.style.minWidth)} ${parseInt(document.querySelector(`.${modules.panel?.outer} header > svg`)?.style.minHeight)}`); |
| 1759 | + let headerPath = `.${modules.guilds?.content} .${modules.panel?.outer} .${modules.profileWrappers?.header}`; |
| 1760 | + |
| 1761 | + document.querySelector(`${headerPath} > svg`)?.style.removeProperty('max-height'); |
| 1762 | + document.querySelector(`${headerPath} > svg > mask > rect`)?.setAttribute('width', '100%'); |
| 1763 | + document.querySelector(`${headerPath} > svg`)?.setAttribute('viewBox', `0 0 ${parseInt(document.querySelector(`${headerPath} > svg`)?.style.minWidth)} ${parseInt(document.querySelector(`${headerPath} > svg`)?.style.minHeight)}`); |
1756 | 1764 | }, |
1757 | 1765 | ...styleFunctions, |
1758 | 1766 | }, |
|
0 commit comments