diff --git a/src/css/redditChanges.css b/src/css/redditChanges.css index f584f96..4c60fc5 100644 --- a/src/css/redditChanges.css +++ b/src/css/redditChanges.css @@ -25,9 +25,6 @@ .midcol { margin: 0 !important; } -.ol-post-container > .thing:not(.comment) { - display: flex; -} .ol-post-container > .thing .entry { flex-grow: 1; } diff --git a/src/features/posts/css/postIcons.css b/src/features/posts/css/postIcons.css index 0e35f5a..0a6138a 100644 --- a/src/features/posts/css/postIcons.css +++ b/src/features/posts/css/postIcons.css @@ -1,12 +1,34 @@ :root { - --icon-size: 14px; + --icon-size: 28px; } -.thing .flat-list a { +[data-type="comment"] { + --icon-size: 20px !important; +} +.ol-post-container > .thing:not(.comment) { + display: flex +} +.ol-post-container > .thing:not(.comment) > .parent { + display: none; +} +.flat-list.buttons { + overflow-y: scroll; + width: 100%; + max-width: 100%; + display: flex; + flex-direction: row; + justify-content: space-around; + color: var(--md-sys-color-primary); + padding-bottom: 3px; + order: 1000; +} +.flat-list.buttons a { width: 100%; text-align: center; font-size: var(--icon-size); + color: var(--md-sys-color-primary); } -.thing .flat-list a::before { +.flat-list.buttons a::before { + color: var(--md-sys-color-primary); display: inline-block; text-rendering: auto; -webkit-font-smoothing: antialiased; @@ -27,8 +49,15 @@ text-rendering: optimizeLegibility; font-feature-settings: "liga"; } -.comments::before { +.comments { + font-size: 9pt !important; + font-weight: bold; + display: flex; + flex-direction: column; +} +.flat-list.buttons a.comments::before { content: "comment"; + font-size: calc(var(--icon-size) - 50%) !important; } .riok-share::before { content: "share"; @@ -96,6 +125,9 @@ a[data-text="show all child comments"]::before, .RES-save::before { content: "hard_drive_2" !important; } +.reply-button { + order: -1; +} .reply-button a::before { content: "reply"; } @@ -132,3 +164,8 @@ div.thumbnail { border-radius: 7px; padding: 5px 10px; } +li:has(.bylink[data-event-action="parent"]), +li:has(.embed-comment), +li.viewSource { + display: none !important; +} diff --git a/src/features/posts/index.ts b/src/features/posts/index.ts index 790e3d6..96d28fb 100644 --- a/src/features/posts/index.ts +++ b/src/features/posts/index.ts @@ -9,7 +9,6 @@ import { OLFeature } from "../base"; import NativeShare from "./nativeSharing"; function setupPost(post: HTMLDivElement) { - console.log("Setting up post", post) const postContainer = setupPostContainer(post); setupExpando(post); setupExpandoButton(postContainer); diff --git a/src/features/posts/postContainer.ts b/src/features/posts/postContainer.ts index 0fb72f8..d42f4fd 100644 --- a/src/features/posts/postContainer.ts +++ b/src/features/posts/postContainer.ts @@ -1,13 +1,16 @@ export default function setupPostContainer(post: HTMLDivElement) { // create new postContainer div to hold post & expando preview const postContainer = document.createElement("div"); + postContainer.append(...post.children) + Object.assign(postContainer.dataset, post.dataset) postContainer.classList.add("ol-post-container"); - const clearLeft = post.nextElementSibling; // i don't know what this div is but let's put it inside too - post.before(postContainer); - postContainer.appendChild(post); - if (clearLeft) { - postContainer.appendChild(clearLeft); - } - + // const clearLeft = post.nextElementSibling; // i don't know what this div is but let's put it inside too + // post.before(postContainer); + // postContainer.appendChild(post); + // if (clearLeft) { + // postContainer.appendChild(clearLeft); + // } + post.appendChild(postContainer); + post.insertBefore((post.querySelector(".flat-list.buttons") as HTMLDivElement), post.querySelector(".entry")) return postContainer; } diff --git a/src/features/posts/postToggles.ts b/src/features/posts/postToggles.ts index 535c5c3..1ebcd5b 100644 --- a/src/features/posts/postToggles.ts +++ b/src/features/posts/postToggles.ts @@ -6,7 +6,6 @@ function setupGenericToggle( onValue: string ) { waitForAllElements("#" + post.id + " " + buttonSelector, (button: HTMLButtonElement) => { - console.log("setting up generic toggle", button); if (!button) { return; }