Skip to content

Commit

Permalink
v1.0.18 - Lint, updates, fixes, new version
Browse files Browse the repository at this point in the history
  • Loading branch information
OIRNOIR committed Nov 25, 2024
1 parent d5ddc61 commit fd12b94
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 71 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"discordID": "720842469024989195",
"github": "oirnoir"
},
"version": "1.0.17",
"version": "1.0.18",
"updater": {
"type": "store",
"id": "dev.oirnoir.RemoveDiscordMosaic"
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "remove-discord-mosaic",
"version": "1.0.17",
"version": "1.0.18",
"description": "A theme to remove Discord's new image mosaic",
"engines": {
"node": ">=14.0.0"
Expand All @@ -16,9 +16,9 @@
"author": "OIRNOIR",
"license": "ISC",
"devDependencies": {
"@biomejs/biome": "^1.9.3",
"replugged": "^4.8.1",
"typescript": "^5.6.3"
"@biomejs/biome": "^1.9.4",
"replugged": "^4.8.3",
"typescript": "^5.7.2"
},
"packageManager": "pnpm@9.12.1+sha512.e5a7e52a4183a02d5931057f7a0dbff9d5e9ce3161e33fa68ae392125b79282a8a8a470a51dfc8a0ed86221442eb2fb57019b0990ed24fab519bf0e1bc5ccfc4"
"packageManager": "pnpm@9.14.2+sha512.6e2baf77d06b9362294152c851c4f278ede37ab1eba3a55fda317a4a17b209f4dbb973fb250a77abc463a341fcb1f17f17cfa24091c4eb319cda0d9b84278387"
}
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 24 additions & 15 deletions src/legacyFallbackCode/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@
Code derived from a snippet by teltta on Discord
*/

[class*="ByOneGrid-"]

[class*="ByOneGrid-"],
/*:not([class*="OneGridSingle-"])*/
,
[class*="ByTwoGrid-"],
[class*="ByTwoGrid-"],
[class*="ByThreeGrid-"] {
display: flex;
flex-direction: column;
max-height: 100%;
}

html body div[class*="ByOneGrid-"]

/*:not([class*="OneGridSingle-"])*/
img[class*="lazyImg"],
html
body
div[class*="ByOneGrid-"]
/*:not([class*="OneGridSingle-"])*/
img[class*="lazyImg"],
html body div[class*="ByTwoGrid-"] img[class*="lazyImg"],
html body div[class*="ByThreeGrid-"] img[class*="lazyImg"] {
aspect-ratio: unset;
Expand All @@ -31,10 +30,11 @@ html body div[class*="ByThreeGrid-"] img[class*="lazyImg"] {
max-width: 100% !important;
}

html body div[class*="ByOneGrid-"]

/*:not([class*="OneGridSingle-"])*/
[class*="video-"]:not([data-fullscreen="true"] *),
html
body
div[class*="ByOneGrid-"]
/*:not([class*="OneGridSingle-"])*/
[class*="video-"]:not([data-fullscreen="true"] *),
html body div[class*="ByTwoGrid-"] [class*="video-"]:not([data-fullscreen="true"] *),
html body div[class*="ByThreeGrid-"] [class*="video-"]:not([data-fullscreen="true"] *) {
aspect-ratio: unset;
Expand Down Expand Up @@ -79,9 +79,18 @@ html body div[class*="ByThreeGrid-"] [class*="video-"]:not([data-fullscreen="tru
aspect-ratio: unset;
}

[class*="ByOneGrid-"] *:not(div[class*="wrapperMediaMosaic-"] *):not([class*="wrapperMediaMosaic-"]):not(img[class*="lazyImg-"]):not([class*="messageAttachmentMediaMosaic-"]),
[class*="ByTwoGrid-"] *:not(div[class*="wrapperMediaMosaic-"] *):not([class*="wrapperMediaMosaic-"]):not(img[class*="lazyImg-"]):not([class*="messageAttachmentMediaMosaic-"]),
[class*="ByThreeGrid-"] *:not(div[class*="wrapperMediaMosaic-"] *):not([class*="wrapperMediaMosaic-"]):not(img[class*="lazyImg-"]):not([class*="messageAttachmentMediaMosaic-"]) {
[class*="ByOneGrid-"]
*:not(div[class*="wrapperMediaMosaic-"] *):not([class*="wrapperMediaMosaic-"]):not(img[class*="lazyImg-"]):not(
[class*="messageAttachmentMediaMosaic-"]
),
[class*="ByTwoGrid-"]
*:not(div[class*="wrapperMediaMosaic-"] *):not([class*="wrapperMediaMosaic-"]):not(img[class*="lazyImg-"]):not(
[class*="messageAttachmentMediaMosaic-"]
),
[class*="ByThreeGrid-"]
*:not(div[class*="wrapperMediaMosaic-"] *):not([class*="wrapperMediaMosaic-"]):not(img[class*="lazyImg-"]):not(
[class*="messageAttachmentMediaMosaic-"]
) {
width: unset !important;
height: unset !important;
max-width: unset !important;
Expand Down
75 changes: 38 additions & 37 deletions src/plaintextPatches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,53 @@ import type { PlaintextPatch } from "replugged/types";
// By yofukashino_

export default [
{
find: "mp3|m4a|ogg|opus|wav|flac",
replacements: [
/* {
{
find: "mp3|m4a|ogg|opus|wav|flac",
replacements: [
/* {
match: /\(0,\w+?\.\w+?\)\(\w+?\)\?"IMAGE":\(0,\w+?\.\w+?\)\(\w+?\)\?"VIDEO":"INVALID"/, // 499376
replace: '"INVALID"',
}, */
{
match: /"IMAGE"===\w+\|\|"VIDEO"===\w+?\|\|"VISUAL_PLACEHOLDER"===\w+?;/, // 499376
replace: "false;",
},
],
},
{
find: ".gifFavoriteButton,",
replacements: [
{
match: /mediaLayoutType:(\w+\.\w+\.MOSAIC)/, // 884182
replace:
'mediaLayoutType:replugged.plugins.getExports("dev.oirnoir.RemoveDiscordMosaic")?.cfg?.get?.("static", false) ? "STATIC" : "RESPONSIVE"',
},
{
match: /"IMAGE"===\w+\|\|"VIDEO"===\w+?\|\|"VISUAL_PLACEHOLDER"===\w+?;/, // 499376
replace: "false;",
},
],
},
{
find: ".gifFavoriteButton,",
replacements: [
{
match: /mediaLayoutType:(\w+\.\w+\.MOSAIC)/, // 884182
replace:
'mediaLayoutType:replugged.plugins.getExports("dev.oirnoir.RemoveDiscordMosaic")?.cfg?.get?.("static", false) ? "STATIC" : "RESPONSIVE"',
},
/* {
match: /[\w_+]===\w+\.\w+\.MOSAIC/, // 23750
replace: "true",
}, */
],
},
{find: "MediaMosaicItem",
],
},
{
find: "MediaMosaicItem",
replacements: [
{
match: /[\w_+]===\w+\.\w+\.MOSAIC/, // 546432
replace: "true",
},
match: /[\w_+]===\w+\.\w+\.MOSAIC/, // 546432
replace: "true",
},
{
match: /\["VIDEO","CLIP","AUDIO"\]\.includes/, // 546432
replace: '["VIDEO","CLIP","AUDIO","IMAGE"].includes',
},
],
},
{
find: "Media Mosaic",
replacements: [
{
match: /\["VIDEO","CLIP","AUDIO"\]\.includes/, // 546432
replace: '["VIDEO","CLIP","AUDIO","IMAGE"].includes',
},
],
match: /\w+\.length>1/, // 12067, 938353
replace: '(replugged.plugins.getExports("dev.oirnoir.RemoveDiscordMosaic")?.cfg?.get?.("nav", false) ? $& : false)',
},
],
},
{
find: "Media Mosaic",
replacements: [
{
match: /\w+\.length>1/, // 12067, 938353
replace: '(replugged.plugins.getExports("dev.oirnoir.RemoveDiscordMosaic")?.cfg?.get?.("nav", false) ? $& : false)',
},
],
},
] as PlaintextPatch[];
12 changes: 6 additions & 6 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
By yofukashino_
*/

[class*=MediaItemContainer] [class*=mosaicItem]:has(> div > [class^=hoverButtonGroup]),
[class*=MediaItemContainer] [class*=mosaicItem]:has(> [class^=hoverButtonGroup]) {
[class*="MediaItemContainer"] [class*="mosaicItem"]:has(> div > [class^="hoverButtonGroup"]),
[class*="MediaItemContainer"] [class*="mosaicItem"]:has(> [class^="hoverButtonGroup"]) {
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: flex-end;
position: relative;
}

[class*=MediaItemContainer] [class^=hoverButtonGroup] {
position: absolute;
[class*="MediaItemContainer"] [class^="hoverButtonGroup"] {
position: absolute;
align-self: normal;
max-height: 32px;
max-width: 65px;
}

[class*=MediaItemContainer] [class^=hoverButtonGroup]:has(>:nth-child( n + 2 )) {
[class*="MediaItemContainer"] [class^="hoverButtonGroup"]:has(> :nth-child(n + 2)) {
right: 6px;
}

[class*=MediaItemContainer] [class^=hoverButtonGroup]:not(:has(>:nth-child( n + 2 ))) {
[class*="MediaItemContainer"] [class^="hoverButtonGroup"]:not(:has(> :nth-child(n + 2))) {
right: 4px;
}

0 comments on commit fd12b94

Please sign in to comment.