Giter Site home page Giter Site logo

jarlg / melatonin Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 1.0 372 KB

Melatonin, an F.lux-like extension for Chrome, intended for Chromebooks

Home Page: https://jarlg.github.io/melatonin

License: MIT License

JavaScript 61.91% HTML 3.37% CSS 4.87% CoffeeScript 29.86%

melatonin's People

Contributors

giraj avatar jarlg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jmegan

melatonin's Issues

hard-light blended instead of semi-transparent overlay

Hi.

This will yield much better simulation of a gamma adjusted/redshiftet display. You will avoid whitewashing images and text will remain a much higher contrast and readability.

overlay
{
    /* existing overlay code */
    background-color: rgb(255 98 0);
    opacity: 0.5;
    mix-blend-mode: hard-light;
}
@supports not (mix-blend-mode: hard-light)
{
    overlay
    {
        /* fallback method */
        background-color: rgba(255 98 0, 0.2);
        opacity: 1;
    }
   dialog
   {
       display: block;
       /* dialog telling user to enable chrome://flags#enable-experimental-canvas-features */
    }
}

You have to use opacity and not rgba with mix-blend-mode.

Use custom element instead of generic div element

Reduces risk of sites adding paddings, margins, or other styles to the overlay with selectors like body div, body div:first-of-kind, or even plain div. Should make overlay more robust and predictable.

document.registerElement("melatonin-overlay");
document.createElement('melatonin-overlay');
…

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.