From a1f4b0604fef81f5608fa47ad8359e02bee8bbd6 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Thu, 21 Mar 2024 08:29:13 -0300 Subject: add nationstates css snippet; reformat css --- plugins/style/style.c | 2 +- plugins/style/style.h | 2 +- plugins/style/style.js | 33 +++++++++++++++++++++++---------- 3 files changed, 25 insertions(+), 12 deletions(-) (limited to 'plugins/style') diff --git a/plugins/style/style.c b/plugins/style/style.c index 1c19ae1..a99bd78 100644 --- a/plugins/style/style.c +++ b/plugins/style/style.c @@ -1,7 +1,7 @@ #include #include #include -#define STYLE_N 7275 + 1000 +#define STYLE_N 7274 + 1000 void read_style_js(char* string) { diff --git a/plugins/style/style.h b/plugins/style/style.h index c8caac6..e2751ec 100644 --- a/plugins/style/style.h +++ b/plugins/style/style.h @@ -1,7 +1,7 @@ #ifndef STYLE #define STYLE -#define STYLE_N 7275 + 1000 +#define STYLE_N 7274 + 1000 void read_style_js(char* string); diff --git a/plugins/style/style.js b/plugins/style/style.js index 0fba49f..f826996 100644 --- a/plugins/style/style.js +++ b/plugins/style/style.js @@ -1,10 +1,17 @@ -// Replicates the Stylus app: +// Inspired by the Stylus app: var styles = null; +/* + +.class +#id + +*/ + if (document.domain == "forum.effectivealtruism.org") { - /* styles = ` + /* .Layout-main { margin-left: 100px; } @@ -19,12 +26,16 @@ if (document.domain == "forum.effectivealtruism.org") { .intercom-lightweight-app{ display: none; } - `; - var styleSheet = document.createElement("style"); - styleSheet.innerText = styles; - document.head.appendChild(styleSheet); - console.log("Style changed"); */ + `; +} + +if (document.domain == "nationstates.net") { + styles = ` + .adidentifier { + display: none; + } + `; } if (document.domain == "mail.proton.me") { @@ -152,9 +163,11 @@ if (document.domain == "twitter.com") { document .querySelectorAll('[data-testid="videoPlayer"]') .forEach(function (videoPlayer) { - var grandparentElement = videoPlayer.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement; - var newTextElement = document.createElement('div'); - newTextElement.textContent = ' [ twitter video ] '; + var grandparentElement = + videoPlayer.parentElement.parentElement.parentElement.parentElement + .parentElement.parentElement; + var newTextElement = document.createElement("div"); + newTextElement.textContent = " [ twitter video ] "; newTextElement.style["margin-top"] = "10px"; newTextElement.style["margin-left"] = "10px"; newTextElement.style["margin-bottom"] = "10px"; -- cgit v1.2.3