Skip to content

Commit

Permalink
first round of CSS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlterTobi committed Nov 2, 2023
1 parent 3d7f8b3 commit 3a3ea13
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions no_support/wfes-reviewImproveCSS.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @name Review Improve CSS
// @version 1.0.9
// @description fix for small height in Wayfarer 5.2
// @version 1.0.10
// @description CSS modifcations for Wayfarer 5.7
// @author AlterTobi

(function() {
Expand All @@ -24,13 +24,13 @@
.wfes-fit-content { max-width: fit-content; }
`;

const cardSelectors = ["app-should-be-wayspot > wf-review-card", "app-title-and-description > wf-review-card", "app-supporting-info > wf-review-card"];
const cardSelectors = ["app-photo-b > wf-review-card", "app-title-and-description-b > wf-review-card", "app-supporting-info-b > wf-review-card"];
const dupeSelector = "#check-duplicates-card";
const titleSelector = "#title-description-card > div.wf-review-card__body > div > a > div";
const descriptionSelector = "#title-description-card > div.wf-review-card__body > div > div";
const starsCardsSelectors = ["#historical-cultural-card", "#visually-unique-card", "#safe-access-card"];
const historicalCard = "#historical-cultural-card";
const commentH4Selector = "app-review-comments > wf-review-card > div.wf-review-card__header > div:nth-child(1) > h4";
// const starsCardsSelectors = ["#historical-cultural-card", "#visually-unique-card", "#safe-access-card"];
// const historicalCard = "#historical-cultural-card";
const ccategorySelector = "app-review-categorization-b > wf-review-card > div.wf-review-card__header > div:nth-child(1) > h4";

function reviewImproveCSS() {
window.wfes.f.addCSS(myCssId, myStyle);
Expand All @@ -47,17 +47,16 @@
window.wfes.f.waitForElem(descriptionSelector).then((elem)=>{elem.classList.add("wfes-text-lg");});

// remove empty space in "stars-only" cards
starsCardsSelectors.forEach(selector => {
window.wfes.f.waitForElem(selector).then((elem)=>{elem.classList.add("wfes-stars-cards");});
});
// starsCardsSelectors.forEach(selector => {
// window.wfes.f.waitForElem(selector).then((elem)=>{elem.classList.add("wfes-stars-cards");});
// });

// remove spaces between cards - grid class
window.wfes.f.waitForElem(historicalCard).then((elem)=>{elem.parentElement.parentElement.classList.remove("grid");});
// window.wfes.f.waitForElem(historicalCard).then((elem)=>{elem.parentElement.parentElement.classList.remove("grid");});

// make all H4 smaller, margins in card headers too
window.wfes.f.waitForElem(commentH4Selector).then((elem)=>{
elem.classList.add(".wfes-h4");
const headerlist =document.querySelectorAll(".wf-review-card__header");
// make all H4 smaller, wait for last box first
window.wfes.f.waitForElem(ccategorySelector).then(()=>{
const headerlist = document.querySelectorAll(".wf-review-card__header");
headerlist.forEach(elem =>{elem.classList.add("wfes-card__header");});
});
}
Expand All @@ -77,8 +76,7 @@
window.addEventListener("WFESReviewPageEditLoaded", editImproveCSS);
}

// init();
window.addEventListener("WFESReviewPageEditLoaded", editImproveCSS);
init();

console.log("Script loaded:", GM_info.script.name, "v" + GM_info.script.version);
})();

0 comments on commit 3a3ea13

Please sign in to comment.