Skip to content

Commit

Permalink
Increase button size
Browse files Browse the repository at this point in the history
  • Loading branch information
OctoNezd committed Dec 31, 2023
1 parent 7c2ed16 commit d544851
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 16 deletions.
3 changes: 0 additions & 3 deletions src/css/redditChanges.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
.midcol {
margin: 0 !important;
}
.ol-post-container > .thing:not(.comment) {
display: flex;
}
.ol-post-container > .thing .entry {
flex-grow: 1;
}
Expand Down
45 changes: 41 additions & 4 deletions src/features/posts/css/postIcons.css
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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";
Expand Down Expand Up @@ -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";
}
Expand Down Expand Up @@ -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;
}
1 change: 0 additions & 1 deletion src/features/posts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
17 changes: 10 additions & 7 deletions src/features/posts/postContainer.ts
Original file line number Diff line number Diff line change
@@ -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;
}
1 change: 0 additions & 1 deletion src/features/posts/postToggles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ function setupGenericToggle(
onValue: string
) {
waitForAllElements("#" + post.id + " " + buttonSelector, (button: HTMLButtonElement) => {
console.log("setting up generic toggle", button);
if (!button) {
return;
}
Expand Down

0 comments on commit d544851

Please sign in to comment.