Milovana Dark Mode

This is the place for general discussions on fetishes, sexuality and anything else. What's on your mind right now?
Alternatecouple
Curious Newbie
Curious Newbie
Posts: 1
Joined: Mon Jan 29, 2024 8:19 am

Re: Milovana Dark Mode

Post by Alternatecouple »

Oh, thank you so much for this.
User avatar
PlayfulGuy
Experimentor
Experimentor
Posts: 1079
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: Milovana Dark Mode

Post by PlayfulGuy »

Hi FrozenWolf!

I've got a small issue with the dark mode script and hope you can help.

I'm using Firefox and TamperMonkey.

When the script is active if I right click an image in a thread on milovana and select "Open image in new tab" I get this (using the stats image in your recent post in the MiloDB thread for example):
Spoiler: show
20260307 12_15_26-Greenshot.jpg
20260307 12_15_26-Greenshot.jpg (249.85 KiB) Viewed 2930 times
The top of the image is scrolled up off the screen, and only half the image is visible. If I turn off the milovana dark mode script and hit refresh it displays normally like this:
Spoiler: show
20260307 12_22_06-Greenshot.jpg
20260307 12_22_06-Greenshot.jpg (404.27 KiB) Viewed 2930 times
I've looked over the script and can't tell for sure what might be causing it, but given that turning the script off fixes it, it must be something in there.

Any thoughts would be much appreciated!

PG
kerkersklave
Explorer At Heart
Explorer At Heart
Posts: 711
Joined: Sun Jul 06, 2014 2:11 pm
Gender: Male
Sexual Orientation: Open to new ideas!
I am a: Slave

Re: Milovana Dark Mode

Post by kerkersklave »

Just discovered this useful thing.
The issue with images opened in a new tab is, that this is a plain image. The userscript inserts some css, this converts it into a website somehow, and this is rendered differently.
I've fixed the issue by checking the mime type, and also removed the exclude-directive and checked instead of eos in javascript:

Code: Select all

// ==UserScript==
// @name         Milovana Dark
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  Darken Milovana colours
// @author       FrozenWolf
// @match        https://milovana.com/*
// @icon         https://milovana.com/favicon.ico
// @grant        GM_addStyle
// @run-at       document-start
// ==/UserScript==

/* Depending on which type of manipulator is being used, GM_addStyle(...) may not be
 * available. Helequin has provided the function below so it can be included if needed.
 *   TamperMonkey  - No change needed
 *   ViolentMonkey - No change needed
 *   GreaseMonkey  - Might need to uncomment the function
 *   FireMonkey    - Might need to uncomment the function */
/*
function GM_addStyle(css) {
  const head = document.querySelector('head');
  if (head) {
    const style = document.createElement('style');
    style.textContent = css;
    head.appendChild(style);
  }
}
*/

let style = '';

if (document.URL.startsWith('https://milovana.com/forum/')) {
    style += `
        html {
            background-color: #444 !important;
        }
    `;
}

style += `
    body:not(.eosTopBody) {
        filter: invert() hue-rotate(180deg) !important;
        background-color: #444 !important;
        background-blend-mode: darken !important;
    }
    body#phpbb {
        background-image: none !important;
        background-color: #bbb !important;
    }
    img#h_logo, .profile-rank img {
        filter: none !important;
    }
    img {
        filter: invert() hue-rotate(180deg) !important;
    }
    iframe:not(.eosIframe):not(:fullscreen) {
      filter: invert() hue-rotate(180deg) !important;
    }
    .rating .score {
        filter: brightness(50%) !important;
    }
    .isfav {
        filter: saturate(9) !important;
    }
    .forabg, .forumbg {
        background-image: none !important;
        background-color: #666 !important;
    }
    .topiclist.forums, .topiclist.topics, .row.bg1, .row.bg2 {
        background-image: none! important;
        background-color: #ddd !important;
    }
    .forumtitle, .topictitle, .postbody h3 {
        color: #000 !important;
    }
    .postbody h3 a:hover, .postbody h3 a:link {
        color: #000 !important;
    }
    .lastsubject {
        color: #222 !important;
    }
    .username {
        color: #444 !important;
    }
    .codebox code {
        color: #220 !important;
    }
    blockquote {
        border: #333 0.2em solid !important;
        border-radius: 0.2em !important;
        background-color: #fff !important;
    }
    blockquote cite {
        border-bottom: #333 0.2em solid !important;
        background-color: #ddd !important;
    }
`;

if(document.contentType === "text/html") {
    GM_addStyle(style);
}

Last edited by kerkersklave on Sun Mar 08, 2026 12:12 am, edited 2 times in total.
User avatar
PlayfulGuy
Experimentor
Experimentor
Posts: 1079
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: Milovana Dark Mode

Post by PlayfulGuy »

kerkersklave wrote: Sat Mar 07, 2026 9:52 pm Just discovered this useful thing.
The issue with images opened in a new tab is, that this is a plain image. The userscript inserts some css, this converts it into a website somehow, and this is rendered differently.
I've fixed the issue by checking the mime type, and also removed the exclude-directive and checked instead of eos in javascript:
You, are a wizard! Thanks so much. That's been bugging me for a long time and I keep forgetting to post here and ask about it.
My HTML and CSS knowledge just wasn't sufficient to figure it out.

Thanks!

PG
kerkersklave
Explorer At Heart
Explorer At Heart
Posts: 711
Joined: Sun Jul 06, 2014 2:11 pm
Gender: Male
Sexual Orientation: Open to new ideas!
I am a: Slave

Re: Milovana Dark Mode

Post by kerkersklave »

PlayfulGuy wrote: Sat Mar 07, 2026 11:21 pm You, are a wizard! Thanks so much. That's been bugging me for a long time and I keep forgetting to post here and ask about it.
My HTML and CSS knowledge just wasn't sufficient to figure it out.
Thx. I had to edit it again just now though. My eos detection didn't quite work, I didn't test it in full screen mode. Now it does.
User avatar
PlayfulGuy
Experimentor
Experimentor
Posts: 1079
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: Milovana Dark Mode

Post by PlayfulGuy »

kerkersklave wrote: Sat Mar 07, 2026 11:26 pm
PlayfulGuy wrote: Sat Mar 07, 2026 11:21 pm You, are a wizard! Thanks so much. That's been bugging me for a long time and I keep forgetting to post here and ask about it.
My HTML and CSS knowledge just wasn't sufficient to figure it out.
Thx. I had to edit it again just now though. My eos detection didn't quite work, I didn't test it in full screen mode. Now it does.
Excellent! Thanks again. I actually tested everything except EOS as well :lol:

PG
kerkersklave
Explorer At Heart
Explorer At Heart
Posts: 711
Joined: Sun Jul 06, 2014 2:11 pm
Gender: Male
Sexual Orientation: Open to new ideas!
I am a: Slave

Re: Milovana Dark Mode

Post by kerkersklave »

And an other update... Remembered I maybe should test the EOS editor, and of course there the preview works slightly different.

Now it should all work and I got away with doing it all in CSS. This inverting the body and inverting an iframe back together with fullscreen mode which somehow takes the fullscreen element out of the normal document structure regarding css is tricky. But as seraph0x doesn't change the site too much, it shouldn't bee too fragile.
User avatar
FrozenWolf
Explorer At Heart
Explorer At Heart
Posts: 435
Joined: Tue Oct 30, 2018 7:50 pm
Gender: Male
Sexual Orientation: Straight
I am a: Switch
Dom/me(s): None
Sub/Slave(s): None
Location: UK

Re: Milovana Dark Mode

Post by FrozenWolf »

Alternatecouple wrote: Thu Mar 05, 2026 11:10 pm Oh, thank you so much for this.
Yay, glad it's still getting some use! :-)
PlayfulGuy wrote: Sat Mar 07, 2026 7:27 pm When the script is active if I right click an image in a thread on milovana and select "Open image in new tab" I get this (using the stats image in your recent post in the MiloDB thread for example):
Spoiler: show
20260307 12_15_26-Greenshot.jpg
The top of the image is scrolled up off the screen, and only half the image is visible. If I turn off the milovana dark mode script and hit refresh it displays normally like this:
Spoiler: show
20260307 12_22_06-Greenshot.jpg
Good spot, somehow I'd never noticed that before. I don't know why applying an image filter changes its vertical position. I think I'm at the limit of my CSS skills/knowledge.
kerkersklave wrote: Sun Mar 08, 2026 12:15 am And an other update... Remembered I maybe should test the EOS editor, and of course there the preview works slightly different.

Now it should all work and I got away with doing it all in CSS. This inverting the body and inverting an iframe back together with fullscreen mode which somehow takes the fullscreen element out of the normal document structure regarding css is tricky. But as seraph0x doesn't change the site too much, it shouldn't bee too fragile.
Fantastic! :w00t: You're clearly far more skilled in this area than I am, thanks for spending the time to fix up the script. I've tried out your improved version and it all seems to work very nicely indeed, and the dark mode now effecting the classic/regular/plain/whatever-people-call-them teases is great, something I couldn't get to work properly without wrecking EOS teases.

I'll update the first post with your revised version.
User avatar
FrozenWolf
Explorer At Heart
Explorer At Heart
Posts: 435
Joined: Tue Oct 30, 2018 7:50 pm
Gender: Male
Sexual Orientation: Straight
I am a: Switch
Dom/me(s): None
Sub/Slave(s): None
Location: UK

Re: Milovana Dark Mode

Post by FrozenWolf »

v0.5
Many thanks to kerkersklave for providing an improved version with the following:
  • Fixed: Opened images no longer have their top-half cut off.
  • Added: Dark mode now applies to Regular/Classic/Plain/whatever-you-call-them teases.
JohnP919
Curious Newbie
Curious Newbie
Posts: 1
Joined: Sat Apr 11, 2026 5:01 am
Gender: Male
Sexual Orientation: Straight
I am a: Submissive

Re: Milovana Dark Mode

Post by JohnP919 »

Supernice, much appreciated! :-D
Post Reply